‎2008 Feb 21 8:38 AM
hi,
i wont to add '-' to field of char 7 in the
e.g.
12-2345
ab-cdef
regards
‎2008 Feb 21 8:45 AM
Hello,
Check this sample code:
DATA: STR1(10) VALUE 'ABCDEF',
STR2 LIKE STR1.
CONCATENATE STR1+0(2) '-' STR1+2(8) INTO STR2.
WRITE: STR2.
Cheers,
Vasanth
‎2008 Feb 21 8:39 AM
hi use concatenate statement ...
i.e,
concatenate var1 '-' var2 into var3. Regards,
Santosh
‎2008 Feb 21 8:47 AM
hi,
thanks
i have it in one field 123456 and i wont 12-3456
abcdef to ab-cdef
regards
‎2008 Feb 21 8:42 AM
‎2008 Feb 21 8:43 AM
Hi Ricardo,
You can concatenate the strings as follows :
CONCATENATE 'ab' '-' 'cdef' into string SEPARATED BY SPACE.
Hope this helps.
Please reward if helpful.
Regards,
Esha Raj
‎2008 Feb 21 8:45 AM
Hello,
Check this sample code:
DATA: STR1(10) VALUE 'ABCDEF',
STR2 LIKE STR1.
CONCATENATE STR1+0(2) '-' STR1+2(8) INTO STR2.
WRITE: STR2.
Cheers,
Vasanth
‎2008 Feb 21 8:45 AM
Hi,
Here your question is not cclear. We can understand your question in 2 ways.
1. DATA : char(7) Value 'abcdef',
char1(7) .
Now you want to add '-' after ab.
concatenate char0(2) '-' char3(7) INTO char1.
2. you ar getting ab fron variable var1 and cdef from var2
concatenate var1 '-' var2 INTO char1.
‎2008 Feb 21 8:46 AM
Hi
Check this Small Program ..
Hope it helps..
DATA : a type char7 value '123456' ,
b type char1 value '-' .
DATA : c type char5 ,
d type char5 .
sy-fdpos = 2 .
C = a+0(sy-fdpos).
D = a+sy-fdpos.
CONCATENATE c '-' d INTO a .
WRITE a .
Thanks
Praveen