Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
christian_grail
Advisor
Advisor

The drop-in replacement has been developed to enable the SAP Desktop Office Integration (DOI) to run on more platforms and operating systems. The SAP Desktop Office Integration is a solution for application developers to integrate Office products like Microsoft Excel and Microsoft Word in their SAP GUI applications. This technology was developed in the 90s and is still heavily used by a lot of applications and customers. It is for example widely used to import and export data from and into an SAP system.

Until now the SAP Desktop Office Integration worked only on Microsoft Windows in combination with SAP GUI for Windows, because it relies on the OLE2 application interface which is only available to native applications like SAP GUI for Windows. With the shift to web applications and other operating systems like Apple macOS this has become an issue for customers who are using SAP GUI applications with SAP GUI for Java or SAP GUI for HTML.

If a customer tries to execute a program which is using the SAP Desktop Office Integration in SAP GUI for HTML or SAP GUI for Java, the program will terminate with the following exception:

Category:       ABAP programming error	

Runtime Errors: RAISE_EXCEPTION

Short Text:     Exception condition "JAVABEANNOTSUPPORTED" raised.    

 

What Is the Drop-In Replacement of the SAP Desktop Office Integration?

A drop-in replacement is a component which can replace another component without any other code or configuration changes. The drop-in replacement for the SAP Desktop Office Integration keeps on using the same interfaces as the current solution, but enables applications to also run in the web browser in SAP GUI for HTML or SAP GUI for Java. The goal is to keep the migration effort as low as possible and in most cases it's a one-line code-change. The first version of the drop-in replacement for the SAP Desktop Office Integration will support the import and export scenario of data using Microsoft Excel.

Overview of the Drop-In Replacement of the SAP Desktop Office Integration

Code Example of the Current SAP Desktop Office Integration

With the original implementation you have to get the container control from the class C_OI_CONTAINER_CONTROL_CREATOR and call the method get_container_control( ) which returns the container control object implementing the interface I_OI_CONTAINER_CONTROL. Using the container control object you've been able to get an instance of the document proxy through the method get_document_proxy( ) and on the document proxy instance you've been able to get an instance of the spreadsheet interface by calling the method get_spreadsheet_interface( ).

The code needed to set data in a sheet would look like the following:

c_oi_container_control_creator=>get_container_control( 

  IMPORTING control = DATA(container_control) ).

...

container_control->get_document_proxy( 

  EXPORTING document_type  = 'Excel.Sheet'

  IMPORTING document_proxy = DATA(document_proxy) ).

...

document_proxy->get_spreadsheet_interface( 

  IMPORTING sheet_interface = DATA(spreadsheet) ).

...

spreadsheet->set_ranges_data( ... ).

Required Code Change

To switch to the drop-in replacement for SAP Desktop Office Integration, you just have to change the initial call to obtain the container control. Instead of obtaining the container control from the class C_OI_CONTAINER_CONTROL_CREATOR, the container control will then be retrieved from the class CL_SOVY_CONTAINER_CONTROL. The subsequent calls or application logic do not need to be changed.

To enable the in-memory office integration to work properly, an integration mode needs to be provided. This is necessary, because the drop-in replacement needs to now know how it is intended to be used. Previously this was not needed because the Office application was opened at the beginning of the process. Because this is no longer possible in a web application or with SAP GUI for Java, we needed to introduce an integration mode. Of all the possible use cases, we currently support the following integration modes:

    • soi_mode_export
        • For use cases where data is being exported from an SAP system to a Microsoft Excel file.
    • soi_mode_import
        • For use cases where data is being imported into an SAP system from a Microsoft Excel file.

Required Code Change for the Export Use-Case

You need to get rid of the following line of code:

c_oi_container_control_creator=>get_container_control( ... ).

and replace it with the following line:

cl_sovy_container_control=>get_container_control(

  EXPORTING office_integration_mode = cl_sovy_container_control=>soi_mode_export

  IMPORTING control                 = DATA(container_control) ).

For the export use case, it is now mandatory to call one of the following methods to finalize the data export:

    • save_as( )
    • save_document_to_url( )
    • close_document( )
    • save_copy_as( )

This is a signal for the drop-in replacement that the file creation has been finished and can now be saved.

An example of the export use-case can be found in the package SOVY_IMP. The report TEST_SOVY_SHEET_EXPORT demonstrates how you can export data from an SAP system into an Excel Sheet.

Required Code Change for the Import Use-Case

You need to get rid of the following line of code:

c_oi_container_control_creator=>get_container_control( ... ).

and replace it with the following line:

cl_sovy_container_control=>get_container_control(

    EXPORTING office_integration_mode = cl_sovy_container_control=>soi_mode_import

    IMPORTING control                 = DATA(container_control) ).

All subsequent calls do not need to be modified. By default, the SAP GUI Desktop Office Integration will be used in SAP GUI for Windows. Therefore you don't risk anything but gain support for all other use-cases.

An example of the import use-case can be found in the package SOVY_IMP. The report TEST_SOVY_SHEET_IMPORT demonstrates how you can import data from an Excel sheet into an SAP System.

Configuration Options

The method cl_sovy_container_control=>get_container_control( ) can be configured by passing the optional parameter structure config. The following configuration options are possible:

    • enforce_new_integration: By default the in-memory office integration will fall back to the old SAP GUI for Windows based office integration, if the call is executed within a SAP GUI for Windows session. If you want to always enforce the use of the in-memory office integration, you can override this by setting the value to:
        • enforce_new_integration = ABAP_TRUE
    • disable_unimplemented_errors: By default the in-memory office integration will throw exceptions, if unimplemented methods are being invoked. The reason is that the in-memory office integration doesn't implement the full feature set of the API. You can prevent the raising of errors by setting the value to:
        • disable_unimplemented_errors = ABAP_TRUE
    • enable_cloud_integration: Starting with SAP S/4 HANA 2022, customers are able to export sheets natively to Google Sheets. By enabling the cloud integration, the standard file chooser will be replaced by the cloud file picker. This does not only allow to store an Excel file locally, but also allows to store a sheet in the cloud. You can enable the cloud integration by setting the value to:
        • enable_cloud_integration = ABAP_TRUE

Google Workspace Integration: Google Sheets Export

Google and SAP partnered to allow customers to connect core SAP software designed for running all mission-critical processes in the cloud with the collaborative capabilities of Google Docs and Google Sheets. This innovates how work gets done across the enterprise. As part of this partnership the SAP Desktop Office Integration drop-in replacement also supports exporting sheets directly from SAP to Google Sheets. To learn more about what has been achieved as part of this partnership, please read the following blog post:

https://blogs.sap.com/2022/08/21/saps-ui-technologies-enabling-google-workspace/

Limitations

While the drop-in replacement for the SAP Desktop Office Integration will be able to support a majority of all the relevant use-cases it has the following limitations:

    • Microsoft Excel won't be opened during the data is read or written.
        • After the write operations are finished, the Excel file will be downloaded and can be opened

        • For the read operation during the import of a sheet it is no longer necessary to have Excel open as the file is read by the backend
    • With the current Desktop Office Integration, the formatted data is returned in the locale which was configured for the operating system.

        • For example, if Microsoft Office was configured for the locale us_EN, then the date was returned as 20/02/2023. In case of the in-memory office integration, the locale can be passed to the Office integration or the locale of the logged-on SAP user is being used.


    • The result of a formula will not be re-evaluated when a cell is read. Microsoft Excel stores the result of a formula as part of the cell value. During a read operation, the formula will not be re-evaluated. For most scenarios, this should be the desired behavior. However if the formula is dependent for example on the current date the result might be different. In such a case, the sheet needs to be opened and saved again before importing the sheet into SAP.
    • Not all methods from the SAP GUI for Windows Desktop Office Integration are implemented. The old office integration offered methods to modify menu items in Excel, change the format and styles, set selections and hide or show rows. Some of these functions do not make sense, if the application is not open while the office integration is running; other functionalities are not supported by the underlying frameworks and libraries.
    • Currently only the export and import use cases are supported.
        • Scenarios like updating an existing Excel sheet are not yet supported.

        • Scenarios like download and re-upload of Excel files require the implementation/adaption of the application to first do an export and then an independent import.

        • Interactive scenarios where Excel and the SAP application are open side-by-side are not supported.

Alternatives

The drop-in replacement for SAP Desktop Office Integration might not always be the right solution. Here are some alternatives:

    • If your users are only using Windows, the SAP Business Client might also be a solution, as it brings together applications like Fiori Launchpad (FLP) and SAP GUI. Also it allows to start from a web application and navigate to a SAP GUI for Windows application which supports the Desktop Office Integration:

Call for Action

Because a lot of customers have implemented the SAP Desktop Office Integration in custom programs and reports we are not aware of a lot of scenarios. Initially we've built support for the pure import and export use cases for which we have received a lot of bug reports. If your scenarios are not covered by the current implementation we would be interested to hear about them to be able to improve our solution. Please use the comment section to tell us about your requirements or get in touch to us by mail.

Availability

The drop-in replacement for the SAP Desktop Office Integration will be available with SAP S/4HANA Cloud, public edition 2302 (SAP_BASIS release 7.93 or newer), SAP S/4HANA Cloud, private edition 2023 and SAP S/4HANA 2023 (SAP_BASIS release 7.58 or newer).

We're also providing a downport of the import functionality via a correction instruction for older releases like SAP S/4HANA 2020 or newer for the SAP_BASIS releases 7.55, 7.56 and 7.57.

More information regarding the downport of the import functionality can be found in SAP Note 3386113

This down-port of the import functionality will also be delivered with the following service packs:

    • SAP_BASIS 7.55 SP08
    • SAP_BASIS 7.56 SP06
    • SAP_BASIS 7.57 SP04

TEXT_CONVERT_XLS_TO_SAP

The function module TEXT_CONVERT_XLS_TO_SAP which is using the SAP Desktop Office Integration has already adapted their code and is now also using the drop-in replacement.

The SAP Note 3443177 offers a down-port for the Excel import functionality to S4CORE 105 - S/4HANA 2020 or newer.

33 Comments
shais
Participant
Interesting.

Will the new SAP Desktop Office Integration control (cl_sovy_container_control) be supported also in background/non-dialog mode?
christian_grail
Advisor
Advisor
Hi Shai,

thanks for your intereset. And yes, the drop-in replacement will also run in background/non-dialog mode. It is working on the file and doesn't require any UI controls for the import scenario. In case of the export scenario it depends on which method you would invoke. A method like

i_oi_document_proxy~save_as( )

will invoke the method

cl_gui_frontend_services=>gui_download( )

which will only work in dialog mode. To stay fully in the background you would have to instead invoke the method

i_oi_document_proxy~save_document_to_table( )

to get the xstring representation of the created spreadsheet.

But yes, the background mode would be supported. However if you would like to develop new functionality I would propose to use the SAP XCO XLSX library instead. The XCO library also supports background/non-dialog mode.

https://help.sap.com/docs/btp/sap-business-technology-platform/xlsx

Best regards,
Christian



shais
Participant
0 Kudos
Thanks for the detailed info.

Does the XCO library handles also file download/upload and/or Google workspace integration

(And not just manipulation of the XSLX files themselves)?
christian_grail
Advisor
Advisor
0 Kudos
Hi Shai,

the XCO library works directly on binary representations of a file (XSTRING). The SOVY container is using the following methods to upload and download files:

  • for download
    cl_gui_frontend_services=>gui_download( )


  • for upload
    cl_gui_frontend_services=>gui_upload( )​



Those methods are also supported in SAP GUI for HTML and SAP GUI for Java and will therefor also work in other environments.

The Google workspace integration API is currently not released for direct customer usage.

We won't prohibit anybody from using the SOVY container for new development, but we think the cleaner and more future proof method is to use the XCO library for new code.

Best regards,
Christian
shais
Participant
OK.

Thanks again.

So if I understood correctly, the SOVY container is only a workaround/solution for replacement of c_oi_container_control_creator.

It doesn't support background/non-dialog mode and it isn't an official API for Google Workspace Integration.
christian_grail
Advisor
Advisor
Hi Shai,

the SOVY container is a solution for applications which are currently using the c_oi_container_control_creator and want to also support SAP GUI for Java/HTML. And it does support background/non-dialog mode.

It is using the Google Workspace Integration API, but the SOVY container is not the official API. The official Google Workspace Integration API is not yet released.

Best regards,
Christian
MattHarding
Active Contributor
Hi Christian,

So just to clarify, for on-premise S/4HANA customers, they won't really be able to go-live with this till FPS01 comes out for S/4HANA 2023 in about March 2024? (FPS00 is not a long term supported release but you could obviously play with this feature in November at least).

Just hoping you meant to say S/4HANA 2022 FPS01 release as that's the one my current customer is targeting.

Cheers,

Matt
christian_grail
Advisor
Advisor
Hi Matt,

unfortunately it currently is S/4HANA 2023. If you want to talk about any specific issues I'm also available for a private chat.

Best regards,
Christian
StephanHeinberg
Participant
Thanks, nice!

What needs to be installed on the client? Will Microsoft Excel on MacOS be supported?
christian_grail
Advisor
Advisor
0 Kudos
Hi Stephan,

nothing needs to be installed on the client. It works completely on the ABAP server. I've developed this functionality on a Mac and it works perfect. And on top of that we now do also support customers who have switched from Microsoft Office to Google Workspace and no longer have any office applications installed on their machines.

Best regards,
Christian
andel
Member
0 Kudos
Hi Stephan,

We are on S/4 HANA release SAP_BASIS 756 0002 SAPK-75602INSAPBASIS, and we don't have SOVY container code in our system. Do you know SAP Note ID, where this correction is included??

BR,

Fidija
artur_mikolajewicz
Discoverer
0 Kudos
Dear Christian,

Thank you for these promissing news. I have two questions:

1. Will this be available for customers with S/4 HANA on premise 2021 edition (in form of OSS note or sth.)?

2. Do you plan to develop solutions for other Office applications like MS Outlook? We have been using DOI (via win-gui) with outlook in scenario where an open (not yet saved) email can be imported and attached to a SAP document (our own GOS service) and we really miss this functionallity in web-gui environment.

Best regards,
Artur
christian_grail
Advisor
Advisor
0 Kudos
Hi Artur,

we're currently discussing possible downport options. But the downport will probably be limited to the  import only use-case. Which use-case would be interesting for you?

We currently don't have Outlook or Google Mail on our agenda at all. We're also discussing about supporting some Word scenarios, but not this is first time I've heard about Outlook scenarios. I can bring report this requirement, but currently I don't see a lot of capacity for this topic. But I'll keep it in mind.

Best regards,

Christian
christian_grail
Advisor
Advisor
0 Kudos
Hi Fidija,

sorry for the late answer. The SOVY package is not yet down-ported. Which scenario would be interesting for you? The import or the export use-case? I also think that SAP_BASIS 756 is too far away from current dev systems.

Best regards,

Christian
artur_mikolajewicz
Discoverer
Hello Christian,

The two scenarios of most of our interest would be import/export Excel files with multiple sheets and of course previosuly described Outlook scenario.

Best regards,
Artur
ashwini_sonwani
Explorer
0 Kudos
Hi Christian, we have a use case primarily for import scenario (use of t-code CNMASSCREATE). We are on SAP_BASIS 757 (SP 0002). Is there any possibility of implementing this scenario without waiting for S/4HANA 2023 release next year?
christian_grail
Advisor
Advisor
0 Kudos

Hi Sagar,

we're working on it. But I can't promise a specific release. Thank you for your feedback.

Best regards,
Christian

suryakantass
Discoverer
Hi Christian,

We have custom WebDynpro program where office control is used to display word file inside the window. This office file is working fine in Microsoft Edge browser but not in Chrome browser.  The application can open a word file, allow user to update the file and save it. This functionality is not working in Chrome browser.  There is a 3rd party addon available, but it is very costly and hence not acceptable to customer.

So please suggest us any solution for this where we should use both Edge and Chrome browser for open/update and save the document.

 

Regards,

Surya

 
christian_grail
Advisor
Advisor
Hi Surya,

we're currently working on a solution for exactly this issue. Would you be available for a short call to understand your scenario and to give you a demo of our solution?

Best regards,
Christian
suryakantass
Discoverer

Hi christian.grail,

Sure,

Lets share your email id to share the zoom link to discuss the possibility to understand the scenario.

 

Regards,

Surya

christian_grail
Advisor
Advisor
0 Kudos
Ok. Mail is out. Looking forward to meeting with you.
christian_grail
Advisor
Advisor
0 Kudos
Hi Matt,

I got some good news for you. We've been finally able to downport the import functionality via a correction instruction up to S/4HANA 2020. More details can be found in the following SAP Note

https://me.sap.com/notes/3386113

Best regards,
Christian
christian_grail
Advisor
Advisor
0 Kudos
Hi Fidija,

I got some good news for you. We've been finally able to downport the import functionality via a correction instruction up to S/4HANA 2020. More details can be found in the following SAP Note

https://me.sap.com/notes/3386113

Best regards,
Christian
christian_grail
Advisor
Advisor
0 Kudos
Hi Artur,

I got some good news for you. We've been finally able to downport the import functionality via a correction instruction up to S/4HANA 2020. More details can be found in the following SAP Note

https://me.sap.com/notes/3386113

Best regards,
Christian
christian_grail
Advisor
Advisor
Hi Sagar,

I got some good news for you. We've been finally able to downport the import functionality via a correction instruction up to S/4HANA 2020. More details can be found in the following SAP Note

https://me.sap.com/notes/3386113

Best regards,
Christian
MattHarding
Active Contributor
0 Kudos
Great news Christian - I think you will make many customers happy with this information.
andrassoos
Explorer
Hi Christian,

thanks for the blog.

 

The customer is using a program where TEXT_CONVERT_XLS_TO_SAP invoked which is using the old c_oi_container_control_creator, therefore we are not able to upload excel with SAP GUI for HTML.

 

Is it possible to get the same capabilities using the CL_GUI_FRONTEND_SERVICES method GUI_UPLOAD instead?

 

Thanks in advance,

Br,

Andras
christian_grail
Advisor
Advisor
Hi Andreas,

I've talked to the developer of the function module TEXT_CONVERT_XLS_TO_SAP and theoretically it would be possible to also do a downport of the adoption for this function module. In newer releases we've already executed the adoption, but we don't have yet done a downport. The downport is available as note up to S/4HANA 2020 (SAP_BASIS 7.55).

If you are currently on S/4HANA 2020 or newer or plan to upgrade to such a release, we could do the downport as note. In that case please create a ticket for the component FIN-FSCM-TRM-TM.

Best regards,
Christian
andrassoos
Explorer
0 Kudos

Hi Christian, thanks for checking it.


The program that is used by the customer is a custom one, so we can replace the usage of TEXT_CONVERT_XLS_TO_SAP to avoid this issue, but I wanted to know if there is any other FM that can be used with the same capabilities as TEXT_CONVERT_XLS_TO_SAP and can also be used in the SAP GUI for HTML.


 

Thank you.

Br,

Andras
christian_grail
Advisor
Advisor
Hi Andras,

for the next SAP_BASIS release we've done the adaptation in the function module TEXT_CONVERT_XLS_TO_SAP to work in SAP GUI for HTML. We could do the downport and then the customer wouldn't need to adapt or change the program which is using the function module TEXT_CONVERT_XLS_TO_SAP. With the downport of the adaption of the function module it would just work in SAP GUI for HTML.

Alternatively you could also use the SAP XCO XLSX library, but then the customer would need to change the code in their program.
https://help.sap.com/docs/btp/sap-business-technology-platform/xlsx

Best regards,
Christian
abhiperiwal
Participant
0 Kudos
Hi Christian,

 

We are currently migrating SAP CRM to S/4HANA with Customer Management Addon. We have extensively created document templates in the SAP CRM which is also used for online editing the Word documents. In S/4HANA we haven't been able to implement this solution due to the limitations of Active X and JavaBeans on the Microsoft Edge browser. Do you have a possible solution for editing and saving Word documents?

 

Thanks,

Abhishek
christian_grail
Advisor
Advisor
0 Kudos
Hi Abhishek,

unfortunately we don't have a solution for editing and saving documents. We couldn't think of a technical solution to get it working purely for web based applications. In the past the ActiveX technology from Microsoft could be used, but because of security risks this is no longer possible.

For some use cases we have created a solution for web based applications. But it's a very narrow use case. It's a solution for creating word documents based on templates. In our solution you can create a word document template, define some placeholders and then create new word documents based on place holder value lists. I don't think this what you're looking for.

As said for the edit and save use case we don't have a solution for the web, because modern browsers and operating systems don't support this functionality anymore.

Best regards,
Christian
yasu_ramaiah
Explorer
0 Kudos

Thank you Christian for this great blog! Need your help please...
We are not able to read/process (encrypted) excel files in ABAP in Web GUI. These excel files have the 'Sensitivity Label' set to Confidential. Setting the excel files to confidential are being encrypted by Microsoft/Azure Information Protect. Since the excel files are encrypted even the Drop-In Replacement is not working.

Q1. Is the Drop-In Replacement expected to decrypt the excel file? (the same encrypted excel file works via OLE2 in SAP GUI)

Q2.Are there any additional configuration steps that we are supposed to implement? Any help is appreciated.

We are on S4 HANA 2021 SP02, BASIS 7.56 and have implemented this note also - https://me.sap.com/notes/3386113

The test program TEST_SOVY_SHEET_IMPORT fails while processing the excel file.