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

JPY Currency

Former Member
0 Likes
2,718

Hello to all,

Just want to ask for a little help.

We have this Payment Data Download program in SAP. The program gets the data from reguh and regup tables. The amount generated is 5,220,160.00. But the amount should be 522,016.000 as reflected in transaction S_P99_41000099.

I cannot figure out why this thing happens.. Please advise me how to check..

Thank you very much.

April

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,255

Hello everyone!

Thank you so much for the prompt reply Truly I was overwhelmed.. I would try all your advises and inform you the result..

By the way, I already checked tcode OY01. The decimal format for country PH (Philippines) is 1.234.567,89 and for SU01 default setting is 1,234,567.89.

The program is customized. It writes the output by using the command 'CONCATENATE' so I think adding 'CURRENCY' won't work.

I don't see an option for a Fixed point arithmetic. How will I check for that? please advise..

I haven't tried using the function modules G_DECIMAL_PLACES_GET or TCURX_READ. I'll try if it'll work.

Friends, thanks so much for your advises. I will inform you of the progress.

Thank you so much..

P.S Assigning points is all I can do to thank you..

But your time and help is truly appreciated..

April

Hello to all,

Just want to ask for a little help.

We have this Payment Data Download program in SAP. The program gets the data from reguh and regup tables. The amount generated is 5,220,160.00. But the amount should be 522,016.000 as reflected in transaction S_P99_41000099.

I cannot figure out why this thing happens.. Please advise me how to check..

Thank you very much.

April

11 REPLIES 11
Read only

Former Member
0 Likes
2,255

Check if the program attributes has the check box for Fixed Point arithmetic checked or not.

Regards,

ravi

Read only

0 Likes
2,255

You are using currency fields that reference a currency code. Most currencies in SAP have two decimal places. Dividing by 100 will work in most cases. Ideally you should get the CURRDEC value in table TCURX for the currency you are working with... then divide by 10 that number of times.

example-

USD, 2 decimals, divide by 10 twice.

used function modules G_DECIMAL_PLACES_GET or TCURX_READ

Read only

vinod_gunaware2
Active Contributor
0 Likes
2,255

Setting the User Decimals Format

Your screen and layout sets decimals are affected by :-

<b>OY01</b> - Country Global Parameters -> Double click on the country code

<b>SU01</b> - Maintain users -> Click Defaultsbutton

<b>user profile->own data->defaults decimal notations</b>

In the Decimal format section.

regards

vinod

Read only

Former Member
0 Likes
2,255

Hi,

can u tell whether ur SAP program is custom or standard one.

If it is custom you need to read the currency key in final output table.

For example.

loop at itab.

clear bkpf_it.

read table bkpf_it with key bukrs = itab-bukrs

belnr = itab-belnr

gjahr = itab-gjahr

binary search.

write:/ itab-bukrs,

itab-belnr,

itab-gjahr,

itab-buzei,

itab-waers,

itab-wrbtr currency bkpf_it-waers.

endloop.

look at the above example you will get the correct result.

Thanks.

If this helps you reward with points.

Read only

Former Member
0 Likes
2,256

Hello everyone!

Thank you so much for the prompt reply Truly I was overwhelmed.. I would try all your advises and inform you the result..

By the way, I already checked tcode OY01. The decimal format for country PH (Philippines) is 1.234.567,89 and for SU01 default setting is 1,234,567.89.

The program is customized. It writes the output by using the command 'CONCATENATE' so I think adding 'CURRENCY' won't work.

I don't see an option for a Fixed point arithmetic. How will I check for that? please advise..

I haven't tried using the function modules G_DECIMAL_PLACES_GET or TCURX_READ. I'll try if it'll work.

Friends, thanks so much for your advises. I will inform you of the progress.

Thank you so much..

P.S Assigning points is all I can do to thank you..

But your time and help is truly appreciated..

April

Read only

0 Likes
2,255

HI April,

You can check the Fixed Point Arithmetic in the Program attributes you have check Box at the bottom of the attributes screen besides to Unicode Check Box.

Thanks & Regards,

YJR.

Read only

0 Likes
2,255

Hi April,

The best option here is to write using WRITE statement and adding the currency.

So WRITE ITAB-HWAER to W_OUTPUT-HWAER CURRENCY ITAB-WAERS.

where WAERS is JPY. If the JPY currency is correctly maintained in your system, it should display the output in the your user format

So if amt is 100.33 & your decimal seperator is a ',' & currency is JPY, then it will show 10,033 (note - , is your decimal seperator in SU01).

Make user W_OUTPUT-HWAER is a Char field. Using write statement will automatically take care of any user format.

Read only

0 Likes
2,255

Arpil,

Your issue is with the way your currency is written out. When you write the currency value without using the currency key (which I think is JPY as your subject suggest), system will default the number of decimal places to be 2 whereas for JPY it is zero decimals. So, you need to change that code which does the concatenate. Whatever the currency value field that is used here in the concatenate statement, please check the code as to how that one is filled.

Read only

0 Likes
2,255

Something like this

WRITE table-currency_value TO my_char_currency_field CURRENCY 'JPY'.
CONCATENATE my_char_currency_field
            field1
            field2
              ...
              ...
            fieldz
       INTO target SEPARATED BY SPACE.

Read only

0 Likes
2,255

Hi Srinivas,

I am getting error in the payslip showing as 12,345.67 JPY instead of 1,234,567 JPY how to solve this issue

Surya

Read only

Former Member
0 Likes
2,255

Hello everyone!

Thank you so much for all the help.My problem is now ok.

I used the code given by Srinivas. Thanks so much!

Finally, the issue is now closed. My deepest thanks to all of you.

Sincerely,

April

P.S. Thanks Srinivas for the detailed code

Thank you very much.