2013 Jan 04 6:43 AM
hi all,
i want to split a string into an internal table.
let suppose i have a string 1,2,3,4 i want 1 2 3 4 to be the column of itable .and string is not specified.
plz help.
thanks.
Moderator message: frequent topic, please search for previous discussions before posting.
Message was edited by: Thomas Zloch
hi all,
i want to split a string into an internal table.
let suppose i have a string 1,2,3,4 i want 1 2 3 4 to be the column of itable .and string is not specified.
plz help.
thanks.
Moderator message: frequent topic, please search for previous discussions before posting.
Message was edited by: Thomas Zloch
2013 Jan 04 7:20 AM
If you question regarding spliting data into ITAB.
Split String itself have an Addition Into Table. Please read F1 help on SPLIT.
SPLIT f AT g INTO TABLE itab
When I understand your question in another way.
If you want to split the string 1,2,3,4 as the Columns of the Internal Table like ITAB with four Columns. the you need to use it with Dynamic tables.
For simple thing we shouldnt make it complicate. In both the case SPLIT into Table ITAB is used and later you have columns in ITAB and you can make use of it.
hope this helps
2013 Jan 04 7:22 AM
Hi Aashima,
Use: SPLIT f AT g INTO TABLE itab.
Please check the code below:
DATA:lv_string TYPE string.
DATA :BEGIN OF ls_string,
col1 TYPE char50,
END OF ls_string.
DATA:lt_string LIKE STANDARD TABLE OF ls_string.
lv_string = '1,2,3,4'.
SPLIT lv_string AT ',' INTO TABLE lt_string.
LOOP AT lt_string INTO ls_string.
WRITE:/ ls_string-col1.
ENDLOOP.
With regards,
2013 Jan 04 7:24 AM
2013 Jan 04 10:20 AM
hi raymond,
the string is converted into rows of internal table, now i want those rows to be the header of the internal table.
thanks
2013 Jan 04 10:29 AM
Just create a dynamic internal table using either, use search tool or click on below links
- cl_alv_table_create=>create_dynamic_table from a field catalog
Regards,
Raymond
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |