‎2008 Jul 10 11:38 AM
Hi experts,
Here is my question.
Consider i have a variable
data : a(15).
and
a = '24.000.000,00'.
i want to make it like
000024000000,00
deleting '.' and adding '0' completing 15 characters. The number has 2 decimal places o it is stable. But it can be any number. like 240,00 or 24.000,00 or lot more than that.
Thanks in advance
Full points will be rewarded
‎2008 Jul 10 11:43 AM
hi,
you can code like this:
TRANSLATE string USING '. '.
CONDENSE string NO-GAPS.
SHIFT string RIGHT DELETING TRAILING space.
TRANSLATE string USING ' 0'.hope this helps
ec
‎2008 Jul 10 11:42 AM
you ca use
REPLACE ALL OCCURENCES OF '.' IN a WITH space.
CONDENSE a.
CALL FUINCTION 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = a
importing
output = a.
‎2008 Jul 10 11:43 AM
hi,
you can code like this:
TRANSLATE string USING '. '.
CONDENSE string NO-GAPS.
SHIFT string RIGHT DELETING TRAILING space.
TRANSLATE string USING ' 0'.hope this helps
ec
‎2008 Jul 10 11:43 AM
hiiii
i think for adding leading zeros you can use folllowing FM.Try using this.use proper length that you want for target variable & its data type should be I.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_matnr
IMPORTING
output = w_matnr.regards
twinkal
‎2008 Jul 10 11:46 AM
hi,
You may try.
Replace ALL occurances of '.' with SAPCE into w_string.
Condense w_string no-gaps.
shift Right w_string.
replace ALL occurance of SPACE with '0' into w_string.
Regards
Sumit Agarwal
‎2008 Jul 10 11:48 AM
Hi,
have a look.
replace all occurences of '.' IN a with space
condence a no-gaps.
regards.
sriram.