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 Problem

Former Member
0 Likes
610

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
Read only

Former Member
0 Likes
571

hi Irfan,

Please use the following

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

Regards,

Ranjit Thakur.

4 REPLIES 4
Read only

Former Member
0 Likes
571

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

Reward points if helpful

Message was edited by: Sekhar

Read only

Former Member
0 Likes
571

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

Read only

Former Member
0 Likes
572

hi Irfan,

Please use the following

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

Regards,

Ranjit Thakur.

Read only

Former Member
0 Likes
571

Hai Irfan

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

Thanks & regards

Sreenivasulu P