cancel
Showing results for 
Search instead for 
Did you mean: 

decimal format problem in sapscript

Former Member
0 Kudos

Hello All ,

In a sapscript report . the amount is being printed with the notation 'dot' as thousand separator and 'comma' as decimal separator .

But the user setting of the user for which this report is , the notation is 'comma'  as thousand separator  and dot as decimal separator .

so what could be the reason for this mismatch ?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

solved by checking tables t005x and lfa1 to get the dec format for the user .

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Again ,

if the sapscript is taking the decimal notation for the receiving country , then how it could be explicitly set to take the decimal format for the user and not of the receiving country .

Thanks

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Linda,

you can explicitly set the used format with SET COUNTRY.

Then the country-dependent formatting options from table T005X are used.

It might be possible to add a logic reading the user settings and then use this in the sapscript.

However there is no such functionality in the standard.

Best regards,

Nils Buerckel

Former Member
0 Kudos

Hi Nils,

Thanks .

Actually the requirement is to set the customer formatting and not the country . So that i think i have to do it somehow programatically .

Thanks 

former_member212913
Participant
0 Kudos

Hi Linda,

             The below code may be helpful for You,

lv_waers is the currency key and tcurx is the table which stores decimal places depending on the country.

GV_NETPR_IN_DOC_CUR should be type char.

For the below code  amount takes commas and dot from tcode: Oy01

once check dots and commas for Hong kong in Oy01

DATA ls_tcurx TYPE tcurx.

SELECT SINGLE * FROM tcurx INTO ls_tcurx

WHERE currkey = iv_waers.

IF sy-subrc = 0.

cv_flag = 'X'.

ELSE.

CLEAR cv_flag.

ENDIF.

IF NOT cv_flag IS INITIAL.

WRITE NETPR CURRENCY IS_EKKO-WAERS TO GV_NETPR_IN_DOC_CUR.

ENDIF.

former_member212913
Participant
0 Kudos

Hi

    Format for date and amount is based on country which is maintained in tcode Oy01 so check it in oy01.......

Regards,

Mahipal

former_member209818
Active Contributor
0 Kudos

Hi Linda

Check if any country settings are explicitly set inside the SAPScript. If yes, then Sript will take those country specific settings.

- Harshad

Former Member
0 Kudos

Hi Harshad,

There is no statement like set country .

Any other suggestion .

Thanks

nils_buerckel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Linda,

sapscript is using the decimal format of the receiving country, which can be found in T005-XDEZP.

This is independent of the user ...

Best regards,

Nils

Former Member
0 Kudos

Hi Nels,

Thanks . But the payment advice is for HK and the dec format i checked in t005x its dec separator 'dot' and thousand separator 'comma'.

But the output is reverse.

Thanks