cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO CONVERT 120.345,78 FORMAT IN SAPSCRIPT TO 120,345.78

Former Member
0 Kudos

i am trying last two days,pls help me for this solution.

HOW TO CONVERT 120.345,78 FORMAT IN SAPSCRIPT TO 120,345.78

thanks

ramu

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

Change your user profile

Goto System->User Profile->Own Data.

There in Defaults tab

For Decimal Notation selection one you want.

Regards,

Sesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi just write this code in external subroutine definitely u will get

IF sy-subrc = 0.

READ TABLE outtab INDEX 1.

outtab-value = v_name1.

MODIFY outtab INDEX 1.

CLEAR outtab.

ENDIF.

READ TABLE intab WITH KEY name = 'REGUH-RBETR'.

IF sy-subrc EQ 0.

wrk_dmbtr = intab-value.

REPLACE ALL OCCURRENCES OF '.' IN wrk_dmbtr WITH ''.

REPLACE ALL OCCURRENCES OF ',' IN wrk_dmbtr WITH '.'.

CONDENSE wrk_dmbtr.

MOVE wrk_dmbtr TO outtab-value.

MODIFY outtab TRANSPORTING value WHERE name = 'CURR'.

ENDIF.

Former Member
0 Kudos

Hi

Try with this

<b>Number of Decimal Places</b>

A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.

Syntax

&symbol(.N)&

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

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(.1) -> 1,234.6

&EKPO-MENGE&(.4) -> 1,234.5600

&EKPO-MENGE&(.0) -> 1,235

<b>Omitting the Separator for ‘Thousands’</b> 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.

&EKPO-MENGE& -> 1,234.560

&EKPO-MENGE(T)& -> 1234.560

If it doesnt work then check your user profile and change your settings from there it will solve your problem

Reward all helpfull answers

REgards

Pavan

Former Member
0 Kudos

Hi,

I think that this would be coming from your user options.

Click system, user profile, own data. Click defaults tab. Under decimal notation, choose the appropriate one.

If you need to hardcode this format in the SAPscript, we will have to take a different approach.

<b>Reward points</b>

Regards

former_member196280
Active Contributor
0 Kudos

If character field holding 120.345,78 try this. it will solve your problem

Ex.

REPLACE '.' with ',' into char1.

write Char1 to char1 right-justified.

if char1+13(1) = ','.

char1+13(1) = '.'.

endif.

<b>Don't forget to reward points.</b>

SaiRam