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: 

Number format conversion

Former Member
0 Kudos

Hi Experts,

In one of my script output I have to show the number in the format XX.XXX,XXX? How to convert the value XXXXX.XXX to XX.XXX,XXX? Is there any function module to achieve this logic?

Say for eg: 15000.000 to 15.000,000. Kindly provide your valuable suggestions.

Thanks

K Arasu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In case u are facing issue in curreny amount.

Please try like below:

WRITE VBAP-NETPR CURRENCY VBAP-WAERK TO l_var.

Hope it helps.

Praveen

7 REPLIES 7

former_member156446
Active Contributor
0 Kudos

Hi I guess you are woking on script which will be used in Europe... for that use the key word set country and the decimal places and the comma's will be taken care autmatically...

Former Member
0 Kudos

Hi,

In case u are facing issue in curreny amount.

Please try like below:

WRITE VBAP-NETPR CURRENCY VBAP-WAERK TO l_var.

Hope it helps.

Praveen

Former Member
0 Kudos

Hi,

go thriugh this link and declare in that way..

http://help.sap.com/erp2005_ehp_04/helpdata/EN/d1/8034fb454211d189710000e8322d00/frameset.htm

or else...do like this...

Use the I option to suppress the output of symbols that still contain their initial values.

Syntax

&symbol(I)&

Assuming KNA1-UMSAT contains the value 0 and the currency is DEM.

&KNA1-UMSAT& -> 0,00

&KNA1-UMSAT(I)& ->

If the field contains an amount other than 0, this value is printed in the normal way.

&KNA1-UMSAT& -> 700,00

&KNA1-UMSAT(I)& -> 700,00

Regards

Kiran

Former Member
0 Kudos

Hi,

Check below FMs.

AIPH_GET_TEXT_CURRENCY

ISM_WWW_TEXT_FORMAT_CONVERT

CSO_O_TEXTS_RENUMBER

Regards

Md.MahaboobKhan

Former Member
0 Kudos

hi,

Omitting the Separator for 'Thousands'

Symbols of the DEC, CURR, INT, and QUAN data types are normally formatted with the a 'thousands' separator character. The T option allows you to omit this separator character.

Syntax:

&symbol(T)&

The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.

for ex.,

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(T)& -> 1234.560

Former Member
0 Kudos

hi For check this samplw code for check printing,

.
FORM SAPFICURR TABLES T_WA_IN STRUCTURE ITCSY

T_WA_OUT STRUCTURE ITCSY.

DATA :NUM1(17) TYPE C ,

FLD LIKE USR01-DCPFM. ".

READ TABLE T_WA_IN INDEX 1.

NUM1 = T_WA_IN-VALUE.

*SELECT SINGLE DCPFM FROM USR01 INTO FLD WHERE BNAME = SY-UNAME.

SELECT SINGLE XDEZP FROM T005X INTO FLD WHERE LAND = 'IN'.



* * If comma is used for decimal separator "e.g. 1.500.010,009

IF FLD EQ SPACE.

TRANSLATE T_WA_IN-VALUE USING '.,,.'. "itl_in

ELSEIF FLD EQ 'y'.

TRANSLATE T_WA_IN-VALUE USING ' ,,.'. "itl_in

ELSEIF FLD EQ 'X'.

TRANSLATE T_WA_IN-VALUE USING ',.., '. "itl_in

ENDIF.



NUM1 = T_WA_IN-VALUE.

READ TABLE T_WA_OUT INDEX 1.

T_WA_OUT-VALUE = NUM1.

MODIFY T_WA_OUT INDEX 1.
..

ENDFORM. "SAPFICURR

Former Member
0 Kudos

and make perform like this above code.


PERFORM SAPFICURR IN PROGRAM ZIBRSPFI_CNVT_WORD
USING &REGUH-RBETR&
CHANGING &NUM1&
ENDPERFORMpar	&NUM1&