Skip to Content
avatar image
Former Member

BI-IP Calculation from one row to other rows based on a value in the first row

Hi Planning Experts,

We have a situation as below. data from real time planning cube. The output needed on Analysis for office.

material plant group level unit qty qty 07/2017 08/2017....................08/2018

FP1 PL01 ZFLP 10 0 50 4 4 .... 5

101 PL01 HLB 11 2 100 8 8 10

102 PL01 HLB 12 3 150 12 12 15

.....

FP2 PL01 ZFLP 20 0 120 9 9 8

101 PL02 HLB 21 3 360 27 27 24

102 PL02 HLB 22 5 600 45 45 40

The materials FP1, FP2 etc. are at higher level and a kind of non-merchandise items and the materials below them are their components an are merchandise items. The quantities of the components are the multiples of the quantities of the higher level material in each forecast months.

Same material can come from different plants.All are available on one real time cube.

The materials are like BOM but they are not set up like BOM.

Can you please provide some input how to achieve this?

Thanks.

Sheokumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 24, 2017 at 12:52 PM

    Hi,

    Use FOX formula to achieve your requirement.

    Regards,

    Anand

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 24, 2017 at 04:23 PM

    Hi Anand,

    Thank you very much for answer but I have the problem with reading the records. The items identified by group. header has a different group. Once I use the group in the filter, I can get the require record and did the manipulation. That is working. I also store the qty of header record in global variable. But how to read the component records.

    We also have to get the sales order qty to for group item. So calling a function module. Here is my code. Material type has to be restricted to one entry get it work.

    DATA S_CMON TYPE 0CALMONTH.DATA T_CMON TYPE 0CALMONTH.DATA S_MTART TYPE ZCPDMTYPE.DATA S_FPOID TYPE /CPD/FPOID.DATA ZBW_FPOID TYPE /CPD/FPOID.DATA S_MPKEY TYPE ZCPDMPKEY.*DATA T_MPKEY TYPE ZCPDMPKEY.DATA T_QTY TYPE F.DATA L_CNTM TYPE I.DATA L_INDX TYPE I.DATA N TYPE I.DATA L_QTY TYPE F.DATA C_QTY TYPE F.DATA R_QTY TYPE I.DATA S_ORDQTY TYPE F.DATA S_MATERIAL TYPE /CPD/MATERIAL.DATA S_PLANT TYPE /CPD/PLANT.
    BREAK-POINT.

    S_FPOID = VARV(/CPD/F_V13).*T_MPKEY = VARV(ZVSELBID).
    *S_CMON = VARV(0CMONTH).
    S_CMON = VARV(CPD_START_CALMONTH).
    S_MTART = VARV(ZV_MTART).
    L_CNTM = VARC(CPD_AVR_CALMONTH).
    CALL FUNCTION 'ZBWIP_GET_CURRENT_BID'EXPORTING
    ZBW_FPOID = S_FPOID* ZBW_MATERIAL = S_MATERIAL
    ZBW_MATERIAL = 'FP-1X1'* ZBW_PLANT = S_PLANT
    ZBW_PLANT = 'CA01'IMPORTING
    ZBW_CURR_BID = S_MPKEY
    ZBW_ORDQTY = S_ORDQTY.

    T_QTY = {/CPD/FQTY,S_CMON} - S_ORDQTY.
    C_QTY = T_QTY.
    N = T_QTY MOD L_CNTM.
    R_QTY = 0.*IF T_MPKEY = S_MPKEY.*FOREACH S_KFNAM.
    L_INDX = 1.WHILE L_INDX <= L_CNTM.
    T_CMON = VARI(CPD_AVR_CALMONTH,L_INDX).
    *R_QTY = ({/CPD/FQTY,S_CMON} - S_ORDQTY) / L_CNTM.
    R_QTY = T_QTY / L_CNTM.IF N <> 0.
    N = N - 1.
    R_QTY = R_QTY + 1.ENDIF.
    {ZCPDQTY,T_CMON} = R_QTY.
    L_INDX = L_INDX + 1.
    T_QTY = T_QTY - R_QTY.ENDWHILE.

    Now the material type of other items are different.

    I am able to get the quantity of header which is in different field but I am unable to get the unit quantities of line items.

    How to read the other items with unit qty?

    Can you please help with the code?

    Thanks in advance.

    Sheo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 27, 2017 at 03:01 PM

    Hi Anand,

    The problem was fixed with fox code.

    Thanks.

    Sheo

    Add comment
    10|10000 characters needed characters exceeded