‎2008 Mar 07 5:04 AM
Hi Friends,
I have defined a varialbe
data: l_amount type wrbtrI want to pass the value of l_amount to another variable l_pay which is defined as
data: l_pay(15) type cNow, I want to add zero's before the value of l_pay.
Example:
if
l_amount = 600.50after passing the value l_pay will contain
l_pay = 600.50But, I want
l_pay = '000000000600.50'.
I have tried to use CONVERSION_EXIT_ALPHA_INPUT, but it is not working.
Regards,
Praveen
‎2008 Mar 07 5:10 AM
Calulate the no of digits in l_pay and concatenate 0s in the rest of the places in l_pay to make it 15 digits.
‎2008 Mar 07 5:13 AM
CONVERSION_EXIT_ALPHA_INPUT
*
DATA: c1(10) value '100'.
DATA: c2(10).
*
write: / c1.
*
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = C1
IMPORTING
OUTPUT = C2.
*
write: / c2.
Output will be 000000100
If you want to remove zeros then use Fm CONVERSION_EXIT_ALPHA_OUTPUT.
Regards,
Chandru
‎2008 Mar 07 5:57 AM
Hi Prakash,
Thanks for your reply...
But please use the function module CONVERSION_EXIT_ALPHA_INPUT with values with decimals like 100.20. It will not add zero's befor 100.20.
I want output like '000000000100.20'
Regards,
Praveen
‎2008 Mar 07 6:06 AM
Hi,
Use below logic:
DATA: l_amount TYPE wrbtr,
l_pay(15) TYPE c.
l_amount = '600.50'.
l_pay = l_amount.
TRANSLATE l_pay USING ' 0'.
WRITE : / l_pay.
‎2008 Mar 07 5:20 AM
Hi
try this.
DATA : I_P(15) TYPE C,
I_AM(15) TYPE C.
I_AM = 600.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = I_AM
IMPORTING
OUTPUT = I_AM.
I_P = I_AM. .
WRITE : I_P.
Thanks&Regards,
Chaithanya.