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

concatenation

Former Member
0 Likes
984

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
948

<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.

7 REPLIES 7
Read only

Former Member
0 Likes
948

hi,

send ur query little bit clear,or send the coding

thanks

Read only

Former Member
0 Likes
949

<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

Read only

Former Member
0 Likes
948

Hi,

fld1 = 'aa'.

fld1 = 'bb'.

fld1 = 'cc'.

concatenate fld1 fld2 fld3 into text.

Regards,

Vani.

Read only

Former Member
0 Likes
948

clear text.

loop at itab.

concatenate itab-fld2 ',' text into text.

endloop.

this way you'l get all the values of field2 into text...

Read only

Former Member
0 Likes
948

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

Read only

Former Member
0 Likes
948

thanx a lot satish its working

Read only

Former Member
0 Likes
948

satish, the first reply from u was sufficent for me.

any way thanx fir the edited message