2023 Jun 19 8:38 AM
Hi Friends,
I am creating a dynamic internal table based on the condition table and downloading the internal table as Excel.
Fill in the data and upload the Excel. Now how to split the data and put it in the dynamic internal table.
The below image is uploaded excel data
I want to split the data and pass it to a dynamic internal table. Kindly find the below screen shot.
Thanks with regards,
Vallamuthu M.
2023 Jun 19 8:55 AM
If you don't give an example, you will receive either lots of miscellaneous answers which don't match your question, or no answer at all...
2023 Jun 19 9:25 AM
you already create the dynamic itab, so just use the split ... at ... syntax. what are you confused with?
2023 Jun 19 9:37 AM
Hi Siswanto Tan.
I am using the below syntax
SPLIT lwa_data AT cl_abap_char_utilities=>horizontal_tab INTO TABLE <fs_dyn_table>.
but it gives data like this.
Thanks with Regards,
Vallamuthu M
2023 Jun 19 10:25 AM
based on your data, I don't think you could split the result into the itab directly, you should split the data into the workarea.
Not sure if there is a more straightforward way to do so, but I could propose another option.
another way to do:
1. keep track of the fields in dynamic itab ( such as field 1: VKORG, field 2: VTWEG, etc ) ,preferably store the field name in a string itab ( named it_field_name ).
2. split the lwa_data into another string itab ( named it_temp_value ).
3. loop at it_temp_value, read it_field_name based on the sy-tabix of current loop ( if you don't store the field name, then hardcode the field name based on the sy-tabix position ), ASSIGN it_temp_value INTO <fs_field> ( refer to workarea name with the same structure ), and you can fill in <fs_field> value with it_temp_value. Finally, you can append work area or field symbol with same dynamic structure into <fs_dyn_table>.
2023 Jun 19 10:40 AM
To be short: use an intermediate internal table to contain only the field values, don't store directly in <fs_dyn_table>.
NB: if you search the forum concerning "dynamic internal tables", you will find ASSIGN COMPONENT everywhere. Do you understand how it works?
2023 Jun 19 12:26 PM
You know that in this context # means undisplayable character (and possibly #). So while it will work for your string, it won't if the string is, e.g. a horizontal tab as in the original post.
2023 Jun 19 12:52 PM
The OP has mentioned:
SPLIT lwa_data AT cl_abap_char_utilities=>horizontal_tab ...
2023 Jun 20 9:04 AM
Please check the function (sm37) GUI_UPLOAD with the parameter HAS_FIELD_SEPARATOR
Kind regards
Thorsten