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: 

sap abap currency conversion in words issue

Former Member
0 Kudos

HI Friends

I hope you all doing good.

I have an issue while converting currency into words i have used bellow code

DATA l_spell LIKE spell.
* If the currency is INR
   IF P_CURR = 'INR'.
     CALL FUNCTION 'Z_FI_AMT_WRDS_CONVERT'
       EXPORTING
         AMT  = P_P_WAGE
       IMPORTING
         WORD = P_L_WRDS.

     CONCATENATE '(' P_L_WRDS INTO P_L_WRDS.
     CONCATENATE P_L_WRDS ')' INTO P_L_WRDS.



* If the currency is USD
   ELSEIF P_CURR = 'USD'.
     CALL FUNCTION 'SPELL_AMOUNT'
       EXPORTING
         AMOUNT   = P_P_WAGE
         LANGUAGE = SY-LANGU
       IMPORTING
         IN_WORDS = l_spell.

     CONCATENATE '$' l_spell-word INTO P_L_WRDS.


when INR it is converting fine into words suppose for ex 311.06  it is showing RUPEES THREE HUNDRES ELEVEN SIX PAISA

IF USD it is not displaying properly it is showing $THIRTY ONE THOUSAND ONE HUNDERD SIX is displaying.


Please help me
*

3 REPLIES 3

Former Member
0 Kudos

It might be an issue with your parameter type, which may lead to wrong conversions.

Please take a look at sample program RF_SPELL and check the parameter types. Try to use in your program similar to this example.

Regards

Luis Becker

nishantbansal91
Active Contributor
0 Kudos

Dear Satish,

Please pass the parameter SPELL_AMOUNT currency parameter in the importing parameter.

and check the table  tcurx in debugging mode. Because system is only fetching the Currency and decimal from tcurx table.

Thanks
Nishant.

Former Member
0 Kudos

Thanks for u r posts it is working fine now.

Regards,

Satheesh S.