cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member209914
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

former_member209914
Participant
0 Kudos

HI kumar,

thanks for the reply. But the problem is i Have to pass the amt without comma.

I am passing field VBRK-NETWR. This field contains comma(,).Before passing this value into function module I have to remove the comma.

Wht should I have to do. Can U suggest me in this case.If u have any code pls send it to me.

Regards,

vinod

Former Member
0 Kudos

Hello,

The FM takes the Currency fields, try using it in program,

netwr is a curr field so it takes.

Reward Points if helpful

Kumar

Answers (0)