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

Fill data

Former Member
0 Likes
330

Hi Friends,

I want a logic if i populate value to 3 fields of a item table out of 5 fiels, i should pass X value to the corresponding fields of Xtable which is of same type of item table. same way i have to do for more than 10 table. if any one have implemented same before please help me.

Thanks

1 REPLY 1
Read only

Former Member
0 Likes
300

Hi

data: counter type i.
data: f1,f2,f3,f4,f5.

loop at it into wa.

clear: counter,f1,f2,f3,f4,f5.

if wa-f1 is not initial.
counter = counter + 1.
f1 = 'X'.
endif.

if wa-f1 is not initial.
counter = counter + 1.
f2 = 'X'.
endif.

if wa-f1 is not initial.
counter = counter + 1.
f3 = 'X'.
endif.

if wa-f1 is not initial.
counter = counter + 1.
f4 = 'X'.
endif.

if wa-f1 is not initial.
counter = counter + 1.
f5 = 'X'.
endif.

if counter ge 3.
clear xtable.  "no workarea for this table.
xtable-f1 = f1.
xtable-f2 = f2.
xtable-f3 = f3.
xtable-f4 = f4.
xtable-f5 = f5.
append xtable. 
endif.
endloop.

i am sure with the above logic you can do for 10 fields or any number of fields.

Regards

Sajid

Edited by: shaik sajid on Jul 16, 2009 1:02 PM