2007 Nov 07 10:08 AM
Let's have a simple example:
DATA: string1(30) TYPE c VALUE 'I am Alex and i am',
string2(30) TYPE c VALUE '23 years old',
string_concatenation(60) TYPE c.
CONCATENATE string1 string2 INTO string_concatenation SEPARATED by SPACE
.
WRITE: / string_concatenation.
The result will be:
<b>I am Alex and i am 23 years old</b>
where string1 is your first string, string2 the second string and the addition SEPARATED by SPACE.
If you enter the debug mode (and i advice you to do this) you can watch the sy-subrc and its return code.
The return code is set as follows:
SY-SUBRC = 0:
The result fitted into <b>string_concatenation.</b>
SY-SUBRC = 4:
The result was too long for <b>string_concatenation</b> and could only be transferred in the defined length of g.
You can try to giving the <b>string_concatenation</b> the value 22 and watch the sy-subrc.
Reward is useful,
Thanks.<u></u>
2007 Nov 07 10:13 AM
Hi,
check this out
REPORT ZSUDHA_SCREEN MESSAGE-ID ZZ.
data : v_s type string value 'SAP',
v_s1 type string value 'ABAP',
v_s2 type string.
concatenate v_s v_s1 into v_s2.
write:/ v_s2.
2007 Nov 07 10:14 AM
CONCATENATE var1 var2 ... INTO v_result
[IN { BYTE | CHARACTER } MODE]
[SEPARATED BY sep].
It concatenates given variables into result ..
DATA: t1(10) TYPE c VALUE 'We',
t2(10) TYPE c VALUE 'have',
t3(10) TYPE c VALUE 'all',
t4(10) TYPE c VALUE 'the',
t5(10) TYPE c VALUE 'time',
t6(10) TYPE c VALUE 'in',
t7(10) TYPE c VALUE 'the',
t8(10) TYPE c VALUE 'world',
result TYPE string.
CONCATENATE t1 t2 t3 t4 t5 t6 t7 t8
INTO result SEPARATED BY space.
now result has ... "We have all the time in the world"
2007 Nov 07 10:15 AM
concatenate 'Welcome' 'to' 'SDN ' into a separated by space.
write 😕 a.
Thanks
Ravi
2007 Nov 07 10:15 AM
data: v_1 type c length 10 value 'PRAS'.
data: v_2 type c length 10 value 'HANT'.
data: v_3 type c length 20.
concatenate v_1 v_2 into v_3.
so v_3 will have PRASHANT.
Hope dis helps..
Reward if it does
2007 Nov 07 10:16 AM
Hi,
Suppose i have ABAP in one variable v1 and SAP in second variable v2.
we will transfer this into another variable by using Concatenate as:
CONCATENATE v2 v1 into v3 separated by space.
We will get the output as SAP ABAP.
Regards
Kannaiah
2007 Nov 07 10:17 AM
Hi,
Examples
DATA: ONE(10) VALUE 'John',
TWO(3) VALUE 'F.',
THREE(10) VALUE 'Kennedy',
NAME(20).
CONCATENATE ONE TWO THREE INTO NAME SEPARATED BY SPACE.
reward if useful.
2007 Nov 07 10:25 AM
Hi,
DATA: ONE(10) VALUE ' John ',
TWO(3) VALUE 'F.',
THREE(10) VALUE ' Kennedy',
NAME(20).
CONCATENATE ONE TWO THREE INTO NAME SEPARATED BY SPACE.
Try this,
KC
2007 Nov 07 10:29 AM
Let's have a simple example:
DATA: string1(30) TYPE c VALUE 'I am Alex and i am',
string2(30) TYPE c VALUE '23 years old',
string_concatenation(60) TYPE c.
CONCATENATE string1 string2 INTO string_concatenation SEPARATED by SPACE
.
WRITE: / string_concatenation.
The result will be:
<b>I am Alex and i am 23 years old</b>
where string1 is your first string, string2 the second string and the addition SEPARATED by SPACE.
If you enter the debug mode (and i advice you to do this) you can watch the sy-subrc and its return code.
The return code is set as follows:
SY-SUBRC = 0:
The result fitted into <b>string_concatenation.</b>
SY-SUBRC = 4:
The result was too long for <b>string_concatenation</b> and could only be transferred in the defined length of g.
You can try to giving the <b>string_concatenation</b> the value 22 and watch the sy-subrc.
Reward is useful,
Thanks.<u></u>
2007 Nov 07 10:37 AM
Hi,
Chk this code.
DATA : A(10) VALUE 'APPLE',
B(10) VALUE 'ORANGE',
C(10) VALUE 'BANANA',
D(40).
CONCATENATE A B C INTO D.
WRITE:/' Before Concatenate', /.
WRITE:/ D,/.
CONCATENATE A B C INTO D SEPARATED BY ' / '.
WRITE:/' After Concatenate',/.
WRITE:/ D.
Reward for helpful.
Regards,
Harini.S
2007 Nov 07 11:36 AM
hi guys
thank u so much u guys have given a very clear picture
all the best
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |