‎2008 Feb 04 4:31 PM
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
.
‎2008 Feb 04 5:11 PM
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