cancel
Showing results for 
Search instead for 
Did you mean: 

Amount in Words using SPELL_Amount in Arabic Smart-forms

Former Member
0 Kudos

I am facing the difficulty during the step in smartform printing. Client is to have a printout in Bi-lingual (english+arabic), Arabic is printing fine. The maintenance language of smartform is arabic.

Problem arises:

I am using the function SPELL_AMOUNT to get the "Amount in Words" of Gross Value. In the print preview and printout, "Amount is words" are appearing as jumbled. for example,

Gross Value 238,476.00 SAR

Expected Amount in Words Two Hundred Thirty-Eight Thousand Four hundred Seventy-Six.

Appearing Amount in Words Seventy-Six Two Hundred Thirty-Eight Thousand Four Hundred.

Waiting for your valuable inputs.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Try the below code:

Pass the amount after Decimal to the Spell amount seperately and then concatenate the two parts of the amount.

For example : 30.60 USD

Store the amount in a character string. Split the string at decimal point using a SPLIT statement.

DATA: amount_total(10),

round(7),

dec_part(3).

DATA: dec(1) TYPE c VALUE '.',

amount_total = '30.69'.

SPLIT amount_total AT dec INTO round dec_part.

First pass variable 'round' to Spell_amount and then in the second call pass variable 'Dec_PART' and concatenate the two results.

Regards,

sirisha.

0 Kudos

Hi,

Pass the currency value to Function module

prakashjasti
Contributor
0 Kudos

You are concatenating the variables in reverse order

So that is coming like that.

Check the variables once.

Ragards,

Prakash.

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

can you please apply SAP note 1417027 and check whether this solves your problem ?

Best regards,

Nils Buerckel

Former Member
0 Kudos

Hi,

additional to the language and currency, you also have to declare the amount with decimals; otherwise, it takes the last 2 digits as decimal.

238476 --> it delivers TWO THOUSAND THREE HUNDREDEIGHTY-FOUR in field Word and SEVENTY-SIX in field Decword.

238476.00 --> it delivers TWO HUNDRED THIRTY-EIGHT THOUSAND FOUR HUNDREDSEVENTY-SIX

(and ZERO in field Word)

Are you paying attention to field Decword in structure IN_WORDS ?? how do you build that information, so that decimals are displayed in the first place and then the rest of the amount ??

Former Member
0 Kudos

@Jorge: the amount as I mentioned in my question contains decimal places.

@Vishwa: we specify the currency as our u201Cdocument currencyu201D like SAR or USD.

@harish: in the debugging mode, amount in words are correct. Only issue remains about mis-placing. We have also view the country settings about decimal places in table T005X, and it is blank for country SA (I also tried other options mentioned in T005x table)

Former Member
0 Kudos

Hi,

In debugging mode , just check whether you are getting the amount in words in the correct format by using SPELL_AMOUNT FM. I think the last two digits before the decimal places are being displayed first.

Also check the decimal notation maintained for your country in T005X table.

Thanks & Regards,

Harish

Former Member
0 Kudos

We have debug it.... in the debugging mode the amount in words appearing is correct... but at the print preview it is incorrect. we have tried 2 things.

1. we have written the function module " spell_amount " in the SMART FORM, but the incorrect result is displayed.

2.we have written the function module " spell_amount " in the MAIN PROGRAM, but the incorrect result is displayed.

Former Member
0 Kudos

Did you give the currency in the SPELL_AMOUNT FM?? If you dont give the currency, it wont come correctly.

Vishwa.