07-30-2007 8:56 AM
Hi all,
i have small prob.... how i want to delete zero in string format... let say i have 123000 and i want to get output 123 or i have 1200000 so i want to be 12...
can someone help me...
Thanks...
07-30-2007 8:57 AM
07-30-2007 8:59 AM
07-30-2007 9:01 AM
Hi,
u can do it in number of ways.
Use TCODE SU3
Select default tab and select radio button 123467.89 in decimal notation and save it.
or u can try :
if you want to do this through ABAP program.
1. to delete trailing spaces.
SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
to delete leading zeroes,
SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
only for one abap program, u can use set country command
for all programs :
sap menu>system->go to user profil->own data>default --> and choose ur format.
or u can use these fms also..
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
reward if it helps..
Regards,
Omkar.
07-30-2007 9:01 AM
Hi,
Use mod function in do loop.
data:c type i,v_var type i type 1230000.
c = v_var.
Do.
v_var = c.
c = c mod 10
If c ne 0.
Exit.
Endif.
Enddo.
Then Value of V_var after this do loop will be 123.
07-30-2007 9:05 AM
If the problem is at the end of string ,you ca use also
SHIFT <your string> RIGHT DELETING TRAILING '0'.
regards
Yossi
Message was edited by:
Yossi Rozenberg
07-30-2007 9:47 AM