Application Development and Automation 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: 
Read only

Read a dyanamic tabale.

Former Member
0 Likes
513

Friends,

ASSIGN (lv_struc) TO <fs>.

LOOP AT <fs> ASSIGNING <wa> .

ENDLOOP.

Inside the loop, i want to read a field of WA. that field name i have in a Variable. I want to check if that field is initial or not.

any idea.

Shastri.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
492

hi,

you can use the statement

data variable type char 20.
field-symbols: <w_comp1> type any.

LOOP AT <fs> ASSIGNING <wa> .
  ASSIGN COMPONENT (variable) of structure <wa> TO <w_comp1>.
ENDLOOP.

hope this helps you....

Tanks,

Sid

Friends,

ASSIGN (lv_struc) TO <fs>.

LOOP AT <fs> ASSIGNING <wa> .

ENDLOOP.

Inside the loop, i want to read a field of WA. that field name i have in a Variable. I want to check if that field is initial or not.

any idea.

Shastri.

2 REPLIES 2
Read only

Former Member
0 Likes
492

hello ,

try this ......

data: ls_stru type ref to cl_abap_structdescr,

lt_comp type standard table of abap_componentdescr,

ls_stru ?= cl_abap_typedescr=>describe_by_data( <wa>).

lt_comp = ls_stru->get_components( ).

it_comp will have fieldname and values.

regards

Prabhu

Read only

Former Member
0 Likes
493

hi,

you can use the statement

data variable type char 20.
field-symbols: <w_comp1> type any.

LOOP AT <fs> ASSIGNING <wa> .
  ASSIGN COMPONENT (variable) of structure <wa> TO <w_comp1>.
ENDLOOP.

hope this helps you....

Tanks,

Sid