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

FM

Former Member
0 Likes
889

Hi All,

Can anyone tell me the fm for coverting digits to words?

Ex. !0,020 - ten thousand and twenty only.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
826

Hi,

Use HR_IN_CHG_INR_WRDS.

Regards,

Himanshu

9 REPLIES 9
Read only

Former Member
0 Likes
826

HI Shreya

You can use <b>SPELL_AMOUNT</b>

REPORT ZSPELL.
 
TABLES SPELL.
 
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '123451022343333235'.
 
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

or

Use FM <b>HR_IN_CHG_INR_WRDS</b>


DATA cur LIKE pc207-betrg VALUE '100000.00'.
DATA words(100) TYPE c.

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = cur
IMPORTING
amt_in_words = words.
WRITE words.

Regards Rk

Message was edited by:

Rk Pasupuleti

Read only

0 Likes
826

ur code is directly showing this value.

NUMBERS

FOUR TRILLIONSFIVE HUNDRED TEN BILLIONS TWO HUNDRED TWENTY-THREE MILLION FOUR HUNDRED THIRTY-THREE THOUSAND THREE HUNDRED THIRTY-TWO

DECIMALS THIRTY-FIVE

is it hard coded?

Read only

0 Likes
826

Hi Shreya

I didn't get your question , If you give that input then you will get the according output or

if you need to pass the number then change that Variable as <b>Parameter</b> Instead of Data and pass the required number from selection screen

Regards Rk

Read only

Former Member
0 Likes
826

u can use SPELL_AMOUNT fm or

HR_IN_CHG_INR_WRDS for INR.

or check program RF_SPELL.

Regards

prabhu

Read only

Former Member
0 Likes
827

Hi,

Use HR_IN_CHG_INR_WRDS.

Regards,

Himanshu

Read only

Former Member
0 Likes
826

Hi,

FM 'SPELL_AMOUNT'

Pls. reward if useful..

Read only

Former Member
0 Likes
826

Hi shreya,

<b>

SPELL_AMOUNT, HR_IN_CHG_INR_WRDS</b>

serves for your purpose.

Here

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

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

<b> Here change the value it is not hard coded.

You can change this variable into a parameter. So that you can give the values you want</b>

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

0 Likes
826

Thanks to all,

I'll try using these fms in my programs.

Points r rewarded to all helpful answers.

Read only

0 Likes
826

HI Shreya

Dont forget to <b>close the Thread</b> if you got the Answer

Regards Rk