09-08-2010 9:15 AM
Dear Guru ,
I am writing an abap program and i want to remove all zero from decimal side .
For instance :
DATA : L_A TYPE MENGE VALUE '333.000' .
DATA : L_A TYPE MENGE VALUE '3335.300' .
.....
.....
OUTPUT :
333
3335.3
Is it possibile to do that ?
Thanks .
Best Regards,
Carlos Zhang
09-08-2010 11:33 AM
the easiest way tould be define the variable with the TYPE of a field for which such conversion routine is already defined. conversion routines are assigned at the domain level. the other obvious way is through coding.
Check function modules CONVERSION_EXIT_*
09-08-2010 9:30 AM
09-08-2010 9:57 AM
DATA : l_a TYPE p LENGTH 13 DECIMALS 3 VALUE '333.000' .
DATA : l_b TYPE p LENGTH 13 DECIMALS 3 VALUE '3335.300' .
DATA : l_ax(14).
DATA : l_bx(14).
l_ax = l_a.
l_bx = l_b.
CONDENSE: l_ax, l_bx.
SHIFT: l_ax RIGHT DELETING TRAILING space,
l_bx RIGHT DELETING TRAILING space,
l_ax RIGHT DELETING TRAILING '0',
l_bx RIGHT DELETING TRAILING '0',
l_ax RIGHT DELETING TRAILING '.',
l_bx RIGHT DELETING TRAILING '.'.
CONDENSE: l_ax, l_bx.
WRITE: l_ax, / l_bx.
09-08-2010 11:33 AM
the easiest way tould be define the variable with the TYPE of a field for which such conversion routine is already defined. conversion routines are assigned at the domain level. the other obvious way is through coding.
Check function modules CONVERSION_EXIT_*