‎2009 Aug 26 11:10 PM
Hello:
I need to remove zeros of a variable in a sapscript,
TALGN = 0000427795776
and I need to remove the zeros so:
TALGN = 427795776
But sometimes will be 3, 4 or more zeros, is there a way to do it with a sapscript command? or this should be done in the program?
Best regards and thank you for your help.
Miriam
‎2009 Aug 27 12:00 AM
&SYMBOL(Z)& Suppress leading zeros &MATNR(Z)&,
leading zeros (functionality of FM CONVERSION_EXIT_ALPHA_INPUT) keep in print program and pass this variable to script after you removed leading zeros.
Thanks,
AMS
‎2009 Aug 27 12:00 AM
&SYMBOL(Z)& Suppress leading zeros &MATNR(Z)&,
leading zeros (functionality of FM CONVERSION_EXIT_ALPHA_INPUT) keep in print program and pass this variable to script after you removed leading zeros.
Thanks,
AMS
‎2009 Aug 27 12:32 AM
Hi
Check the below code.
data a(9) value '000012345'.
SHIFT a LEFT DELETING LEADING '0'.
write:/ a.
Output will be : 12345
Regards
Vinay Kolla
‎2009 Aug 27 2:51 AM
Hi Miriam,
Certain symbol values are output with leading zeros. If you wish to suppress these, you may do so with the Z option.
Syntax
Thanks
Venkat.O&TALGN(Z)&
‎2009 Aug 27 4:06 AM
Hi Miriam,
In SAP Scripts , you have Layout Set Symbols which you can use for doing things like :-
Getting Offset - &SYMBOL+4&
Length - &SYMBOL(5)&
If symbol is initial ,output nothing - &SYMBOL(I)&
Suppress Leading zeroes - &SYMBOL(Z)&.
And many more such symbols.
Hence, you dunt need to write the code in your driving program and pass to the Script.
You can directly use these symbols in your script and get things done in simple manner.
Hope this helps...
Regards,
Samreen...
‎2009 Aug 28 7:09 PM
Hello:
Thank you.
Where can I find all this commands? do you have any documentation?
Best regards,