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

Concatenating into string

Former Member
0 Likes
520

Hi experts,

I am looking into a simple concatenating logic.

User enters more than one option in selection box.

I want to display as

Sel1,Sel2,Sel3

I try way as given below but every time workspace variable bus_areas get clear and i retain only last value followed by a comma.

Data :bus_areas(60) type C.

loop at s_gsber.

concatenate s_gsber-LOW ',' into bus_areas.

endloop.

How can i achieve SEL1,SEL2,SEL3

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
499

Hi,

Data :bus_areas(60) type C.

loop at s_gsber.

concatenate bus_areas s_gsber-LOW into bus_areas seperated by ',' .

endloop.

Can u please be more clear while asking questions.

Regards,

Jagadish

4 REPLIES 4
Read only

Former Member
0 Likes
500

Hi,

Data :bus_areas(60) type C.

loop at s_gsber.

concatenate bus_areas s_gsber-LOW into bus_areas seperated by ',' .

endloop.

Can u please be more clear while asking questions.

Regards,

Jagadish

Read only

Former Member
0 Likes
499

Hi,

You yourself have answered the question.

From second iteration onward you should have

concatenate bus_area s_gsber-LOW into bus_areas seperated by ','.

I hope this helps,

Regards

Raju Chitale

Read only

0 Likes
499

Hi,

yes, you have to give like this

concatenate bus_areas s_gsber-LOW into bus_areas seperated by ','

for continious concatenating inside the loop.

Thanks

Murugan.

Read only

0 Likes
499

Hi Aditya ,

Try this :

Data :bus_areas(60) type C.

loop at s_gsber.

if sy-index EQ 1.

concatenate s_gsber-LOW ',' into bus_areas.

else.

concatenate s_gsber-LOW bus_areas into bus_areas separated by ','.

endloop.