‎2006 Apr 25 6:09 PM
Dear All,
In SAP script, I have to split a text element into 2 parts, eg &matnr&, and then concatinate these 2 elements with a constant value in between how can I do that
To make clear say my Matnr is 12345678, I need an output like 1234 USA 5678. please suggest me in doing this.
Thanking you.
Regards
Venkat.
‎2006 Apr 25 11:11 PM
Your character indexing is wrong.
For example A+2(3) means 3 characters in field A starting after the character 2.
So you should be using
®UH-ZALDT(2)& ®UH-ZALDT2(2)& ®UH-ZALDT4(2)&
Regads,
Nagaraju Chidurupalli.
‎2006 Apr 25 6:14 PM
You need to call a subroutine with:
PERFORM rutine IN PROGRAM zprogram.
USING &MATNR&
CHANGING &NEW_MATNR&
ENDPERFORM.
‎2006 Apr 25 6:15 PM
Did you try this..
&matnr(4)& USA &matnr+4&
Regards,
Nagaraju Chidurupalli
‎2006 Apr 25 6:20 PM
Hi venkat,
If you want to dynamically split the material no. then you have to use a routine in the form & create a program & do that...
/:PERFORM SPLIT_MAT IN PROGRAM Z_SPLIT
/: USING &MATNR&
/: CHANGING &MAT1&
/:ENDPERFORM.
Or if you know where to split..like after first 4 characters..etc then try to use the below statements to do so...
MATNR+4& Offset - Output begins here. Offset refers to formatted value
&MATNR(5)& Length - Output data in the specified length
Message was edited by: Phani Kiran Nudurupati
‎2006 Apr 25 11:03 PM
Dear Peluku, Nag & Phani,
Thanks for your information, I got it solved !
I am trying other one, but unable to get right output.
I would like to split date into Day, month and year.
So I am doing so.
but it is not working, year field shows only 1char.
/: Set date mask = 'DDMMYY'
®UH-ZALDT(2)& ®UH-ZALDT3(2)& ®UH-ZALDT5(2)&
Please let me know, where is the mistake.
Thanking you.
Regards
Venkat.
‎2006 Apr 25 11:11 PM
Your character indexing is wrong.
For example A+2(3) means 3 characters in field A starting after the character 2.
So you should be using
®UH-ZALDT(2)& ®UH-ZALDT2(2)& ®UH-ZALDT4(2)&
Regads,
Nagaraju Chidurupalli.
‎2006 Apr 25 11:22 PM
Dear Nag,
Thanks for quick info. problem Solved.
Thank you once again.
Closing thread, alloating points.
Regards
Venkat