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: 

FM for amont in spanish

Former Member
0 Kudos

HI All

I have a requirement for printing amount in spanish language on a recepit, By using SPELL_AMOUNT i am able to print in English but not in Spanish(Mexico)

thanks & regards

Suresh

1 ACCEPTED SOLUTION

former_member705122
Active Contributor
0 Kudos

Hi,

Please check this,

DATA:
  w_word  LIKE spell,
  w_in(2) TYPE c VALUE 'ES',
  w_out   TYPE c.
* Convert two-digit ISO language -> one-digit SAP language key
CALL FUNCTION 'CONVERSION_EXIT_ISOLA_INPUT'
  EXPORTING
    input            = w_in
  IMPORTING
    output           = w_out
  EXCEPTIONS
    unknown_language = 1
    OTHERS           = 2.
if sy-subrc eq 0.
* Convert numbers and figures in words
CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
    amount    = 1230
    currency  = ' '
    filler    = ' '
    language  = w_out
  IMPORTING
    in_words  = w_word
  EXCEPTIONS
    not_found = 1
    too_large = 2
    OTHERS    = 3.
endif.
 
write: w_word-word.

Regards

Adil

7 REPLIES 7

Former Member
0 Kudos

Hi,

have u tried giving SV in Language parameter for SPELL_AMOUNT ?

Kothand

peter_ruiz2
Active Contributor
0 Kudos

hi,

use ES as the language parameter of the Function Module

regards,

Peter

0 Kudos

Hi,

Oops.. Yes its ES and not SV.. I wrongly thought it as swedish

Kothand

0 Kudos

hi all,

i am using the FM SPELL_AMOUNT in a smartform it was going to dump

the error analysis is like this

An exception occurred. This exception is dealt with in more detail below

. The exception, which is assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE',

was neither

caught nor passed along using a RAISING clause, in the procedure "%CO9"

"(FORM)"

.

Since the caller of the procedure could not have expected this exception

to occur, the running program was terminated.

The reason for the exception is:

The call to the function module "SPELL_AMOUNT" is incorrect:

The function module interface allows you to specify only fields

of a particular type under "LANGUAGE". The field "'ES'" specified here

has a different field type.

i had used the FM like this

the import parametres are G_TOT_TOT type DFKKOP-BETRW

another is spell type char100

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = g_tot_tot

CURRENCY = 'PESO'

FILLER = ' '

LANGUAGE = 'ES'

IMPORTING

IN_WORDS = SPELL.

please help me

thanks & regards

Suresh

former_member705122
Active Contributor
0 Kudos

Hi,

Please check this,

DATA:
  w_word  LIKE spell,
  w_in(2) TYPE c VALUE 'ES',
  w_out   TYPE c.
* Convert two-digit ISO language -> one-digit SAP language key
CALL FUNCTION 'CONVERSION_EXIT_ISOLA_INPUT'
  EXPORTING
    input            = w_in
  IMPORTING
    output           = w_out
  EXCEPTIONS
    unknown_language = 1
    OTHERS           = 2.
if sy-subrc eq 0.
* Convert numbers and figures in words
CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
    amount    = 1230
    currency  = ' '
    filler    = ' '
    language  = w_out
  IMPORTING
    in_words  = w_word
  EXCEPTIONS
    not_found = 1
    too_large = 2
    OTHERS    = 3.
endif.
 
write: w_word-word.

Regards

Adil

0 Kudos

thank you for that help to all but i have a small problem again in the same thing that is it was not able to display after the decimal point

for example 601.30 it was displaying only six hundred and one. not that 30 after decimal point.

can any one help me please

thanks & regards

Suresh

0 Kudos

Hello

write: spell-word.

write: spell-decword.