Skip to Content

Help needed with BPC 10.1 Data Manager script with REPLACEPARAM_KEY keyword

I am trying to develop a Work Status reset program using a custom process chain. I have based the processing on the Create Master Data on the Fly pdf.

I want to pass custom Entity, Category and Time values + a couple other parameters such as desired work status and Include Children in the Data Manager prompt.

When I run the package the Entity, Category and Time %% variables are filled correctly (although I have read that the maximum number of chars is 40 for the REPLACEPARAM_KEY & _VALUE parameters and mine are longer than that as are proceeded by the Environment, Model, Private Publications etc. before we get to the actual dimension name and member values), but the problem I want the answer to is: The view status gives failure message as:

Cannot configure parameter REPLACEPARAM1_KEY in task ZBPC_WRKSTS_RESET_START

model: INPUT. Package status: RUNNING

All the REPLACEPARAM_KEY and _VALUE(s) are specified in the custom RSPC BPC Process Type.

My DM script is below (I need help with the syntax of the REPLACPARAM_KEY etc.). I have tried without quotes, using the word ID etc. You can see that it is "ENTITY_WS" and I have only shown the affected script:

PROMPT(SELECTINPUT,%ENTITY_WS%,,"Select Entity base members",ENTITY_WEEKLY) - ENTITYWEEKLY is the dimension

TASK(ZBPC_WRKSTS_RESET_START,REPLACEPARAM1_KEY,"ENTITY_WEEKLY")

TASK(ZBPC_WRKSTS_RESET_START,REPLACEPARAM1_VALUE,%ENTITY_WS%).

I have been working on trying to pass BPC custom variables to backend Process Chain for some time and keep hitting hurdles.

Thank you for any help.

Mark Dean

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

13 Answers

  • Jan 24, 2017 at 01:20 PM

    "I have based the processing on the Create Master Data on the Fly pdf." - ups, strange!

    Please read: https://blogs.sap.com/2013/10/28/how-to-change-work-status-from-script-logic-using-badi/

    And use standard chain default formulas to launch the script with custom logic badi.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 24, 2017 at 01:45 PM

    Thanks Vadim,

    I see your answers elsewhere on the forum and they often help me. When I mentioned about using the Master Data on the Fly pdf, I meant that I was duplicating some of the processing scenario, like having a similar custom process chain and using the same superclass, and the Method list in my custom RSPC Process Type CL_UJD_BPC... class and changing some of the Methods i.e. IF_RSPC>EXECUTE, SET_PC_TYPE and RUN to suit my requirements and the fact that it passes custom parameters which is what I require.

    I have not used a BADI call from BPC before, and one of the reasons I went the Process Chain route was that I wanted to send status and informational messages back to the BPC View Status screen. I expect I can still do this going the BADI route.

    I am going to follow your suggestion - the problem I have been really trying to solve up to now is how to retrieve custom parameters in the Class OO NW backend.

    Regards

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 25, 2017 at 03:46 PM

    Thanks Vadim, for showing the correct way to approach this.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 25, 2017 at 07:40 PM

    Hi Mark,

    Some basic things:

    I know to specify QUERY = ON - incorrect, you don't need to scope records!

    Parameters:

    You have to specify in the badi number of parameters:

    1. List of dimensions used in work status - each parameter: dimension name - dimension member

    2. STATUS parameter

    3. INCLCHILD parameter.

    Please look once again on the provided link:

    READ TABLE it_param WITH KEY hashkey = ‘STATUS’ INTO ls_param.

    Add comment
    10|10000 characters needed characters exceeded

    • P.S.

      Is the IF_UJ_CUSTOM_LOGIC~EXECUTE method's table variable IT_PARAM populated automatically??

      It will be populated if you call badi with the required parameters, like:

      CATEGORY=%CATEGORY_SET% //If you category type dimension is named CATEGORY

      ...

      %CATEGORY_SET% will come from %SELECTION% variable in the advanced script...

      STATUS=$STATUS_WS$ //From REPLACEPARAM...

  • Jan 25, 2017 at 07:30 PM

    Hi Vadim, I understand the BADI UJ_CUSTOM_LOGIC custom filter implementation on the ABAP backend. It is the BPC Front End Manager scriptfile to call the BADI I am unsure about.

    My BPC DM prompt script reads as follows and calls the script logic in file RUN_WORK_STATUS_CHG

    PROMPT(SELECTINPUT,,,,"%CATEGORY_DIM%,%ENTITY_DIM%,%TIME_DIM%")

    PROMPT(RADIOBUTTON,%STATUS_WS%,"Reset Work Status to:",1,{"0 = Unlocked","1 = Submitted","2 = Approved","3 = Locked"},{"1","2","3","4"})

    PROMPT(CHECKBOXNO, %INC_CHLD_WS%,"Include Children")

    INFO(%EQU%,=)

    INFO(%TAB%,;)

    TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)

    TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)

    TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)

    TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%)

    TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,RUN_WORK_STATUS_CHG)

    TASK((/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,STATUS_WS%EQU%%STATUS_WS%%TAB%INC_CHLD_WS%EQU%%INC_CHLD_WS%)

    The section I am unsure about is the RUN_WORK_STATUS_CHG logic file script which runs the custom filtered implementation of the UJ_CUSTOM_LOGIC BADI. I know to specify QUERY = ON so as to scope the data for the BADI to run on but it is the parameters passed to the BADI implementation that I am unsure about.

    Is the IT_PARAM variable in the IF_UJ_CUSTOM_LOGIC~EXECUTE method automatically filled by the Process Chain Process Type screen? I mean how does the SELECTION & REPLACEPARAM variables passed in the Process Type in the Process Chain get into the UJ_CUSTOM_LOGIC BADI?

    Is the IF_UJ_CUSTOM_LOGIC~EXECUTE method's table variable IT_PARAM populated automatically??

    So I have:

    *START_BADI <filter name of custom UJ_CUSTOM_LOGIC Badi>

    *WRITE = OFF

    *QUERY = ON

    ?? Parameters

    ?? Parameters

    *END_BADI

    Is this all I have to specify

    Thanks very much for answering this.

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 29, 2017 at 07:06 PM

    Hi Vadim,

    thanks for all your help so far. I have another question.

    I am nearly there with my Data Manager work status reset program. I a writing log records as desired to the CL_UJK_LOGGER=>LOG which show up correctly in the status formula log.

    However if as below as specified in UJ_CUSTOM_LOG~EXECUTE (this is just a really simple example)

    l_log = 'You have not specified ENTITY_WEEKLY value(s) which are required'.
    cl_ujk_logger=>log( i_object = l_log ).

    RAISE EXCEPTION TYPE cx_uj_custom_logic.

    EXIT.

    the package still comes back as SUCCESSFUL. (I want to take control back after the EXIT, or know how to insert the fact that the package did not run successfully).

    I want it to come back with an overall status with an error and a message to inform the user to read the formula log. If this is not possible then I just want to end the package with warning or error but not successful.

    Thanks again Vadim, Regards Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 30, 2017 at 05:05 PM

    Hi Vadim,

    the post you directed me to corresponded with my issue of needing to change status of Data Manager execution, I could clearly identify with, but as you posted, we need a resolution as opposed to just stating that in the latest BPC release there is no way to interrupt the UJ_CUSTOM_LOGIC processing to effect the change in status of a Data Manager package.

    I am almost there, I am writing correctly comprehensive Success and Error messages with regard to the

    cl_ujw_work_status_mgr->update_work_status_locks method which provides all of the validation needed for work status update, and if no errors updates the work status locks table (/1cpmb/LKWSxxyyy where xx = appset prefix and yyy = application prefix) correctly.

    I am writing the error / success messages using the cl_ujk_logger=>log( i_object = l_log ) method, but I just need something to inform the user if an error has occurred, instead of the package status just reading 'succeeded', and then if there is an error they can see in the Formula Log what errors (and successes occurred) - as my reset program deals with multiple work status dimension intersections.

    Thanks

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 30, 2017 at 06:33 PM

    Sorry Vadim, for not posting the release details.

    We are on SAP BPC 10.1 SP11, EPM Add-in is 10.0 SP26 Patch 3 Net3.5, BW is SAP-BW 750 0003.

    Yes, I tried your code but did not work as on a later release. Wrote message to Formula log but package ended as succeeded!

    As you know I want to duplicate that functionality on this latest release (i.e. interrupting the UJ_CUSTOM_LOGIC error processing).

    Why do you think this has been disabled in later releases. I cannot find anything regarding this.

    Regards

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 31, 2017 at 09:17 AM

    Vadim,

    I finally found a solution. I tried adding an 'E' type message to the ET_message parameter of the IF_UJ_CUSTOM_LOGIC~EXECUTE method.

    Package came up as status 'Failed' and message specified came up in the main part of the log. The message here would inform the user to look at the formula log to see reasons for individual failures (and successes).

    One last thing - how to I close this this thread besides marking all as read?

    Thanks again for your help.

    Regards

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • It's better to provide a sample code to show your solution. Please show minimal badi code that will result in Failed status (like in my sample).

      "One last thing - how to I close this this thread besides marking all as read?" -

      marking all as read?? not clear... you have close action!

  • Jan 31, 2017 at 12:37 PM

    Vadim, here is the code for the IF_UJ_CUSTOM_LOGIC~EXECUTE Method

    Notice how I have asterisked out the RAISE EXCEPTION. If left in program ends with Package succeeded after leaving program with the RAISE . Being left out ensures processing continues (e.g. you can add further messages to the formula log), and as soon as Method processing ends and returns to the custom UJ_CUSTOM_LOGIC then Package ends as Failed (due to the et_message-msgty = 'E').

    msgty = 'W' will also give package status ending as 'Warning'

    l_s_message TYPE uj0_s_message.

    l_s_message-msgid = 'ZBPC'.
    l_s_message-msgno = '042'. "Any arbitrary no
    l_s_message-recno = 1. "Just for consistency

    l_s_message-msgty = 'E'.
    l_s_message-message = 'Whatever you want blha blah blah - I tell the user here to look at the formula log to get discrete errors'

    APPEND l_s_message TO et_message.

    * RAISE EXCEPTION TYPE cx_uj_custom_logic.

    Below is a screen shot of msgty = 'E'.

    The above message appears in the main DM package log. The only thing I could not do was if msgty = 'S', was to say to the user to look at the formula log to see the updated details. Log just says the standard Package status: SUCCESS

    Regards

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • Unfortunately script without RAISE EXCEPTION TYPE CX_UJ_CUSTOM_LOGIC

      will continue execution!

      Just test like here:

      //********************* Test sample code
      *START_BADI TESTSTATUS
      WRITE=OFF
      QUERY=OFF
      DEBUG=OFF
      *END_BADI
      
      *XDIM_MEMBERSET PERIODS=2011.FEB
      *XDIM_MEMBERSET PLANTYPE=ACTUAL
      *XDIM_MEMBERSET TITLES=1214
      *XDIM_MEMBERSET CORPDIR=DIRECT
      *XDIM_MEMBERSET INACCT=PAGEVIEWS
      *XDIM_MEMBERSET BE=BE1000
      *WHEN INACCT
      *IS *
      *REC(EXPRESSION=%VALUE%)
      *ENDWHEN

      Without Exception the code after badi will run (Formula log):

      LOG BEGIN TIME:2017-01-31 16:19:35
      FILE:\ROOT\WEBFOLDERS\SIM\ADMINAPP\INPER\TESTEX.LGF
      USER:V.KALININ
      APPSET:SIM
      APPLICATION:INPER
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:BE WILL QUERY ON ALL BASE MEMBERS.
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:CORPDIR WILL QUERY ON ALL BASE MEMBERS.
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:INACCT WILL QUERY ON ALL BASE MEMBERS.
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:PERIODS WILL QUERY ON ALL BASE MEMBERS.
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:PLANTYPE WILL QUERY ON ALL BASE MEMBERS.
      [WARNING!] NO MEMBER SPECIFIED FOR DIMENSION:TITLES WILL QUERY ON ALL BASE MEMBERS.
      EXECUTION BADI:TESTSTATUS
      QUERY: OFF
      WRITE: OFF
      BADI EXECUTION TIME IN TOTAL :0.00 ms.
      MESSAGE FROM CUSTOM LOGIC:
      E:ZBPC:042
      [INFO] GET_DIM_LIST(): I_APPL_ID="INPER", #dimensions=7
      BE,CORPDIR,INACCT,MEASURES,PERIODS,PLANTYPE,TITLES
      
      #dim_memberset=6
      PERIODS:2011.FEB,1 in total.
      PLANTYPE:ACTUAL,1 in total.
      TITLES:1214,1 in total.
      CORPDIR:DIRECT,1 in total.
      INACCT:PAGEVIEWS,1 in total.
      BE:BE1000,1 in total.
      
      REC :%VALUE%
      
      CALCULATION BEGIN:
      QUERY PROCESSING DATA
      QUERY TIME : 2.00 ms. 1  RECORDS QUERIED OUT.
      QUERY REFERENCE DATA
      CALCULATION TIME IN TOTAL :0.00 ms.
      1  RECORDS ARE GENERATED.
      CALCULATION END.
      
      ENDWHEN ACCUMULATION: 1  RECORDS ARE GENERATED.
      
      DATA TO WRITE BACK:
      BE    CORPDIR    INACCT    PERIODS    PLANTYPE    TITLES    SIGNEDDATA
      BE1000    DIRECT    PAGEVIEWS    2011.FEB    ACTUAL    1214    - 2700.00
      1  RECORDS HAVE BEEN WRITTEN BACK.
      WRITING TIME :1.00  ms.
      
      SCRIPT RUNNING TIME IN TOTAL:4.00 s.
      LOG END TIME:2017-01-31 16:19:36
      File path: \ROOT\WEBFOLDERS\SIM\INPER\PRIVATEPUBLICATIONS\V.KALININ\tempfiles\20170131161935\TESTEX.LOG<br>

      And with exception the script execution will be terminated on the badi. I am talking about OLD SP. Can you test the same in latest?