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

functional module amount_string_convert

Former Member
0 Likes
1,082

hi to all

plz help me in this issue

i am using this function module for decimal seperator it is working fine for EUR currency but when other currencies like NL,ISK etc comes it is raising an exeption 203 .plz help me in in sloving this issue

hi sailatha this is the code

IF L_CURR EQ 'EUR'.

CALL FUNCTION 'AMOUNT_STRING_CONVERT'

EXPORTING

AMOUNT_STRING = AMOUNT

DCPFM = '2'

  • MLLN = 'M'

  • TSND = 'T'

WAERS = L_CURR

IMPORTING

AMOUNT = L_VALUE.

  • EXCEPTIONS

  • INVALID_TYPE = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ELSE.

  • END OF INSERTION BY NTT 13-07-2006

CALL FUNCTION 'AMOUNT_STRING_CONVERT'

EXPORTING

AMOUNT_STRING = AMOUNT

DCPFM = '0'

  • MLLN = 'M'

  • TSND = 'T'

WAERS = CURR

IMPORTING

AMOUNT = L_VALUE.

  • EXCEPTIONS

  • INVALID_TYPE = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

Thanks & Regards

Kiran kumar

Message was edited by: kiran kumar

4 REPLIES 4
Read only

Former Member
0 Likes
832

Hi,

Can you post your code",

Rgds,

Read only

0 Likes
832

use.

<b>HRCM_AMOUNT_TO_STRING_CONVERT</b>

Read only

Former Member
0 Likes
832

check this function module( i copied from one of the SDN post, but doesnt remember the link)

REPORT YTEST no standard page heading .

data : tline like tline occurs 0 with header line,

SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.

data amouno type p DECIMALS 5 value '5455555.65461'.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = amouno

CURRENCY = 'USD'

  • FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3

.

WRITE : / 'Amount in Number: ',AMOUNO.

WRITE : / 'Amount in Word: ',SPELL-WORD, 'AND DECIMALS' , SPELL-DECWORD.

Result

*********************************************

Amount in Number: 5,455,555.65461

Amount in Word:

FIVE BILLIONS FOUR HUNDRED FIFTY-FIVE MILLION FIVE HUNDRED FIFTY-FIVE THOUSAND SIX HUNDRED FIFTY-FOUR

AND DECIMALS SIXTY-ONE

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
832

Hi,

You can use the FM <b>HRCM_AMOUNT_TO_STRING_CONVERT</b>.

Regards

vijay