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

loop statement for selecting z objects.

Former Member
0 Likes
352

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.

2 REPLIES 2
Read only

alex_campbell
Contributor
0 Likes
326

What is your question?

Read only

Former Member
0 Likes
326

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