2008 Apr 16 1:36 PM
Hi,
I want the function module which can convert the field leading zero. The data type is CURR of the field.
For example I have one internal table itab_mara in which VERBR field I have to convrt this field.
suppose this is 100.79. Then the output should be 00010079.
It should remove the . with space and fill the zero.Total no of digits should be 8 after conversion.
Thanks.
Hi,
I want the function module which can convert the field leading zero. The data type is CURR of the field.
For example I have one internal table itab_mara in which VERBR field I have to convrt this field.
suppose this is 100.79. Then the output should be 00010079.
It should remove the . with space and fill the zero.Total no of digits should be 8 after conversion.
Thanks.
2008 Apr 16 1:40 PM
Hi,
CONVERSION_EXIT_ALPHA_INPUT converts any number into a string fill with zeroes, with the number at the extreme right
Example:
input = 123
output = 0000000000000...000000000000123
CONVERSION_EXIT_ALPHA_OUTPUT converts any number with zeroes right into a simple integer
Example:
input = 00000000000123
output = 123
Please reward if useful.
2008 Apr 16 1:42 PM
hi sandeep,
do this way:
data: num(8) type numc.
num = v_valu * 100.
write: num.
Regards,
Ravi Kanth Talagana
2008 Apr 16 1:42 PM
Hi,
You can use Unpack command also.
Data : temp(10) value '123'.
unpack temp into temp.
write : temp. "123 converted into 0000000123.
thanks.
2008 Apr 16 1:43 PM
hi,
use this FM. it will append Zero's to left of the value.
take u r amount in one varialbe and pass to this FM.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_refno
IMPORTING
output = v_refno.
2008 Apr 16 1:54 PM
Hi,
Try the code below:
DATA : amt type MAXBT VALUE '0.50',
str(20) type c.
CALL FUNCTION 'HRGPBS_HER_FORMAT_AMOUNT'
EXPORTING
p_amount = amt
p_currency = 'USD'
p_required_format = '00000000'
* IMPORTING
* P_ERROR =
* P_ERROR_AMOUNT =
* P_ERROR_CURRENCY =
* P_ERROR_OVERFLOW =
changing
p_formatted_amount = str
.
WRITE : str .
Thanks,
Sriram Ponna.
2008 Apr 16 1:57 PM
Hi,
DATA: V_AMT TYPE P DECIMALS 2.
DATA: V_NUM(8) TYPE N.
V_AMT = '100.79'.
V_AMT = 100 * V_AMT.
WRITE:/ V_AMT.
MOVE V_AMT TO V_NUM.
WRITE:/ V_NUM.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |