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

Chk values from a Dynamic Internal Table ?

Former Member
0 Likes
347

Hello All,

I've a dynamic internal table .

It'll have the values in this way :



F1  F2  DYN1 DYN2 DYN3 FN
--------------------------

A    a   X      X    X  1
B    c   -      X    X  6
C    b   X      -    X  3

  • In the above table DYN1,DYN2,DYN3 are the dynamic fields.

  • The field values of those will be either blank or 'X '.

  • Now I need to count the no. of X's for all the respective Dynamic Fields.

i.e I need a table like this :


DYN1 2 " 2 bcoz the column DYN1 has 2 X's from the above table 
DYN2 2 
DYN3 3

Hope I'm clear in explaining my scenario !

Can anyone tell me how to achieve the above functionality ?

Regards,

Deepu.K

.

1 REPLY 1
Read only

Former Member
0 Likes
310

Hi deepu,

Try this

1 . use GET_COMPONENT_LIST before the dynamic internal table created, it will give all the fieldname into one itab , say itab_before

2 . use the same FM after dynamic table created, it will give all the fieldnames including dynamic fieldnames into one itab , say itab_after

3. now

loop at itab_before.

read table itab_after with key COMPNAME eq itab_before-COMPNAME.

if sy-subrc eq 0.

delete itab_after.

endif.

endloop.

now ur itab_after will consists only the dynamic fields

this is just an idea , try from here if it can help you