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: 

Passing a value to a deep structure

Former Member
0 Kudos
3,436

hi ,

I have a Method in a class , in which there is a parameter, which refers to a deep strucure .

The Structure is as follows :

CONFIG_TABLES - zsample1 - zsample2 - zsample3 - Fields on the structure .

Zsample3 is a structure which has the required fields

Plz help how to pass a data to this deep structure.

Regards

vel

1 ACCEPTED SOLUTION

Former Member
0 Kudos
895

hi ,

Create a work area WA_CONFIG line type of CONFIG_TABLES and read table in work area.

then move zsample3 to CONFIG_TABLES - zsample1 - zsample2 - zsample3.

if you can tel structure name

Thanks

Sarbpreet.

3 REPLIES 3

Former Member
0 Kudos
896

hi ,

Create a work area WA_CONFIG line type of CONFIG_TABLES and read table in work area.

then move zsample3 to CONFIG_TABLES - zsample1 - zsample2 - zsample3.

if you can tel structure name

Thanks

Sarbpreet.

Former Member
0 Kudos
895

Hi Vel,

LOOP AT CONFIG_TABLES WHERE <STURCTURE NAME> = 'ZSAMPLE1'. (This is your main loop )

LOOP AT CONFIG_TABLES-ZSAMPLE1 WHERE <STRUCTURE NAME> = 'ZSAMPLE2'. (This is the first inner loop )

LOOP AT CONFIG_TABLES-ZSAMPLE1-ZSAPMLE2 WHERE <STRUCTURE NAME> = 'ZSAMPLE3'. ( This is the final inner loop )

  • Here you append the details you want.

ENDLOOP.

ENDLOOP.

ENDLOOP.

Hope this may help you.

Regards,

Smart Varghese

Former Member
0 Kudos
895

Assign a field symbol (<fs_config>) of TYPE ANY to your first table and access the nested structure using the statement

Assign component 'CONFIG_STR-zsample1-zsample2-zsample3-field1' of structure <fs_config> to <fs1>.

<fs1> = 'Text'.

The value gets update automatically as we are filling using the field symbols.