Exchage rate * 0NET_VALUE = Negative value !

Question: Dear all,

I am uploading data from R/3 trought 2LIS_11_VAITM to Infocube ZCUBE.
As I want to get sales order amounts in local currency (EUR), I am uploading 3 key figures on the ZCUBE:
1. 0NET_PRICE (amount in document currency)
2. 0EXCHG_RATE (exchange rate)
3. 0AMOUNT (fórmula > amount in local currency)
On the update rule, I am doing the following formula for 0AMOUNT
0AMOUNT = 0EXCHG_RATE * 0NET_PRICE

I get a 0AMOUNT negative value (0NET_PRICE is positive value) on my cube and on a query. I should get a positive value for 0AMOUNT.
Can someone help on this?

Thanks

Answer:
check how the exchange rate comes in... you may need to "convert" it in the transfer rules

cheers,

El Belgio

Answer:
Hello,

The 0EXCHG_RATE - exchange rate comes from the R/3 field VBKD-KURSK.
This value appears in BW as a negative value. In R/3 it stands with a leading "/" (e.g., "/0,93210") but its not negative.
Is this "/" causing me this trouble?

What can I do?

Thanks
Regards

Answer:
It might be that the "/" that is bothering you
Check the extraction process via RSA3 and try to find out whether it always sends a minus sign with the exchange rate. If so, then just take the "absolute value" in the transfer rules or multiply by -1

cheers,

El Belgio

Answer:
It cames allways with negative values except when doc currency equals to local currency > exchange rate equals to 1.

So, I either get 1,000 or negative values.
Multiply by -1 its not good idea.
To use Absolute values was my idea as well but I was looking for that in update rules formula and I was not able to find it. How can I use Absolute in upadate rules?

Thanks again

Answer:
use an ABAP routine: the absolute value is really easy...

RESULT = ABS(0EXCHG_RATE).

cheers,

El Belgio

Answer:
1. 0NET_PRICE (amount in document currency)
2. 0EXCHG_RATE (exchange rate)
3. 0AMOUNT (fórmula > amount in local currency)

If you have 0net_price and 0amount, I assume you also have the corresponding objects for the currency of the amounts, let's say 0currency for 0net_price and 0stat_currency for 0amount.

If this is the case, when you are creating the update rules to assign 0net_price to 0amount, you should receive an additional box in the tab "key fig calculation", that allows you to use the standard way to translate the currency; there you can use a translation key defined to received its rate from the infoobject 0exchg_rate, its origin currency from the record and you can fixet the target currency

so that you avoid to deal yourself with coding the translation

if you still encounter problems with this value beginning with "/", you should then check why the source system provides you with a wrong entry

( this posting was just to state that there is a standard solution, while I know we often prefer to code our own routine when it is so easy)
Ch
_________________
_
There are only 10 types of people in the world :
those who understand binary and those who don't.

Answer:
I know very litle about ABAP and I have no BASIS guys around.

My routine stands like this:
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal table "MONITOR", to make monitor entries

* result value of the routine
RESULT = ABS(0EXCHG_RATE).
* if the returncode is not equal zero, the result will not be updated
*RETURNCODE = 0.
* if abort is not equal zero, the update process will be canceled
*ABORT = 0.

*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.

When I check the system gives the following error:
E:Field "ABS" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.

I am sure I am doing a not very cleaver one about ABS !!! ((
Can you help me on this?

thanks

Answer:
* result value of the routine
RESULT = ABS(0EXCHG_RATE).


try this in stead

* result value of the routine
RESULT = ABS( 0EXCHG_RATE ).

spaces can do nice things in ABAP/4

cheers,

El Belgio

PS when using a "keyword" in ABAP, you can always ask documentation on it by positioning your cursor on it and hitting the F1 button
Copyright ?2007 - 2008 www.jt77.com