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

Fuction Module

Former Member
0 Likes
1,151

Hi,

Is there any functional module to convert char number to currency text like below example.

x = 12345678.00 change to 12,345,678.00

Regards

5 REPLIES 5
Read only

Former Member
0 Likes
1,073

Hi,

Use FM HRCM_STRING_TO_AMOUNT_CONVERT

pass the char(amount) and decimal separator, thousand separator.

you get the char converted to amount/currency.

Regards,

Satish

Read only

0 Likes
1,073

Hi Satish,

I used the function module but it is giving the same value what i passed in the string. can you kindly tell how to use this function module or is there any other function module which ll change da value from 211881.00 to 211,881.00.

regards

Ram

Read only

0 Likes
1,073

hi,

here are few function modules related to currency:

CURRENCY_AMOUNT_SAP_TO_IDOC - Convert currency to IDOC format

CONVERT_TO_LOCAL_CURRENCY - Conversion of currency

CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all

character fields), not right justifed as numbers normally are.

CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

Example 1: Convert amount to/from string

Amount to string:

CALL FUNCTION 'HRCM_AMOUNT_TO_STRING_CONVERT'

EXPORTING

betrg = 3000

WAERS = 'DKK'

  • NEW_DECIMAL_SEPARATOR =

  • NEW_THOUSANDS_SEPARATOR =

IMPORTING

STRING = slam

.

String to amount:

CALL FUNCTION 'HRCM_STRING_TO_AMOUNT_CONVERT'

EXPORTING

string = slam2

DECIMAL_SEPARATOR = '.'

  • THOUSANDS_SEPARATOR =

WAERS = 'HUF'

IMPORTING

BETRG = b2

  • EXCEPTIONS

  • CONVERT_ERROR = 1

  • OTHERS = 2

plz reward if useful..

Read only

Former Member
0 Likes
1,073

You can use the FM ISM_CONVERT_CHAR_TO_CURR or BAPI BAPI_CURRENCY_CONV_TO_INTERNAL.

Read only

Former Member
0 Likes
1,073

Hi,

U can use this code

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING DATE = BKPF-WWERT

FOREIGN_CURRENCY = BKPF-WAERS

LOCAL_CURRENCY = T001-WAERS

FOREIGN_AMOUNT = BSEG-WRBTR

RATE = BKPF-KURSF

TYPE_OF_RATE = 'M'

IMPORTING EXCHANGE_RATE = KURS

LOCAL_AMOUNT = BSEG-DMBTR

FOREIGN_FACTOR = FAKTOR-F

LOCAL_FACTOR = FAKTOR-L

FIXED_RATE = FIXKURS

EXCEPTIONS NO_RATE_FOUND = 4

NO_FACTORS_FOUND = 8.

Plzz reward points if it helps.