2007 Nov 22 12:01 PM
hi all,
i have internal table itab with single field dptype.the table has 3 records--
ITAB
DPTYPE A
DPTYPE B
DPTYPE C.
i have a field TEXT.
my requirement is i want all records of itab into single field TEXT,as follows
TEXT = A,B,C
what should i use-- concatenate ?
plz help me.
Thanks,
Shivaa.
2007 Nov 22 12:05 PM
<b>data: var(50) type c,
cnt type i,
lv_lines type i.
describe table itab lines lv_lines.
loop at itab into wa.
cnt = cnt + 1.
if sy-index = 1.
move wa-f2 to var.
else.
concatenate wa-f2 var into wa-f2 seperated by ','.
delete itab from wa.
Modify itab from wa.
clear wa.
endif.
if cnt = lv_lines.
exit.
endif.
endloop.</b>
Reward Points if this helps,
Satish
Message was edited by:
Satish Panakala
hi all,
i have internal table itab with single field dptype.the table has 3 records--
ITAB
DPTYPE A
DPTYPE B
DPTYPE C.
i have a field TEXT.
my requirement is i want all records of itab into single field TEXT,as follows
TEXT = A,B,C
what should i use-- concatenate ?
plz help me.
Thanks,
Shivaa.
2007 Nov 22 12:04 PM
2007 Nov 22 12:05 PM
<b>data: var(50) type c,
cnt type i,
lv_lines type i.
describe table itab lines lv_lines.
loop at itab into wa.
cnt = cnt + 1.
if sy-index = 1.
move wa-f2 to var.
else.
concatenate wa-f2 var into wa-f2 seperated by ','.
delete itab from wa.
Modify itab from wa.
clear wa.
endif.
if cnt = lv_lines.
exit.
endif.
endloop.</b>
Reward Points if this helps,
Satish
Message was edited by:
Satish Panakala
2007 Nov 22 12:06 PM
Hi,
fld1 = 'aa'.
fld1 = 'bb'.
fld1 = 'cc'.
concatenate fld1 fld2 fld3 into text.
Regards,
Vani.
2007 Nov 22 12:06 PM
clear text.
loop at itab.
concatenate itab-fld2 ',' text into text.
endloop.
this way you'l get all the values of field2 into text...
2007 Nov 22 12:16 PM
Hi,
data: text type string,
text1 type string.
data from itab.
loop at itab into wa.
text1 = wa-a.
concatenate text1 text into text.
endloop.
write: text.
Reward points if useful.
Regards,
Vimal
2007 Nov 22 12:17 PM
2007 Nov 22 12:18 PM
satish, the first reply from u was sufficent for me.
any way thanx fir the edited message
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |