This website is not affiliated with, sponsored by, or approved by SAP AG.

About Japanese Yen

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

About Japanese Yen

Postby Bebop » Fri Jul 04, 2014 9:03 am

Hi gang,

I'm about to upload prices from an excel sheet. Now, as for JPY a price of 500 comes in from Excel as 500.00 (or 500,00 depending on your settings). SAP doesn't like that as JPY doesn't know any decimals. (as defined in TCURX)

So I tried to do:

Code: Select all
WRITE i_kbetr TO l_kbetr CURRENCY i_waers.
(with i_kbetr type kbetr and l_kbetry type char)

Now the decimals are gone, but the amount is multipled by 100. 500.00 (five hundred) turns into 50000. But the user who enters 500 into the excel sheet *means* 500 and *not* 50000.
Of course I could do something like

Code: Select all
IF i_waers = 'JPY'.
  l_kbetr = i_kbetr.
* somehow cut off the decimal point and decimals by string operations from  l_kbetr
ENDIF.


But this looks very ugly. Isn't there a better way to do it ? I mean, I can't be the only one in the world with this issue.

Any hint appreciated !

Thanks a lot
Frank
Bebop
 
Posts: 79
Joined: Mon Jun 06, 2011 9:13 am

Re: About Japanese Yen

Postby Grogan » Sun Jul 06, 2014 4:52 pm

Its because of the way SAP stores currency amounts.

Here is what the ABAP online help has to say about the WRITE ... CURRENCY statement:
In the case of data objects of type p, the decimal places defined in the definition of the data type are ignored completely. Irrespective of the actual value and without rounding actions, the decimal separators and the thousand separators are inserted at the positions in the numbers determined by cur.


For a further discussion, see here:
http://www.newtosap.info/2014/01/handling-currencies-having-zero.html

I suggest you call CURRENCY_AMOUNT_BAPI_TO_SAP on your currency amounts immediately after importing so that they are stored correctly.
Grogan

Award cash if useful.
Grogan
 
Posts: 365
Joined: Thu Aug 04, 2005 7:16 pm
Location: Australia

Re: About Japanese Yen

Postby Bebop » Mon Jul 07, 2014 8:03 am

Thanks a lot for your reply. I just realized that the problem is just that the price comes out of Excel with 2 decimals just as a matter of conversion. So, the whole point literally is to cut off those decimals.

Thanks !
Frank
Bebop
 
Posts: 79
Joined: Mon Jun 06, 2011 9:13 am


Return to ABAP

Who is online

Users browsing this forum: No registered users and 9 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.