2012 Oct 18 4:36 PM
I am selecting dataelements , domains from the function module DDIF_FIELDINFO_GET by giving structure name.
my aim is to select only z or y dataelemts and z or y domains and separate them in internal tables for further processing. I wrote below loop statements can any one correct me or any other effecient way of writing
gt_dfies has all information about the given structure which is retrieved from function module DDIF_FIELDINFO_GET.
for collecting domains.
loop at gt_dfies into wa_dfies where DOMNAME(1) = 'Z' or DOMNAME(1) = 'Y'.
wa_domtab-domname = wa_dfies-domname.
append wa_domtab to it_domtab.
endloop.
for collecting dataelemtns.
loop at gt_dfies into wa_dfies where rollname(1) = 'Z' or rolname(1) = 'Y'.
wa_dataelem-rollname = wa_dfies-rollname.
append wa_dataelem to it_dataelem.
endloop.
2012 Oct 18 6:05 PM
2012 Oct 18 6:17 PM
hello,
if you really don't care of the remaining domains or data elements you could try this -
loop at gt_dfies into wa_dfies.
if wa_dfies-rollname(1) ne 'Z' or wa_dfies-rolname(1) ne 'Y' or wa_dfies-DOMNAME(1) <> 'Z' or wa_dfies-DOMNAME(1) <> 'Y'
delete gt_dfies index sy-tabix.
endloop.
best regards,
swanand