2015 Nov 25 10:13 AM
Hello friends,
i wanted to concatenate fields on loop, here is my condition.
count1= 0.
count2 = 0.
loop at a into wa_a.
count1 = sy-tabix.
concatenate c d into e.
if count2 is lt count1.
(here i want something like this)
f = f and e.
endif.
endloop.
lets say loop executed two times.
first time e = 'sap'
second time e = 'abap'.
finally f should be sap abap.
How to chase?? thanks in adv.
Regards.
2015 Nov 25 10:23 AM
Hi Praneeth,
Something like this?
DATA: LV_F TYPE STRING.
LOOP AT lt_a REFERENCE INTO DATA(LR_A).
LV_F = LV_F && LR_A->C && LR_A->D.
ENDLOOP.
I assume you wanted to do something with field in table A. Took those into the concatenate. Now output is without spaces. So you should add them add correct place if needed.
I'm not sure what you want to achieve with count1 and count2 so left that part out.
Cheers,
Henk
2015 Nov 25 2:30 PM
Praneeth,
Inside the loop you can just write
concatenate f e into f separated by space. define f as string type.
Hope I answered you question .
Need much information on the count1 and count2 conditions .
Thanks,
G