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: 

How to assign deep structure coulmn data to internal table

gupta_123
Explorer
0 Kudos

Dear experts,

How to assign deep structure coulmn name of <ls_row>-sales in internal table of sales standard table

5 REPLIES 5

subhajit
Active Participant
0 Kudos

Hello Vivek,

Did you mean to assign 'sales' internal table in <ls_row> into another standard internal table containing sales data ?

If yes then you can do that using the following:

Thanks,

Subhajit

sales_table[] = <ls_row>-sales[].
OR
sales_table = CORRESPONDING #( <ls_row>-sales ) in case of different structure types with common fields.

0 Kudos

Dear subhajit thanks for your valuble response,

but its gives me error because it is runtime structure <ls_row>-sales[]. you cant define directly

Sandra_Rossi
Active Contributor

You need to check the exact type of SALES (we can't do it for you), and use the same type in your program.

If it's generic, use a field symbol with a generic table type, all ABAP statements support generic syntax for indicating the column names at runtime.

raymond_giuseppi
Active Contributor
0 Kudos

Try a simple

ASSIGN COMPONENT sales OF STRUCTURE <ls_row> TO <itab>.
" then use <itab> as any internal table
LOOP AT <itab> ASSIGNING <record>.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <record> TO <field>.

You can define the field symbols with their actual type or continue with some generic type ANY/ANY TABLE

0 Kudos

Thanks raymond.giuseppi for your valuble response. its done by using above code.