Application Development 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: 

Concatenation Problem

Former Member
0 Kudos

Hi Experts,

I am reading internal table , with in a loop I need to put the Pipe Symbol '|' after the each field of the intenal table.

I am using concatenate '|' itab-field1

'|' itab-field2

'|' itab-field3

.

.

.

into infodata.

this infodata is variable with character C of 5000 length.

then this info data i need to transafer to a dataset.

This is giving me a error in the concatenation part.

Can any one suggest me the better way.

Thanks in Advance,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi Irfan,

Please use the following

CONCATENATE <c1> ... <cn> INTO <c> [SEPARATED BY <s>].

Regards,

Ranjit Thakur.

4 REPLIES 4

Former Member
0 Kudos

concatenate itab-field1 itab-field2 ... into infodata separated by '|'.

Reward points if helpful

Message was edited by: Sekhar

Former Member
0 Kudos

try out this code


data : begin of itab occurs 0,
f1(10),
f2(10),
f3(10),
end of itab.
data :v_f1(1000) type c,
v_f2(1000) type c,
v_f3(1000) type c.

itab-f1 = 1.
itab-f2 = 2.
itab-f3 = 3.
append itab.

itab-f1 = 2.
itab-f2 = 3.
itab-f3 = 4.
append itab.
itab-f1 = 5.
itab-f2 = 6.
itab-f3 = 7.
append itab.

break-point.
loop at itab.
condense : itab-f1, itab-f2, itab-f3.
*--this condense is to remove unnecessary blank spaces.
concatenate v_f1
itab-f1
into v_f1."(use SEPARATED BY ,)

concatenate v_f2
itab-f2
into v_f2."(use SEPARATED BY ,)
concatenate v_f3
itab-f3
into v_f3."(use SEPARATED BY ,)

endloop.


Thanks & Regards

Naresh

Former Member
0 Kudos

hi Irfan,

Please use the following

CONCATENATE <c1> ... <cn> INTO <c> [SEPARATED BY <s>].

Regards,

Ranjit Thakur.

Former Member
0 Kudos

Hai Irfan

concatenate itab-field1 itab-field2 itab-field1 into infodata separated by '|'.

Thanks & regards

Sreenivasulu P