Application Development and Automation 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: 
Read only

Dynamic Columns using OLE

Former Member
0 Likes
608

Hi All,

We have a requirement to create an excel with dynamic data. We have designed the filling of a field symbol with dynamic values. But we are not able to display the same and a runtime error is appearing at I_OI_SPREADSHEET->INSERT_ONE_TABLE.

Here is our code:

  CALL METHOD oref_spreadsheet->insert_one_table
    EXPORTING
      data_table = <gt_data>

     rangename  = 'TAB1'
      no_flush   = ' '
      wholetable = 'X'
    IMPORTING
      error      = oref_error.

Here I am not exporting DDIC_NAME as the structure is dynamic.

Can somebody please help me out?

Thanks a lot in advance!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
510

Hi All,

I found that we can export FIELDS_TABLE with the fields present in the data structure to achieve this. But, when I used DP_GET_FIELDS_FROM_TABLE, I am not getting fieldnames but getting numbers as 1, 2, 3.....

  CALL FUNCTION 'DP_GET_FIELDS_FROM_TABLE'
    TABLES
      data                   = <gt_data>
      fields                 = gt_fields
   EXCEPTIONS

     DP_INVALID_TABLE       = 1
     OTHERS                 = 2.

However, when I export gt_fields to INSERT_ONE_TABLE, data is being displayed only for a few and a few are blanks.

Can somebody help me out?

2 REPLIES 2
Read only

Former Member
0 Likes
511

Hi All,

I found that we can export FIELDS_TABLE with the fields present in the data structure to achieve this. But, when I used DP_GET_FIELDS_FROM_TABLE, I am not getting fieldnames but getting numbers as 1, 2, 3.....

  CALL FUNCTION 'DP_GET_FIELDS_FROM_TABLE'
    TABLES
      data                   = <gt_data>
      fields                 = gt_fields
   EXCEPTIONS

     DP_INVALID_TABLE       = 1
     OTHERS                 = 2.

However, when I export gt_fields to INSERT_ONE_TABLE, data is being displayed only for a few and a few are blanks.

Can somebody help me out?

Read only

0 Likes
510

Problem was somewhere else in the program. Not related to OLE.