Skip to Content

How to display amt in words.If the amt is in lacs

Hi All,

Requirement is in Smart Forms.

I want to display amount in words(INDIAN Currency). For this I am using SPELL_AMOUNT function module. So i am getting amt in words.

For this amt in word i have to add

1. 'AND' Symbol at hundered place,

2. 'ONLY' at the end of the amount

I written the logic to meet above requirement: See Below code

DATA w_words(250).

DATA: lv_str1 TYPE string,

lv_str2 TYPE string.

TABLES spell.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = '524349.00'

currency = 'INR'

IMPORTING

in_words = spell

.

IF spell-word CS 'ED'.

SPLIT spell-word AT 'ED' INTO lv_str1 lv_str2.

IF lv_str2 ne space.

CONCATENATE lv_str1 'ED' ' &' lv_str2 ' ONLY' INTO w_words." SEPARATED BY space.

ELSE.

CONCATENATE lv_str1 'ED' lv_str2 ' ONLY' INTO w_words.

ENDIF.

ELSE.

CONCATENATE spell-word ' ONLY' INTO w_words.

ENDIF.

WRITE: w_words.

-


For this program:

If the amt is in thousands. It is displaying like below:

amt = 24349

TWENTY-FOUR THOUSAND THREE HUNDRED AND FORTY-NINE ONLY

If the amount is in lacs.It is displaying like below

amt = 524349

FIVE HUNDRED AND TWENTY-FOUR THOUSAND THREE HUNDRED FORTY-NINE ONLY

My requirement is to display the amt 524349 as

-


FIVE LACS TWENTY-FOUR THOUSAND THREE HUNDRED AND FORTY-NINE ONLY

-


Please suggest me the logic which I written is correct or not(I splitting the amt on 'ED' basis)...

If u have any other logic to implement above requirement..

This is consider it as urgent requirement...

Regards,

vinod

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 02:15 PM

    Hello Vinod,

    Use this Function module HR_IN_CHG_INR_WRDS

    for INR Currency.

    use this code to add only at the end.

    CONCATENATE WS_WORD 'Only' INTO WS_WORD SEPARATED BY SPACE.

    Reward if Helpful

    Kumar.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.