cancel
Showing results for 
Search instead for 
Did you mean: 

check printing: Amount in words is getting jumbled

Former Member
0 Kudos

Hi,

I have a problem in displaying amount in words in check.

I am getting the amount in words through functuion module SPELL_AMOUNT correctly,i.e,(for example,110,002 ) ONE HUNDRED TEN THOUSAND TWO.

After getting the amount,i am concatenating the words 'ONLY' amount 'RIYALS'.In program it is concatenated correctly.Expected output is RIYALS ONE HUNDRED TEN THOUSAND ONLY.

But when seen on screen,the words are getting jumbled.

It is getting displayed as TWO RIYALS ONLY ONE HUNDRED TEN THOUSAND.

(Note: My form is in arabic,since i want to display vendor name in arabic,and rest of the check in english).

Please help me with some solution.

Thanks & Regards

Seshagiri.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

if printing the name in the form is the only problem then i can suggest u one thing...

1. use separate column for printing the price

2. for printing the vender name make another column in the form

In that column u can print your vender name

3. final column for printing ONLY

If mentain the form in this way then u need not to concatinate the name.

Reward if useful

Thanks

Krushna

Former Member
0 Kudos

Hi,

Try this code and see if this helps you out. Even I am printing the text in Turkish and using this logic.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = euro_fkwrt

currency = gt_t001-waers

language = nast-spras

IMPORTING

in_words = in_words

EXCEPTIONS

not_found = 1

too_large = 2

OTHERS = 3.

CONCATENATE in_words-word yvbdk-waers in_words-decword 'kurus'

INTO l_word SEPARATED BY space.

you can use as

CONCATENATE 'RIYALS' in_words-word in_words-decword ONLY

INTO l_word SEPARATED BY space.

Hope it helps.

Sushil.

Former Member
0 Kudos

Hi,

Once you got the amount in words use following logic.

concatenate v_amount 'ONLY' into v_amount. (0r you can take into another variable)

Reward points if useful.

Regards,

Nageswar

Former Member
0 Kudos

can you paste the code here after you have concatenated the amount and the ONLY keywords.

Former Member
0 Kudos

Hi Dishant,

Sorry for the delay.I am pasting the code below:

Code in print program:

-


Global data:

data: gv_riyals(6) value 'RIYALS', "RIYALS

gv_only(4) value 'ONLY',

gv_halalas(7) value 'HALALAS',

gv_and(3) value 'AND'.

Local data:

data: lw_dummy(25),

lw_fraction(2), "for fraction part of amount in HALALAS

lw_integer type i.

if spell-decimal is initial.

clear: spell-decimal, dg_100.

else.

lw_integer = spell-decimal / 10.

lw_fraction = lw_integer.

concatenate '(' lw_fraction '/100)'

into lw_dummy. " SEPARATED BY space.

condense lw_dummy.

clear dg_100.

dg_100 = lw_dummy.

if not spell-word is initial.

condense spell-word.

gv_spell_word(50) = spell-word. "Amount in RIYALS

endif.

endif.

call function 'WRITE_FORM'

exporting

window = 'PAY_DOC'

element = 'PAY_DOC'

exceptions

window = 1

element = 2.

if sy-subrc eq 2 and

( err_element-fname ne t042e-zforn

or err_element-fenst ne 'PAY_DOC'

or err_element-elemt ne 'PAY_DOC' ).

err_element-fname = t042e-zforn.

err_element-fenst = 'PAY_DOC'.

err_element-elemt = 'PAY_DOC'.

err_element-text = text_530.

*--Code in the script:

-


/: IF &DG_100& EQ ' '

L1 &gv_only(C)&,,&gv_riyals(C)&,,&spell-word&

/: ELSE

L1 &gv_riyals(C)&,,&gv_spell_word(C)&

L1 &gv_only(C)&,,&gv_halalas(C)&,,&dg_100(C)&,,&gv_and(C)&

/: ENDIF

Thanks & Regards

Seshagiri.

Former Member
0 Kudos

Hi,

In the script codce as below

/: IF &DG_100& EQ ' '

L1 ,,&gv_riyals(C)&,,&spell-word&,,&gv_only(C)&

/: ELSE

L1 &gv_riyals(C)&,,&gv_spell_word(C)&

L1 &gv_halalas(C)&,,&gv_and(C)&,,&dg_100(C)&,,&gv_only(C)&

/: ENDIF

Reward if useful

Regards,

Nageswar

Former Member
0 Kudos

Hi Nageswar,

Done as suggested by you.

Still the words are getting jumbled.

Thanks & Regards

Seshagiri.

Former Member
0 Kudos

Hi Nageswar,

Finally i could print the amount in words without jumbling,but i am unable to prevent unequal spaces between words.

I have taken the words into a strcture and printing each field as follows:

&gv_only(C)&,,&gv_halalas(C)&,,&dg_100(C)&,,&gv_and(C)&,,&gv_riyals(C)&

IF NOT &WA_WORDS-WORD10& = ' '

,,&wa_words-word10&

ENDIF

IF NOT &WA_WORDS-WORD9& = ' '

,,&wa_words-word9&

ENDIF

...

IF NOT &WA_WORDS-WORD1& = ' '

,,&wa_words-word1&,,

ENDIF

The words are coming as :

TWO BILLIONS FOURTEEN THOUSAND NINETY-NINE RIYALS AND (9/100) HALALAS

ONLY.

The only problem now is uneven gaps,as shown above.

Can you please help me how to maintain the gaps uniformaly?

Thanks & Regards

Seshagiri