on 01-29-2008 1:53 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.