‎2007 Dec 29 7:06 PM
Hi,
I want concatenate two string but target field is one of them.
The sentence:
CONCATENATE A B INTO A
doesn't works because of the length of field A.
How to do that?
Thanks,
‎2007 Dec 29 7:55 PM
Declare A length as addition of A&B
data: A(8) type c value 'abcdef',
B(2) type c value 'gh'.
concatenate A B into A.
write:/ A.
Regards,
Maha
‎2007 Dec 29 8:51 PM
Hi,
is this really a problem?
I tried this without a problem:
-
DATA: a TYPE string,
b TYPE string.
a = 'AB'.
b = 'AP'.
CONCATENATE a b INTO a.
WRITE a.
-
Output ist ABAP
-
Kindly regards,
Stefan
‎2007 Dec 29 11:35 PM
Hi Carme,
Stefan is right...
data: a type string value 'abcdef',
b type string value 'gh'.
concatenate a b into a.
write:/ a
O/P: abcdefgh
Regards,
Maha
‎2008 Jan 17 4:59 AM
hi,
data: A(8) type c value 'efghi',
B(2) type c value 'abcd'.
concatenate B A into B
write:/ B.
Execute this.
Regards,
sandeep
‎2008 Jan 17 5:03 AM
hi,
data: A(8) type c value 'efghi',
B(4) type c value 'abcd'.
concatenate B A into a.
write:/ a.
Execute this.
Regards,
sandeep
‎2008 Jul 15 2:00 PM
hi Genious,
REPORT ZSAN4.
DATA: ITAB LIKE ZSTUDENT OCCURS 0 WITH HEADER LINE.
READ TABLE ITAB WITH KEY ROLLNO = 1001.
WRITE:/ ITAB-FNAME, ITAB-LNAME, ITAB-CLASS.
Regards,
sandeep
‎2008 Jan 17 5:21 AM
Hi,
Check below example:
data: l_a(5) type c value 'ABC',
l_b(3) type c value 'DEF',
l_c(10) type c,
l_d type string.
" concatenating l_a and l_b results in a length of 8 = 5 + 1
concatenate l_a l_b into l_d.
write:/ l_d. " l_d is of type string so it can hold 8 characters
concatenate l_a l_b into l_c.
write:/ l_c. " l_c is of type char with length 10 so it can hold 8 characters from concatenate stmt
concatenate l_a l_b into l_a.
write:/ l_a. " l_a is of type char with length 5, so the maximum length it can hold is 5 characters so there is truncation of the other char(s)
Hope this helps...
Kind Regards
Eswar