on 05-23-2018 9:39 AM
Dear Experts,
I have a requirement to calculate revenue using Price and Quantity for each material,month,sales org combination using FOX formula.
Problem is that price and quantity will be in different rows in the cube.
A new record with version C has to be created with a row for each combination also populated with Price, quantity and revenue.
Could you please advise how this can be achieved.
What have you tried so far?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Do my job" question 🙂
Hi Lucas,
Thanks for your response 🙂
I got it done trying in different ways in FOX. Below is the code i wrote and it worked.
Please review and advise if i can improve it.
CODE:
DATA CMONTH TYPE 0CALMONTH.
DATA CURRY TYPE 0CURRENCY.
DATA L_CURRY TYPE 0CURRENCY.
DATA L_UNT TYPE 0UNIT.
DATA UNT TYPE 0UNIT.
DATA VERS TYPE 0VERSION.
DATA ZVERS TYPE 0VERSION.
DATA QVERS TYPE 0VERSION.
DATA MID TYPE Z_MID.
DATA SORG TYPE Z_SORG.
DATA PRICE TYPE F.
DATA QTY TYPE F.
DATA REV TYPE F.
QVERS = 'B'.
ZVERS = 'C'.
FOREACH UNT.
IF NOT UNT IS INITIAL.
L_UNT = UNT.
FOREACH CURRY, VERS IN REFDATA.
IF NOT CURRY IS INITIAL AND VERS = 'A'.
PRICE = { Z_PRC, CURRY, #, VERS }.
QTY = { Z_QTY, #, L_UNT, QVERS }.
L_CURRY = CURRY.
{ Z_PRC, L_CURRY, L_UNT, ZVERS } = PRICE.
{ Z_QTY, L_CURRY, L_UNT, ZVERS } = QTY.
{ Z_REV, L_CURRY, L_UNT, ZVERS } = PRICE * QTY.
PRICE = 0.
QTY = 0.
ENDIF.
ENDFOR.
ENDIF.
ENDFOR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.