‎2007 Jul 30 11:00 AM
Hi All,
As per the requirement i have to convert amount in indian rupees to words. Which is the function module should i use? I tried using "SPELL_AMOUNT". but it is not dislaying in the correct format. please help.
Rakesh
‎2007 Jul 30 11:03 AM
hi
Use FM HR_IN_CHG_INR_WRDS or SPELL_AMOUNT
Here is the sample code
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_WORDS
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE AMT_IN_WORDS.
regards
vijay
<b>plz dont forget to reward points if helpful</b>
‎2007 Jul 30 11:02 AM
Function module HR_IN_CHG_INR_WRDS converts a number into words in lakhs, but as this is part of the HR module may not be available in your system.
Regards,
Nick
‎2007 Jul 30 11:03 AM
hi
Use FM HR_IN_CHG_INR_WRDS or SPELL_AMOUNT
Here is the sample code
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_WORDS
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE AMT_IN_WORDS.
regards
vijay
<b>plz dont forget to reward points if helpful</b>
‎2007 Jul 30 11:03 AM
Hi
you can use the function module....
HR_IN_CHG_INR_WRDS
reward points if helpful,
thanks & regards,
venkatesh
‎2007 Jul 30 11:04 AM
‎2007 Jul 30 11:06 AM
data: int_val type i,
cent_val type p decimals 2,
val type p decimals 2,
IN_WORDS like spell,
SPELL_VAL(255) type c,
SPELL_CENT(255) type c.
int_val = trunc( val ).
cent_val = ( val - int_val ) * 100.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = val
CURRENCY = 'USD'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = IN_WORDS.
SPELL_VAL = IN_WORDS-WORD.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = cent_val
CURRENCY = 'USD'
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = IN_WORDS.
SPELL_CENT = IN_WORDS-WORD.
CONCATENATE SPELL_VAL ' DOLAR ' SPELL_CENT ' CENTS ' INTO SPELL_VAL.
‎2021 Aug 27 3:46 PM