Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

changing existing excel-file using SAP DOI

103343
Active Participant
0 Kudos

I try to change data in an existing excel-sheet using SAP desktop office integration.

When changing several cells with method SET_RANGES_DATA of interface I_OI_SPREADSHEET all given cells do not get new values but get empty even if they had values before.

Since i didn't want to give every cell a range-name I used parameter RANGESDEF instead of RANGES as described in documentation:


      CLEAR empty[]. 
      CALL METHOD spreadsheet->set_ranges_data 
        EXPORTING 
          ranges    = empty[] 
          no_flush  = '' 
          updating  = 1 
          contents  = data_table[] 
          rangesdef = ranges[] 
        IMPORTING 
          error     = error 
          retcode   = ret_string.

Does anybody have any idea why the values in data_table are not filled in? I looked with debugger in the tables data_table and ranges an they looked good. Retcode sais "OK" after execution.

regards

Herbert

2 REPLIES 2

Former Member
0 Kudos

Hi,

I have a other solution for you.

Why don't you use the OLE object?

0 Kudos

Hi Marc,

I consider OLE as a fallback if I do not get DOI to work.

But i would prefer to get DOI working because it is (at least theoretically) able to work with several office applications, not only with MS excel.