‎2006 Nov 24 4:07 PM
Hi,
Below is my final internal table iam getting the data here.
data : begin of itab occurs 0,
field1(10) type c,
field2(10) type c,
field3(10) type c,
field4(10) type c,
end of itab.
data : v_wa(500) type c. "work area
field1 has value 100
field2 has value 200
field3 has value 300
field4 has value 400
My final output should look like this.
100#200#300#400.
please suggest.
Thanks
Vikranth Khimavath
‎2006 Nov 24 4:08 PM
Loop at itab.
<b>concatenate itab-field1 itab-field2 itab-field3 itab-field4 into v_wa separated by '#'.</b>
write v_wa.
Endloop.
Message was edited by:
Dominic Pappaly
‎2006 Nov 24 4:08 PM
Loop at itab.
<b>concatenate itab-field1 itab-field2 itab-field3 itab-field4 into v_wa separated by '#'.</b>
write v_wa.
Endloop.
Message was edited by:
Dominic Pappaly
‎2006 Nov 24 4:10 PM
Hi Dominic,
my ouput should look like this
100#200#300#400
no this way
100 200 300 400
Thanks
Vikranth khimavath
‎2006 Nov 24 4:12 PM
Yes that is why we have the 'separated by' extension of the statement.
This will concatenate the field values into v_wa and put'#' in between.
Please check out .
‎2006 Nov 24 4:21 PM
‎2006 Nov 24 4:13 PM
Hi,
Try this..
Loop at itab.
<b>concatenate itab-field1'#' itab-field2 '#'itab-field3 '#'itab-field4 into v_wa separated by space.</b>
write v_wa.
Endloop.
reward if useful..
Regards,
Ajith
‎2006 Nov 24 4:14 PM
Hi
Use the floowing :
DATA: lw_itab LIKE LINE OF itab.
DATA: l_data(100) type c .
Loop at itab into LW_ITAB.
concatenate LW_ITAB-field1 LW_ITAB-field2 LW_ITAB-field3 LW_ITAB-field4
into l_data separated by '#'.
Endloop.
If sounds good pl reward.
Cheers.
‎2006 Nov 24 4:22 PM
just execute the code
data : begin of itab occurs 0,
field1(10) type c,
field2(10) type c,
field3(10) type c,
field4(10) type c,
end of itab.
data: str(50) type c.
data mrk type c value '#'.
itab-field1 = 100.
itab-field2 = 200.
itab-field3 = 300.
itab-field4 = 400.
condense :itab-field1,
itab-field2,
itab-field3,
itab-field4.
concatenate itab-field1
itab-field2
itab-field3
itab-field4
into str
separated by mrk.
condense str.
write:/ str .regards,
vijay
‎2006 Nov 24 4:23 PM
Each of the fileds in your final table is 10 bytes long, but your values are only 3. So what happens to the spaces? Do you want the results left or right justified? Or do you want the spaces removed?
Rob