Complex Custom Planning function

Hello,
I need to implement a complex custom planning function, in which certain calcualtions are to be done. Data is available in the actual cubes and calculation logic is in a table and also it requires several validations to generate plan data. For example, planning fuction is to validate whether the planning cube is already having the requested data or not for the current period, if it has the data then that slice of the data is to be deleted before the calculated data is to be written to planning cube, that means custom planning function should be able to call Delete function as part of the validation. The calculated data is written back to planning cube which is part of Plan/Actual Multiprovider on which planning modelling is defined.
Could anybody provide step by step approach to implement this kind of custom planning function would be appreciated.
Looking forward to have nice discussions on this thread.
Regards,
Ravi.

Hi Amie,
You can create a custom planning function using transaction RSPLF1. A step in creating a custom planning function is to create an ABAP class that implements the interface IF_RSPLFA_SRVTYPE_IMP_EXEC (if your function doesn't need reference data) or IF_RSPLFA_SRVTYPE_IMP_EXEC_REF if your function needs reference data.  You code selections for your reference data in method GET_REF_DATA_SEL and the actual logic of your function in the EXECUTE method.
Inside the EXECUTE method, the parameter C_T_DATA contains the data currently in your real-time cube that satisfies the Filter selections that you placed in the planning sequence (or web-analysis item data bindings). You can check C_T_DATA for the existence of previously saved data. You can delete/modify/ad entries in C_T_DATA. Any rows in C_T_DATA that you deleted in the EXECUTE method will be zeroed out/deleted from the cube. Any rows in C_T_DATA that you added/changed will be saved as well.
If you look at transaction RSPLF1, you can see the definitions of the SAP standard planning functions. You can use those definitions as your reference.
Hope this helps you get started.
Cheers.

Similar Messages

  • Error in Debugging a Custom Planning Function

    Hi All,
    I have a custom Planning function which is an ABAP code. I wanted to test the planning function and hence i set a breakpoint at the first line of the code. But when i execute the program RSPLS_PLSEQ_EXECUTE to debug my planning function, once i give the planning sequence and press F8, it gives an error instead of pointing to the breakpoint i set. Please help me out. Any pointers over this are greatly appreciated.
    Thanks
    Swaroop

    Hi Swaroop,
    take a look at RSPLS_PLSEQ_EXECUTE in transaction SE38. You will see the following line of code
    PERFORM execute_plseq  TABLES g_t_return USING seqnm variant.
    . Set a break-point here and execute the report. The debugger will stop at the above mentioned line. Press F6 to execute the statement and than double click on g_t_return. This table contains the messages. Please take a look at them. You can see the technical name of the message. To see them in a more readable format you can use transaction SE91.
    Regards Matthias Nutt
    SAP Consulting Switzerland

  • How to  pass a variable value into a custom planning function via a web

    Can some one tell me
    How to  pass a variable value into a custom planning function via a web template?
    What are the different types of Planning function parameters available and what is the difference between them?
    Thanks
    babu

    Hi Sutrtha,
    Yeah I got the pop up asking to select the variables used, I have selected ENTITY_ID that was used by the interfaces, but on execution of the package the Scenario did not work as the passeed variable #ENTITY_ID is set to 0 instead of the value I am passing.
    Am I missing something?
    Regards
    B

  • Custom Copy Planning Function in IP

    Hi all,
    I have a requirement wherein I need to copy the content of one cube to another cube based on certain conditions that are to be handled explicitly.
    I cannot use the standard copy function.
    So i need to model my own planning function to meet the requirement. Can anyone provide a template based on which I can proceed and create a custom planning function for copying the data from one cube to another cube.
    Rgds
    Syam

    Hi Shashi,
    I dont think that FOX can suit our requirement. The reason being as follows:
    I need to loop thru the contents of Cube1 so as to find out the Ratio of keyfigures for a particular Characterisitc value. This ratio needs to be used in some other cube (Cube2) for distribution.
    Eg: Cube1 :
    Characteristic : WBS Element
    Keyfigure : Amount
    I need to loop thru the cube content and finally arrive at the ratio of Amount assigned to each WBS.
    Eg:  WBS1:WBS2:WBS3 = 3:1:2
    The above ratio needs to be used in Cube2 to distribute the Amount (present at Business area level) to each of the WBS element in cube2.
    Rgds
    Shyam

  • Error when creating a planning function

    hi,
    I am creating a Planning function type using RSPLF1. Also i have created a custom class for the same. But when i try to create a planning function through RSPLAN, and using this custom planning function type, I get the following error:
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
        at java.util.Vector.get(Vector.java:733)
        at com.sap.ip.bi.plan.sb.plandialogcomps02.hlp.FromToStore2.getToList(FromToStore2.java:74)
        at com.sap.ip.bi.plan.sb.plandialogcomps02.fromto.FromToHelperComp._fillTableFromStore(FromToHelperComp.java:1422)
        at com.sap.ip.bi.plan.sb.plandialogcomps02.fromto.FromToHelperComp._loadAll(FromToHelperComp.java:1825)
        at com.sap.ip.bi.plan.sb.plandialogcomps02.fromto.FromToHelperComp.setAll(FromToHelperComp.java:388)
        ... 53 more
    Can anyone let me know what this means and what I am missing ?

    Hi,
    Generally these error come when we manually enter the value in the Visible and Input column. Instead we should try select value from the Drill down options which gets generated based on the Time Bucket Profile you have selected as input for Planning Horizon.

  • Error while executing planning function with reference data

    Hi,
    I have a two planning functions one is used to upload the file (with out reference data checkbox in planning function RSPLF1) and other planning function ('Referece data'check box is selected in custom planning function RSPLF1) to execute the logic of creating new record along with the flat file data.
    Following data is uplooaded
    Company code | Profit_ctr | calmonth | Amount
    1000                 | 50000      | 01.2011  | 150
    Cube data
    Field1    |  Company code | Profit_ctr | calmonth | Amount
             |  1000                 | 50000      | 01.2011  | 150
    Z1         |  1000                 | 50000      | 01.2011  | 150
    Now I want to change the value from 150 to 200 and when I try to execute with the following data, it is giving dump 'a row with the same key already exists'.
    Company code | Profit_ctr | calmonth | Amount
    1000             | 50000          | 01.2011  | 200
    Ideally in the second execution it should append the new row with Amount value 50 to cube which is the delta value.
    I debugged the issue and found that I_TH_REF_DATA has following data and C_TH_DATA also contains the same records.
    Field1     Company code | Profit_ctr | calmonth | Amount
    #     1000                 | 50000      | 01.2011  | 150
    Z1     1000                 | 50000      | 01.2011  | -150
    Z1     1000                 | 50000      | 01.2011  | 150
    Due to this, record which already exists in C_TH_DATA and trying to append new record with the same combination is failing.
    C_TH_DATA should only contain the source data of Amount 200, but not sure why reference data is coming in C_TH_DATA.
    Could anyone please guide me on how the reference data is getting populated in C_TH_DATA ?
    Thanks in advance
    Edited by: peppy on Aug 3, 2011 5:00 PM
    Edited by: peppy on Aug 3, 2011 8:37 PM

    Hi Peppy,
    C_TH_DATA is hashed table!  According to your post you are trying to append to C_TH_DATA and this results in a dump. Please take a look at the standard planning function to see how SAP is programming the planning functions. E.g. in CL_RSPLFC_REPOST method IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE you can find the following code:
      CREATE DATA l_r_data_wa LIKE LINE OF c_th_data.
      ASSIGN l_r_data_wa->* TO <s_data_wa>.
      CREATE DATA l_r_new_wa LIKE LINE OF c_th_data.
      ASSIGN l_r_new_wa->* TO <s_new_wa>.
    LOOP AT c_th_data INTO <s_data_wa>.
    <s_new_wa> = <s_data_wa>.
    now the SAP code changes the  values, you can do it your way here
    and than write the changes back
            MODIFY TABLE c_th_data FROM <s_data_wa>.
    ENDLOOP:
    Another option is to use the READ statement to check if the record is already in the table. If not, you can use MODIFY otherwise you use INSERT. So you get something like this:
    READ C_TH_DATA from <s_data_wa> transporting no fields.
    if not sy-subrc EQ 0.
      INSERT <s_data_wa> into table C_TH_DATA.
    else.
      MODIFY TABLE c_th_data FROM <s_data_wa>.
    endif.
    Depending on your requirements you can also use the collect  statement.
    If c_th_data shows the reference data as well, you may need to adjust the filter to restrict it to the correct values.
    Hope this helps.
    Best regards
    Matthias Nutt
    SAP Consulting Switzerland

  • How to indicate a message by a planning function type in an ABAP-OO-Class

    Hello,
    I integrated a message with following statement " MESSAGE i003(upf1) WITH v1 v2." in an ABAP-OO-Class, which is used by a Planning Function Type. The function type works but it´s not indecated after executing the Planning Sequence, neither from web template nor in the planning modeller.
    Does anybody know this problem/behavior?
    Thank for response
    Andreas

    Hi Joerg,
    how about this:
    data: l_dummy type char100.
    MESSAGE i003(upf1) WITH v1 v2  into l_dummy.
    i_r_msg->add_msg( ).
    You do not need to take special care about the variables. Just raise the message as you want it to be raised. The only thing you need to do is to raise the message into a string (..into l_dummy). The interface IF_RSPLFA_MSG and the implemetation of add_msg is going to read the standard message variables (SY-MSGNO, SY-MSGID, SY-MSGTY, MSGV1 ...). You just need to throw the message
    and call  i_r_msg->add_msg( ) e.g. in the execute method of your customer planning function.
    Please give it a try and take a look at it in the debugger.
    Hope this helps.
    Matthias Nutt
    SAP Consulting Switzerland

  • Execute process chain in BI out of an planning function

    Hello all,
    is there a way to execute a process chain in BI out of a planning function, e.g. FOX?
    We are using BI 7.0. Any help would be fantastic.
    Best regards,
    Stefan from Munich/Germany

    Hi Stefanos,
    you could use a planning function to call a function which starts the process chain. The planning function could be a customer planning function type. Make shure that you tick the without blocks tickbox. Otherwise it may be possible that the execution of the process chain is done several times.
    Regards Matthias Nutt
    SAP Consulting Switzerland

  • Planning Function to update Fiscal Period Characteristics

    Hi,
    Is it possible to write a Planning Function that would update empty Fiscal Period Characteristics from the already populated 0CALMONTH Characteristic?  I know the ABAP required if I can use it, but I'm just wondering about IP having the ability to do this in the Planning Function Environment..  I'm guessing it's a repost effort, but I can't think how to accomplish this?  Or do I need to create a custom planning function?
    Thanks!

    Thanks for the info,  My planning data is being uploaded via the SDN Planning File Upload Solution.  What I did was end up modifiying the upload class ZCL_RSPLF_FILE_UPLOAD Method EXECUTE.   
    I added the following code if anyone is interested.
    *{   INSERT         BWDK902323                                        1
    THIS SECTION OF CODE POPULATES THE FISCAL PERIOD CHARACTERISTICS
    USING THE FISCAL YEAR VARIANT 'NK' AND THE CALENDAR MONTH/YEAR
    FIELD-SYMBOLS <0FISCVARNT> TYPE /BI0/OIFISCVARNT.  " Fiscal Year Variant
    FIELD-SYMBOLS <0FISCYEAR>  TYPE /BI0/OIFISCYEAR.   " Fiscal Year
    FIELD-SYMBOLS <0FISCPER>   TYPE /BI0/OIFISCPER.    " Fiscal Year/Period
    FIELD-SYMBOLS <0FISCPER3>  TYPE /BI0/OIFISCPER3.   " Posting Period
    FIELD-SYMBOLS <0CALMONTH>  TYPE /BI0/OICALMONTH.   " Calendar Month/Year
    ASSIGN COMPONENT '0CALMONTH'  OF STRUCTURE <L_S_DATA> TO <0CALMONTH>.
    ASSIGN COMPONENT '0FISCPER'   OF STRUCTURE <L_S_DATA> TO <0FISCPER>.
    ASSIGN COMPONENT '0FISCVARNT' OF STRUCTURE <L_S_DATA> TO <0FISCVARNT>.
    ASSIGN COMPONENT '0FISCPER3'  OF STRUCTURE <L_S_DATA> TO <0FISCPER3>.
    ASSIGN COMPONENT '0FISCYEAR'  OF STRUCTURE <L_S_DATA> TO <0FISCYEAR>.
    <0FISCVARNT> = 'NK'.
    CALL FUNCTION 'FISCPER_FROM_CALMONTH_CALC'
      EXPORTING
        IV_CALMONTH       = <0CALMONTH>
        IV_PERIV          = <0FISCVARNT>
    IMPORTING
       EV_FISCPER3       = <0FISCPER3>
       EV_FISCPER        = <0FISCPER>
       EV_FISCYEAR       = <0FISCYEAR>.
    *}   INSERT

  • Use Formula variable in planning function

    Hello,
    I would like to use a formula variable in a planning function.
    The problem is that when I execute this function all keyfigures values are set to 0 so the FOX is not executed.
    The idea is to have something like
    = VARV(FORMULAVARIABLE).
    How could this be achieved using FOX ?
    Or how using an exit function could I call this FORMULAVARIABLE which is not used in the query ?
    Thanks,
    Matthieu

    Hello Matthieu,
    Please search the forum before posting:
    http://forums.sdn.sap.com/click.jspa?searchID=70350665&messageID=9814615
    Regards,
    Marc
    SAP Techology RIG
    PS: You closed the thread so I have to add some details here. The FOX runtime is hardcoded to 0RSPLS_FORMULA. Therefore, 0RSPLS_FORMULA cannot be copied to a custom planning function type as you suggest.
    Edited by: Marc Bernard on Feb 23, 2011 3:36 PM

  • How to get planning function in customized data slice?

    Hi all,
    we are using a customized data slice which implements IF_RSPLS_DATASLICE. Now we have the requirement that the data slice only protects the data when it calls via query. The data slice will not protect data if a planning function is executed. How can we implement this requirement? Is it possible in the method IF_RSPLS_DS_METHODS ~ IS_PROTECTED to read this information from an instance of the planning function (CL_RSPLS_CR_CONTROLLER?) or the buffer or something else? Or can we find some information about the query?
    At the moment we only check if a planning sequence is called by a process chain. This works fine
    IF sy-batch IS NOT INITIAL.
        e_noinput = rs_c_false.
        EXIT.
      ENDIF.
    Thanks for your help!

    Hi,
    I think this topic was already discussed in this forum.
    By design, it should not matter whether a query or a planning function is not allowed to change records. This is what data slices were designed for.
    OK, you need a different behaviour.
    1. Maybe you can detect from the planning function filter or query filter whether you run function or a query. If this is the case use the method IS_OVERLAPPING of the data slice. There you get the filter as a I_TSX_SELDR or as a range table when you call SELDR_TO_RANGE. When you return r_is_overlapping = rs_c_false. the data slice will not be called.
    2. Another option is to call the factory of the data slice and to use a flag in the data slice that indicates that the data slice is used in the context of a planning function. The factory method is GET_INSTANCE. Set a break point there to find out how the system calls this method. But when to call the factory? Check note 1101726. This note provides infrastructure to change the filter of a planning function at run time. But you can use this exit to call the factory method mentioned above. The nice thing is that you can raise the excpetion EMPTY in the exit, thus the function will not be called. So use a planning sequence with dummy1, your function, dummy2. For dummy1 switch on flag on, raise EMPTY, dummy1 will not be executed (almost no run time is needed), then 'your function' will be called (do nothing in the exit', then function dummy2 will be called, here switch the flag off again.
    Check also the following link where the above technique is used to for the conditional execution of planning functions:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0785271-1446-2d10-6987-d1e44f08e97c
    Regards,
    Gregor

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • Issue in Program for mass creation of customer plans.

    Hello all,
    I am working on a program which helps mass creation of customer plans. My code works well, when no planning account is assigned,  but when I pass the planning account value into the Function module, it gives me an error saying ' Account cannot be displayed, please check your authorizations'. I donot have this problem, when I manually createthe customer plan in the CRM_UI.
    Please let me know the possible cause for this kind of message.
    Thanks,
    Disha.

    Hi Dishaa,
    I'm afraid that I don't have any other clues. Most often it is a difference in user. If you are absolutely sure that you are using the same user at the exact moment the authorization is checked it cannot be that.
    Kinda curious now what the solution to your problem is....
    Best regards,
    Guus
    Edited by: Guus Jansen on Feb 14, 2011 1:32 PM

  • Development Plans functionality in Talent Management

    Hello,
    We are planning to use the Development Plans functionality in Talent Management.
    But the Development Plan is not opening from MSS. (MSS -> Talent management -> Assessment -> Development Plan).
    I had created the Business partner object for all my test PERNRs and I had created a Development Plan Template (via IMG step in Talent management). I had activated the Business Functions and Services.
    When I open the Development plan in MSS, it is showing the names of employees (i.e. the reports of the manager). But when I click on an employee, it's not opening any development plan. Nothing is happening.
    Please help me,
    Thanks
    Raghu

    Hi Bharti,
    You must first delete the template names from the customizing tables where it is stored (under Talent Assessment node of Talent Management and Talent Development). Then you delete it under PHAP_CATALOG. Unfortunately you have created an databse inconsistency and you might need to see if Basis can delete the values from the table.
    Best regards,
    Luke

  • How to implement this planning function using Fox formula

    Hello,
    I am new to Fox.
    I want to implement this complex logic in a planning function
    i have A (Kf X from infoprovider Z_A), B (Kf Y from infoprovider Z_B) & moreover there is one more condition,
    If current FISCPER > variable value of FISCPER
    KF Z = KF Z1 (from Cube C1)
    Else KF Z = KF Z2 (from Cube C2).
    for a particular calender week,
    X =   ( Y * Z ) / (summation of (Y * Z)  for each week of the whole year)
    I know it is complex.
    but i have to implement this in a planning function.
    The aggreagtion level is built on a multiprovider having A, B , C1 & C2.
    Can someone help me out with the FOX formula for this? or is there any better way to do this.
    Thanks john

    Hi Gerardo,
    Thanks for that.
    I have tried something similiar to it
    DATA CHA_CALWEEK TYPE 0CALWEEK.
    DATA CHA_COMP_CODE TYPE 0COMP_CODE.
    DATA CHA_FISCPER TYPE 0FISCPER.
    DATA VAR_PERIOD  TYPE 0FISCPER.
    DATA SUM_YEAR TYPE F.
    DATA TEMP_D TYPE F.
    DATA SUM_WEEK TYPE F.
    CURRENCY IS LOCAL CURRENCY. FOR DATA SELECTION TO BE RIGHT, NECESSARY TO DERIVE FROM CC.
    DATA UN_LOC_CURRCY TYPE 0LOC_CURRCY.
    UN_LOC_CURRCY = VARV(Z_U_I100).
    CHA_COMP_CODE = VARV(Z_U_I100).
    To Calculate the D
    VAR_PERIOD = VARV(Z_U_I010).
    SUM_YEAR = 0.
    TEMP_D =0.
    IF CHA_FISCPER > VAR_PERIOD.
    TEMP_D = {ZSA_BUD2X,CHA_COMP_CODE,CHA_FISCPER,YBUDG_01X,CHA_CALWEEK}.
    FOREACH CHA_CALWEEK.
    SUM_YEAR = SUM_YEAR + TEMP_D * {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1} .
    ENDFOR.
    ELSE.
    TEMP_D = ({ZSAEXCUSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X} - {ZCREENTSV,CHA_COMP_CODE,CHA_FISCPER,YRT_C02X}).
    FOREACH CHA_CALWEEK.
    SUM_YEAR = SUM_YEAR + TEMP_D * {ZIP_INDEX,CHA_COMP_CODE,CHA_FISCPER,ZIP_RREF1}) .
    ENDFOR.
    ENDIF.
    But i am getting a syntax error
    Formula error: } expected
      Syntax error in row 21, column 20
    i have marke line21 in bold. above.
    I feel it is correct, still wonder why i am getting this error.
    can you pls help ?

Maybe you are looking for

  • Error in script task "The name 'file' does not exist in the current context"

    I am new to the c# scripting and SSIS come from PHP and Foxpro. I am using SSIS with a script task and I am getting am errror "The name 'file' does not exist in the current context" in the following code in the picture below: (See Why does the object

  • Collective release of entry sheets in ML85

    Hi, When releasing multiple entry sheets in ML85, system posts one material document irrespective of vendor or purchase order. Where do i control this situation if i want one material document for one entry sheet? Regards, Adhi

  • SAP UI 5 and the Efforts issue

    Hi, All We  are exploring building SAP UI 5 applications. It seems to build a web application 1. Need to develop the UI part in SAP UI5 2. To get the data from SAP back-end,  Create first, the function module and then create a odata service using NW

  • Use of analytic function

    I'm trying to sort a series of rows and look for the latest (based on time). I only want the latest row, because that's the one I want to update. I'm trying to figure out a query, and it looks like an analytical function is my best avenue, but the sy

  • Imported iCal files - can't edit

    Hello My MBP is running Mountain Lion, and if I export an event from my Facebook to iCal I can't edit any aspect of it. I can accept or reject an invite, but that's as  far as it goes. It also happens if my flying school emails me an iCal thingy, so