cancel
Showing results for 
Search instead for 
Did you mean: 

in scripts i want to display the total puchage order amount in text format

Former Member
0 Kudos

Hi to all,

Here my requirement is to display puchage order number,date,amount for individual order and total purchage order amount in same window in decimal format and i want to display this purchage order total amount in text format in another window ,is it possible or not

please give solution asap urgent.

regards,

surya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use fm "Spell_amount"

DATA int_betrag LIKE payr-rwbtr value '1000'.

DATA up_spell LIKE spell.

data par_waer LIKE payr-waers value 'INR'.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = int_betrag

currency = par_waer

IMPORTING

in_words = up_spell

EXCEPTIONS

OTHERS = 1.

Edited by: Madhavi t on Jan 3, 2008 7:42 AM

Answers (2)

Answers (2)

former_member187457
Active Contributor
0 Kudos

Hi Surya

It is possible ....jst call the routine in script..

/:PERFORM SPELL_AMOUNT IN PROGRAM ZXYZ

/:USING &REGUD-SWNES&

/:USING &REGUD-WAERS&

/:CHANGING &WORDS&

/:CHANGING &DECIMAL&

/:CHANGING &WAERS&

/:ENDPERFORM

P1 <C1>&WORDS& AND &DECIMAL&

....and write the code in tht routine program....

data: it_spell like spell.

data: swnes type regud-swnes,

waers type regud-waers,

var1(20) type c,

var2(20) type c.

&----


*& form spell_amount

&----


  • text

----


  • -->input text

  • -->output text

----


form SPELL_AMOUNT tables input structure itcsy

output structure itcsy.

read table input index 1.

  • input = swnes.

replace all occurrences of '*' in input-value with space.

shift input-value left deleting leading space.

translate input-value using ', '.

condense input-value no-gaps.

split input-value at '.' into var1 var2.

condense: var1, var2.

swnes = input-value.

read table input index 2.

waers = input-value.

call function 'SPELL_AMOUNT'

exporting

amount = swnes

currency = waers

  • filler = ' '

language = sy-langu

importing

in_words = it_spell

exceptions

not_found = 1

too_large = 2

others = 3

.

if sy-subrc eq 0.

refresh: output.

output-name = 'WORDS'.

condense waers.

case waers.

when 'USD'.

concatenate it_spell-word 'DOLLARS' into

it_spell-word separated by space.

when 'EUR'.

concatenate it_spell-word '' into

it_spell-word separated by space.

  • concatenate var2 'euros' into var2 separated by space.

when others.

endcase.

output-value = it_spell-word.

append output.

output-name = 'WAERS'.

output-value = waers.

append output.

condense waers.

case waers.

when 'USD'.

concatenate var2 'CENTS***' into var2 separated by space.

when 'EUR'.

concatenate var2 'EUROS' into var2 separated by space.

when others.

endcase.

output-name = 'DECIMAL'.

output-value = var2.

append output.

endif.

endform. "spell_amount

this will give output as TEN DOLLARS & 20 CENTS....

u can change the code as per ur requrement...

Reward if Helpful....

thnx

Rohit

Former Member
0 Kudos

Hi,

You can use :

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

LANGUAGE = SY-LANGU

CURRENCY = CURR " EUR

AMOUNT = '1000.00'

FILLER = SPACE

IMPORTING

IN_WORDS = WF_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2.

WF_SPELL will have the Amount in words.

Regards,

Omkar.