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

CONCATENATE

Former Member
0 Likes
1,572

Hi all

here i have a funnny doubt. Is it possible to CONCATENATE values in column wise instead of row wise

example:i want to CONCATENATE 120, 121,122 like this

120

121

122

Hi all

here i have a funnny doubt. Is it possible to CONCATENATE values in column wise instead of row wise

example:i want to CONCATENATE 120, 121,122 like this

120

121

122

12 REPLIES 12
Read only

Former Member
0 Likes
1,556

Why don't you append this to an internal table instead of concatenating?

Read only

0 Likes
1,555

Hi

here my problem is i want to print payment order numbers in the last page in a script.last page do not contain Main window.if we pass all the values into an internal table we can't loop them as the last page do not contain any main window it will only once after completion of all windows and only last payment order is printing.if it is possibli to CONCATENATE in column wise that works for my case.

Read only

0 Likes
1,555

then use the code i posted earlier..

regards,

srikanth

Read only

0 Likes
1,555

Hi sreenivasa,

1. Last page can contain main window.

Then u can ofcourse loop and show.

regards,

amit m.

Read only

0 Likes
1,555

hey,

is your problem solved ?? or still have it ??

let us know..

regards

srikanth

Read only

0 Likes
1,555

Why don't you insert the MAIN to the last page?

You can write a code to manage to write the payment order numbers only at the end. Before writing them you can force a skip to next page, so you always make sure to print it in the last page.

Max

Read only

Former Member
0 Likes
1,555

Define an internal table and append them.....

Regards,

Srikanth

Read only

suresh_datti
Active Contributor
0 Likes
1,555

Hi,

No it is not possible.. CONCATENATE is only at FIELD level for CHAR type fields and not records.. It might be possible to get what you want using other techniques..

Regards,

Suresh Datti

Read only

Former Member
0 Likes
1,555

Hi

?????

Do you mean you want to append these values to internal table?

If it so you can try to use SPLIT command:

DATA: STRING(20) VALUE '120 121 122'.

DATA ITAB(3) OCCURS 0 WITH HEADER LINE.

SPLIT STRINGH AT SPACE INTO TABLE ITAB.

Max

Read only

Former Member
0 Likes
1,555

Hi Sreenivasa,

As we are storing the result of Concatenation in a field which is of String type and string always have only row there exist no column so if you wanna display your result column wise then the idea of using internal table is the best.

reward point if useful.

Regards,

Siddarth

Read only

Former Member
0 Likes
1,555

assume you have 3 fields in the internal table

data :v_f1(1000) type c,

v_f2(1000) type c,

v_f3(1000) type c.

loop at itab.

concatenate v_f1

itab-f1

into v_f1."(use SEPARATED BY ,if you want)

concatenate v_f2

itab-f2

into v_f2."(use SEPARATED BY ,if you want)

concatenate v_f3

itab-f3

into v_f3."(use SEPARATED BY ,if you want)

endloop.

NOW V_F1,V_F2,V_F3 will have 1st 2nd 3rd columns concatentaed values.

regards

srikanth

Read only

Former Member
0 Likes
1,555

hey,

here is the full code to work out.

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 ,if you want)

concatenate v_f2

itab-f2

into v_f2."(use SEPARATED BY ,if you want)

concatenate v_f3

itab-f3

into v_f3."(use SEPARATED BY ,if you want)

endloop.

<b>output :</b>

v_f1 125

v_f2 236

v_f3 347

printed output of the program

Message was edited by: Srikanth Kidambi Maruthi