Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module

Former Member
0 Likes
525

Hi

all,

i want to convert num amount in words i.e 700 to seven hundred ,is there any function module or code plese help me out.i am not abe to find fun module.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
500

Hi Abhishek,

try with this code and Fm

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = l_spell_a

IMPORTING

amt_in_words = l_spell

EXCEPTIONS

data_type_mismatch = 1

OTHERS = 2.

please do reward if help!

Amit.

4 REPLIES 4
Read only

Former Member
0 Likes
500

Hi Abhishek,

Refer to the following FM:

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

CURRENCY = PWAERS

FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

ENDFORM. " SPELL_AMOUNT

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
500

FM Spell_amount

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

CURRENCY = PWAERS

FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

ENDFORM. " SPELL_AMOUNT

Read only

Former Member
0 Likes
501

Hi Abhishek,

try with this code and Fm

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = l_spell_a

IMPORTING

amt_in_words = l_spell

EXCEPTIONS

data_type_mismatch = 1

OTHERS = 2.

please do reward if help!

Amit.

Read only

Former Member
0 Likes
500

use FM HR_IN_CHG_INR_WRDS


v_i_amount = tmp_amt.

call function 'HR_IN_CHG_INR_WRDS'
  exporting
    amt_in_num               = v_i_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.