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

Currency

Former Member
0 Likes
988

Hi all,

I want to get the netprice of a Purchase order item.

So, I have used the below select-query.

select netpr

from ekpo

into table gi_netpr

where ....

For one PO item I got value as 1.249,97.

But, when I see the netprice of a PO in ME22n tcode,

I see the value as 124.97 and currency is 'BEF'.

How to solve this ?

Thanks in advance.

Vishnu Priya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
958

Hi

See table TCURX, here you can see the hit:

BEF -->CURRDEC = 0

It means the BEF currency doesn't use the decimal part, so the system <b>multiplies the amount for 100 when the amount has to be displayed</b> and, of course, <b>it divedes it for 100 when amount has to be stored</b> in database.

Try this piece of code:

data: netpr type netpr value '1249.97'.

write netpr currency 'BEF'.

So when you have to display an amount u have to use the currency too:

WRITE <AMOUNT> CURRENCY <CURRENCY>.

Max

Hi

See table TCURX, here you can see the hit:

BEF -->CURRDEC = 0

It means the BEF currency doesn't use the decimal part, so the system <b>multiplies the amount for 100 when the amount has to be displayed</b> and, of course, <b>it divedes it for 100 when amount has to be stored</b> in database.

Try this piece of code:

data: netpr type netpr value '1249.97'.

write netpr currency 'BEF'.

So when you have to display an amount u have to use the currency too:

WRITE <AMOUNT> CURRENCY <CURRENCY>.

Max

6 REPLIES 6
Read only

Former Member
0 Likes
958

Hi,

Please check own data under Menu:

(Sap Initial screen)

System->User Profile -> Own data

here click on defaults tab and check decimal notation.

this could be the reason why you are seeing the amounts differently.

Rgds,

HR

Read only

Former Member
0 Likes
958

Hi.

Try this.

-


1.249,97 is inner value.

change it use:

write gi_netpr-netpr to xxx currency 'BEF'

Read only

Former Member
0 Likes
958

Hello Vishnu Priya,

After getting the data into the itab.

Do the following.

DATA: begin of itab1 occurs 0,

L_F_NETWR(21) TYPE C,

end of itab1.

loop at itab.

WRITE: ITAB-NETWR TO ITAB1-L_F_NETWR.

append itab1.

clear itab1.

endloop.

If useful reward.

Vasanth

Read only

Former Member
0 Likes
958

Also see if the Check Box for Fixed Point arithmetic is chosed in your program Attributes section.

Regards,

Ravi

Read only

Former Member
0 Likes
959

Hi

See table TCURX, here you can see the hit:

BEF -->CURRDEC = 0

It means the BEF currency doesn't use the decimal part, so the system <b>multiplies the amount for 100 when the amount has to be displayed</b> and, of course, <b>it divedes it for 100 when amount has to be stored</b> in database.

Try this piece of code:

data: netpr type netpr value '1249.97'.

write netpr currency 'BEF'.

So when you have to display an amount u have to use the currency too:

WRITE <AMOUNT> CURRENCY <CURRENCY>.

Max

Read only

Former Member
0 Likes
958

Vishnu

Along with your write statement use the addition of CURRENCY and the three digit ID along with that. You will get your desired output

Shane