Application Development 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: 

numbers to words.

Former Member
0 Kudos
111

hi,

Since i am new to abap Can anyone tell me how do we convert digits to words without using any standard functions.

if input is 2341 then my output should be two thousand three hundred and fourty one.

thanks in advance,

mansi.

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos
79

Welcome to SCN.

Plz SEARCH in SCN before posting, you will get lot of information.

8 REPLIES 8

former_member1245113
Active Contributor
0 Kudos
79

Hi Manasa,

Grand Welcome to SCN/SDN

Use FM SPELL_AMOUNT this will give you required output

TABLES spell.
CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          = 2345
*   CURRENCY        = ' '
*   FILLER          = ' '
*   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        = spell
* EXCEPTIONS
*   NOT_FOUND       = 1
*   TOO_LARGE       = 2
*   OTHERS          = 3
          .
IF sy-subrc = 0.
WRITE spell-word.
ENDIF.

Cheerz

Ram

Former Member
0 Kudos
79

Hi !

Use CALL FUNCTION 'ZIBHR_AMT_WORDS_INR'.

Regards

Sheetal

Former Member
0 Kudos
79

Hi !

CALL FUNCTION 'ZIBHR_AMT_WORDS_INR'

EXPORTING

amt_in_num = amt_ctc

IMPORTING

amt_in_words = amt_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.

DESCRIBE TABLE offer LINES table_lines.

IF amt_words <> 'NIL'.

REPLACE 'Paise' IN amt_words WITH 'Paise'.

IF sy-subrc = 0.

REPLACE 'Rupees' IN amt_words WITH 'And'.

ELSE.

REPLACE 'Rupees' IN amt_words WITH ''.

ENDIF.

ENDIF.

CONCATENATE 'Rupees' amt_words INTO amt_words

SEPARATED BY ' '.

0 Kudos
79

A Z Function Module? Wow!!!

Reported to SCN Moderators along with the rest who answered the query.

pk

GauthamV
Active Contributor
0 Kudos
80

Welcome to SCN.

Plz SEARCH in SCN before posting, you will get lot of information.

Former Member
0 Kudos
79

Use FM : SPELL_AMOUNT

kesavadas_thekkillath
Active Contributor
0 Kudos
79

Hi Manasa,

I dont think this is a business requirement , its a kind of training task assigned to you.

ThomasZloch
Active Contributor
0 Kudos
79

Please folks, don't ask or answer such basic questions.

Thread locked.

Thomas