2022 Apr 19 4:17 PM
Hello everyone,
I have a deep structure and using a Method , the data is getting populated inside the structure. Now i want to move this data from the deep structure into table. Could you please help me to solve this?
Example of deep structure:(nesting)
declare with table type—-> component with type structure—->component with type structure—->component with type table
thank you!
2022 Apr 19 5:41 PM
Hi,
Sorry but i dont understand your requirement.
Which component do you need to move to a new table? The deep structure?
2022 Apr 19 6:11 PM
2022 Apr 19 7:04 PM
Hi again,
Try this.
- Create an internal table with the same type that the last table.
- Append the records in that temporal table.
- When you are ready to pass the last table to the structure do this:
DATA: ti_last_table_tmp TYPE tp_last_table,. " Same type that the last table
st_last_table LIKE LINE OF ti_last_table_tmp.
st_last_table-field1 = 'A'.
.
.
.
APPEND st_last_table TO ti_last_table_tmp.
APPEND LINES OF ti_last_table_tmp TO st_structure1-st_structure2-ti_last_table.
Hope it helps.
Regards.
Esteban
2022 Apr 19 7:41 PM
Thanks!
This from table to structure, i want exact opposite procedure: from deep structure to table
2022 Apr 19 7:51 PM
Hi again,
You have to create an internal table with type table of the first structure. When you are ready to pass the structure data to the deep internal table, you have to append the structure to that internal table.
APPEND st_structure1 TO ti_deep_table.
2022 Apr 19 8:11 PM
It seems very easy, but I don't get what your issue is. If you post your code, it will be easier to answer.
2024 Aug 25 2:45 PM
I want to move contents from <fs_it> table any to internal table LT-einarecord. how to do that
2024 Aug 26 1:05 PM
Try this:
TYPES ty_table TYPE REF TO data.
DATA lt_einarecord TYPE TABLE OF ty_table.
FIELD-SYMBOLS <fs_it> TYPE ANY TABLE.
APPEND INITIAL LINE TO lt_einarecord ASSIGNING FIELD-SYMBOL(<fs_table>).
GET REFERENCE OF <fs_it> INTO <fs_table>.