Application Development and Automation 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: 
Read only

Spell_amount

Former Member
0 Likes
1,095

please explain about import and export paramters of spell_amount

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
1,014

data :       TOTAL1(10) TYPE I.
DATA  begin of in_word occurs 0.
             include structure spell.
data    end of in_word.

CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          =  TOTAL1
   CURRENCY        =  CHWAERK
   FILLER          = ' '
   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        =  in_word
 EXCEPTIONS
   NOT_FOUND       = 1
   TOO_LARGE       = 2
   OTHERS          = 3

Regards

Gopi

8 REPLIES 8
Read only

Former Member
0 Likes
1,014

Hi

Import parametrs

AMOUNT 0

CURRENCY LIKE SY-WAERS SPACE

FILLER SPACE

LANGUAGE LIKE SY-LANGU SY-LANGU

Export paramter

IN_WORDS LIKE SPELL

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
1,014

Hi,

DATA v_int TYPE i VALUE '1000'.

DATA words LIKE SPELL.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = words

.

WRITE words-word.

Please close the thread if it is answered

Thanks

hari krishna

Read only

Former Member
0 Likes
1,014

see the below example for all the parameters of the Function Module .....

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

  CALL FUNCTION 'SPELL_AMOUNT'
       EXPORTING
            AMOUNT    = PAMOUNT
            CURRENCY  = PWAERS
            FILLER    = SPACE
            LANGUAGE  = 'E'
       IMPORTING
            IN_WORDS  = T_SPELL
       EXCEPTIONS
            NOT_FOUND = 1
            TOO_LARGE = 2
            OTHERS    = 3.
ENDFORM.                               " SPELL_AMOUNT

Girish

Read only

gopi_narendra
Active Contributor
0 Likes
1,015

data :       TOTAL1(10) TYPE I.
DATA  begin of in_word occurs 0.
             include structure spell.
data    end of in_word.

CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          =  TOTAL1
   CURRENCY        =  CHWAERK
   FILLER          = ' '
   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        =  in_word
 EXCEPTIONS
   NOT_FOUND       = 1
   TOO_LARGE       = 2
   OTHERS          = 3

Regards

Gopi

Read only

Former Member
0 Likes
1,014

Hi,

chk this prog by increasing the amount

REPORT ZSPELL.

TABLES SPELL.

DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '123451022343333235'.

SY-TITLE = 'SPELLING NUMBER'.

PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.

WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.

FORM SPELL_AMOUNT USING PWRBTR PWAERS.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

CURRENCY = PWAERS

FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

ENDFORM. " SPELL_AMOUNT

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,014

how can we cover decimals with spell_amount

Read only

Former Member
0 Likes
1,014

thanq for answer could you explain how we can cover decimals in this

Read only

0 Likes
1,014

Hi

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.

Reward points if helpful.

Regards

Waseem Imran

then concatenate the results. and the resulting string will be 30 Dollars 60 Cents.