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

Problem in PO (ME23n Tcode)

Former Member
0 Likes
1,034

In ME23n Tcode when I execute it for Japanese currency(yen) I get the value without decimal point but in table it is stored with decimal point. So there is mismatch between value shown by me23n & values shown in print preview for the same.

This is happening only for Japanese currency.

Please help me to solve this issue.

Thanksn advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
920

You need to use the CURRENCY additions. To understand the difference, execute below code with the PO and check the results.

PARAMETERS: p_ebeln TYPE ebeln OBLIGATORY.

DATA: l_netwr TYPE netwr.

SELECT SINGLE netwr INTO l_netwr FROM ekpo
   WHERE ebeln = p_ebeln.
WRITE:/ l_netwr.
WRITE:/ l_netwr CURRENCY 'JPY'.

4 REPLIES 4
Read only

Former Member
0 Likes
921

You need to use the CURRENCY additions. To understand the difference, execute below code with the PO and check the results.

PARAMETERS: p_ebeln TYPE ebeln OBLIGATORY.

DATA: l_netwr TYPE netwr.

SELECT SINGLE netwr INTO l_netwr FROM ekpo
   WHERE ebeln = p_ebeln.
WRITE:/ l_netwr.
WRITE:/ l_netwr CURRENCY 'JPY'.

Read only

0 Likes
920

>

> > You need to use the CURRENCY additions. > To understand the difference, execute below code with the PO and check the results. >

PARAMETERS: p_ebeln TYPE ebeln OBLIGATORY.
> 
> DATA: l_netwr TYPE netwr.
> 
> SELECT SINGLE netwr INTO l_netwr FROM ekpo
>    WHERE ebeln = p_ebeln.
> WRITE:/ l_netwr.
> WRITE:/ l_netwr CURRENCY 'JPY'.
> > Kind Regards > Eswar >

>

> > You need to use the CURRENCY additions. > To understand the difference, execute below code with the PO and check the results. >

PARAMETERS: p_ebeln TYPE ebeln OBLIGATORY.
> 
> DATA: l_netwr TYPE netwr.
> 
> SELECT SINGLE netwr INTO l_netwr FROM ekpo
>    WHERE ebeln = p_ebeln.
> WRITE:/ l_netwr.
> WRITE:/ l_netwr CURRENCY 'JPY'.
> > Kind Regards > Eswar >

Thanks a lot for your reply.

But what i want to know is that in EKPO table entry is

e. g. 59814.47 JPY

then display of me23n should show this but it is showing

5,981,447

Also in print it correct i. e., 59814.47 Jpy.

Also like INR has paise, how jpy cent is displayed

Read only

0 Likes
920

Hi Abhijit,

The reason for this is quite simple. SAP stores all the amount fields in 2 decimal places. But the actual value of the amount is interpretted using the currency associated with the amount field.

In JPY currency, the amount will have no decimal places whereas USD/INR will amount will 2 decimal places.

The below code will illustrate how the amount values are interpreted in SAP.



"Suppose amount_internal is the amount stored in SAP.

    SELECT SINGLE * FROM  tcurx
                    INTO  struct_tcurx
                    WHERE currkey = currency.
    IF sy-subrc = 0. "Currency has a number of decimals not equal two
      int_shift = 2 - struct_tcurx-currdec.
    ELSE. "Currency is no exceptional currency. It has two decimals
      int_shift = 0.
    ENDIF.
  ELSE.
    int_shift = last_int_shift.
  ENDIF.

"*Fill AMOUNT_EXTERNAL and shift decimal point depending on CURRENCY
  MOVE amount_internal TO dec_amount_int.
  amount_external = 10 ** int_shift.
  amount_external = amount_external * dec_amount_int.

"And amount_external will be value SAP interprets the amount_internal based on 
"currency.

Hope this helps.

Thanks,

Balaji

Read only

0 Likes
920

Hi, Few Currencies like Japanese Yen, Indonesian Rupiah doesnt have cents i.e no decimals. So what you are able to see in PO is the right one. Table is just a storage medium. As far as your print program it is currently displaying wrong as no conversion taken place. Check this info from SAP:

In the R/3 System tables currency fields are stored as decimal figures 
with a variable number of decimal places. The decimal point is not 
stored in the field in the database. Instead, each currency field refers 
to a currency key field. 
For few currencies like Kuwait Dinar it might have 3 decimals, at the table level it is visible as 2 decimals. Only when you use the currency addition it displays in the actual format for the country. Remember it as a rule: For all Currency fields the reference should be used for displaying in actual notation.