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 SPELL_AMOUNT problems

former_member184029
Participant
0 Kudos

Hi, expert

I have a requirement to solve on PRD, we use FM SPELL_AMOUNT wich give monto_letras-word without separation for certain numbers specifically with the four hundred (400).

CALL FUNCTION 'SPELL_AMOUNT'
  EXPORTING
    amount    = monto
    currency  = 'VEB'
    language  = sy-langu
  IMPORTING
    in_words  = monto_letras
  EXCEPTIONS
    not_found = 1
    too_large = 2
    OTHERS    = 3.

Examples:

1) For Bs. 145.103.498 give back the text:

CIENTO CUARENTA Y CINCO MILLONES CIENTO TRES MIL <b>CUATROCIENTOSNOVENTA Y OCHO</b> (<i>ONE HUNDRED FORTY AND FIVE MILLION ONE HUNDRED THREE THOUSAND CUATROCIENTOSNOVENTA AND EIGHT</i>)

would have to be:

CIENTO CUARENTA Y CINCO MILLONES CIENTO TRES MIL <b>CUATROCIENTOS NOVENTA Y OCHO</b>

2) For Bs. 428.042 give back the text:

<b>CUATROCIENTOSVEINTIOCHO</b> MIL CUARENTA Y DOS

(FOUR HUNDRED TWENTY-EIGHT THOUSANDS FORTY AND TWO )

would have to be:

<b>CUATROCIENTOS VEINTIOCHO MIL</b> CUARENTA Y DOS

I will appreciate it any helpfull information, thanks in advance.

Tokio

P.D. Points reward

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I checked the FM, its working fine. May be its problem with the user own data... can you check ...

regards,

  • Dj

reward for all useful answers.

5 REPLIES 5

Former Member
0 Kudos

Hi,

I checked the FM, its working fine. May be its problem with the user own data... can you check ...

regards,

  • Dj

reward for all useful answers.

Former Member
0 Kudos

Hello,

I think if you are having trouble with it you have two choices:

1. Insert a space after CUATROCIENTOS.

2. Try sometingh like this:

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = monto

currency = 'VEB' " --> try with other currency COP

filler = space "--->check this

language = monto_letras

IMPORTING

in_words = t_valtex

EXCEPTIONS

not_found = 1

too_large = 2

OTHERS = 3.

I think is not even necesary to use the currency. it will work fine

BYE

Gabriel

Message was edited by:

Gabriel Fernando Pulido V.

Message was edited by:

Gabriel Fernando Pulido V.

0 Kudos

Hi Gabriel

For first choice, wich command should I use, because I'm trying with 'REPLACE' but not work, gracias.

Regards,

Tokio

Hola Gabriel

Para la primera opción, cuál comando debería utilizar, porque estoy intentando con “REPLACE” pero no me funciona, gracias.

Saludos,

Tokio

0 Kudos

Hello,

Sorry the delay, but it was a good idea....

Hola,

Que pena la demora....muy buena idea....

Chao

Gabriel

former_member184029
Participant
0 Kudos

Thanks to all

I've solved this problem modifying text on standard table T015Z for record I needed.

Tokio