cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal separator as DOT

Former Member
0 Kudos

Hi Friends,

We are facing an issue with invoice forms where the decimal separator comes as ' , ' (COMMA)instead as ' . '(DOT).

We can't change the country level settings in this scenario as its not being accepted by the customer.We have tried settiing incorrect country(for eg X) with the correct country(for eg Y) based on a condition. This works fine but there is a danger of it inheriting other values as well from correct countr (Y) like Procedure,Exch.rate type,Intrastat code etc

Could you please suggest solution to this issue.

Many thanks,

Rajiv

Accepted Solutions (0)

Answers (2)

Answers (2)

birendra_chatterjee
Active Participant
0 Kudos

Hi,

Decimal Separators are user-specific data, and varies from user to user. You can to manipulate this in your code as below:

VALUE_CHAR = VALUE. "move the amount variable to character variable

SELECT SINGLE DCPFM INTO W_DCPFM FROM USR01 WHERE BNAME EQ SY-UNAME.

CASE W_DCPFM.

WHEN 'X'. "Format 1,234,567.89

REPLACE ALL OCCURRENCES OF ',' in VALUE_CHAR WITH space.

CONDENSE VALUE_CHAR NO-GAPS.

MOVE VALUE_CHAR to VALUE.

WHEN 'Y'. "Format 1 234 567,89

REPLACE ALL OCCURRENCES OF ',' in VALUE_CHAR WITH '.'.

CONDENSE VALUE_CHAR NO-GAPS.

MOVE VALUE_CHAR to VALUE.

WHEN OTHERS. "Format 1.234.567,89

REPLACE ALL OCCURRENCES OF '.' in VALUE_CHAR WITH space.

REPLACE ALL OCCURRENCES OF ',' in VALUE_CHAR WITH '.'.

CONDENSE VALUE_CHAR NO-GAPS.

MOVE VALUE_CHAR to VALUE.

ENDCASE.

Regards,

Birendra

Former Member
0 Kudos

Its a smartform