Skip to Content
avatar image
Former Member

How to filter Measures in DM?

I am trying to call a BADI using the custom DM package. I want to filter Measures but system is giving error.. Below is the script.

PROMPT(MEASURELIST,%MEASURES%,"Please select measures") PROMPT(SELECTINPUT,%SELECTION%,,"Please select both Previous Year and Current Year Periods","TIME") INFO(%CATEGORY%,DIMENSION:CATEGORY|ACTUAL|) INFO(%DATASRC%,DIMENSION:DATASRC|SAP_INPUT|) INFO(%RPT_CURRENCY%,DIMENSION:RPT_CURRENCY|USD|)

INFO(%EQU%,=)

INFO(%TAB%,;)

TASK(ZBPC_TEST,TAB,%TAB%)

TASK(ZBPC_TEST,EQU,%EQU%)

TASK(ZBPC_TEST,SUSER,%USER%)

TASK(ZBPC_TEST,SAPPSET,%APPSET%)

TASK(ZBPC_TEST,SAPP,%APP%)

TASK(ZBPC_TEST,MEASURES,%MEASURES%) TASK(ZBPC_TEST,SELECTION,%SELECTION%%CATEGORY%%DATASRC%%RPT_CURRENCY%)

TASK(ZBPC_TEST,LOGICFILENAME,ZBPC_TEST.LGF)

In the Process Chain i did defined as below.

TAB

SUSER

SELECTION

SAPPSET

SAPP

REPLACEPARAM

MEASURES

LOGICFILENAME

EQU

Error is "Cannot configure parameter MEASURES in task ZBPC_TEST".

Need help on fixing the issue.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Apr 26 at 06:38 AM

    Instead of TASK(ZBPC_TEST,MEASURES,%MEASURES%)

    try:

    TASK(ZBPC_TEST,REPLACEPARAM,M%EQU%%MEASURES%)

    in the script logic you will use $M$ variable with measures!

    and strange idea to use custom chain ZBPC_TEST instead of standard /CPMB/DEFAULT_FORMULAS_LOGIC


    Add comment
    10|10000 characters needed characters exceeded

  • Apr 26 at 02:55 PM

    Sorry, but you are asking me about some solutions without explaining the required logic!!!

    What do you want to achieve???

    For example, if you want user to select ONLY one measure: YTD or PERIODIC

    You can use COMBOBOX prompt in advanced script with 2 text values: YTD,PERIODIC

    The result of combobox you can pass to the same $M$ variable.

    In the script before badi you can use *XDIM_MEMBERSET MEASURES=$M$

    And the badi ct_data will be filled with the selected measure.

    Again: logic is not clear!

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 26 at 05:22 PM

    Just tested in my system:

    *XDIM_MEMBERSET MEASURES=$M$
    *START_BADI EXPORTSQL 
    QUERY=OFF
    WRITE=OFF
    DEBUG=ON
    CONNECTION=XXX
    *END_BADI

    Validated and saved without issues!

    As I already told you - full info has to be provided!

    What is your BPC and BW version/SP? The error you have may happen on VERY old SP's

    Also you can save script even without validation and it will work!

    Also I recommend to replace:

    PROMPT(MEASURELIST,%MEASURES%,"Please select measures")

    with

    PROMPT(COMBOBOX,%MEASURES%,"Select MEASURE:",0,YTD,{YTD,PERIODIC})

    to ensure that ONLY ONE MEASURE will be selected by user!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 26 at 02:47 PM

    Thanks Vadim Kalinin for your time and reply.

    I tried TASK(ZBPC_TEST,REPLACEPARAM,M%EQU%%MEASURES%) this working in passing the parameter to script and to BADI but how to get the YTD values in BADI?

    Do we need to calculate YTD values in BADI through abap code? How can we calculate ?

    Yeah its strange ..somehow i started and created a custom BADI..

    Thanks in advance.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 26 at 03:24 PM

    Hi Vadim,

    I am trying to extract the YTD data into BADI to create a CSV file. I did hardcoded rest of the values but not sure how to work on Measures.

    As mentioned in the script before badi i tried using *XDIM_MEMBERSET MEASURES=$M$... system throws error "Invalid Measures Value:INVALID MEASURES VALUE"$M$""

    I tried *REC(EXPRESSION=[MEASURES].[YTD]) but still didn't work.

    Can you please help on this issue.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

    • Sorry, but you are not providing full info!

      How can I help you?

      Where is your final advanced script?

      Where is you script logic text???

      Asking the same questions again and again... :(

  • Apr 26 at 03:50 PM

    If you don't want to provide full info I will not answer!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 26 at 04:01 PM

    Vadim,

    Here is the full info

    Advanced Script and Process Chain

    PROMPT(MEASURELIST,%MEASURES%,"Please select measures") PROMPT(SELECTINPUT,%SELECTION%,,"Please select both Previous Year and Current Year Periods","TIME") INFO(%CATEGORY%,DIMENSION:CATEGORY|ACTUAL|) INFO(%DATASRC%,DIMENSION:DATASRC|SAP_INPUT|) INFO(%RPT_CURRENCY%,DIMENSION:RPT_CURRENCY|USD|)

    INFO(%EQU%,=)

    INFO(%TAB%,;)

    TASK(ZBPC_TEST,TAB,%TAB%)

    TASK(ZBPC_TEST,EQU,%EQU%)

    TASK(ZBPC_TEST,SUSER,%USER%)

    TASK(ZBPC_TEST,SAPPSET,%APPSET%)

    TASK(ZBPC_TEST,SAPP,%APP%)

    TASK(ZBPC_TEST,MEASURES,%MEASURES%) TASK(ZBPC_TEST,SELECTION,%SELECTION%%CATEGORY%%DATASRC%%RPT_CURRENCY%)

    TASK(ZBPC_TEST,LOGICFILENAME,ZBPC_TEST.LGF)

    In the Process Chain i did defined as below.

    TAB

    SUSER

    SELECTION

    SAPPSET

    SAPP

    REPLACEPARAM

    MEASURES

    LOGICFILENAME

    EQU

    In the Script

    *START_BADI ZBPC_TEST

    QUERY = ON

    WRITE = ON
    *REC(EXPRESSION=[MEASURES].[YTD])

    PYEAR = $PYEAR$

    CYEAR = $CYEAR$

    *END_BADI

    As mentioned I am trying to extract the YTD data by passing periods in DM pacakge. In BADI once i get the data in CT_DATA i am creating a CSV file. Currently i am able to get the Periodic data and able to create CSV file.

    Please help me on how we can extract YTD data. Do we need to write custom abap logic to for YTD ???

    Thanks in advance.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member
      PROMPT(MEASURELIST,%MEASURES%,"Please select measures")
      PROMPT(SELECTINPUT,%SELECTION%,,"Please select both Previous Year and Current Year Periods","TIME")
      INFO(%CATEGORY%,DIMENSION:CATEGORY|ACTUAL|)
      INFO(%DATASRC%,DIMENSION:DATASRC|SAP_INPUT|)
      INFO(%RPT_CURRENCY%,DIMENSION:RPT_CURRENCY|USD|)
      INFO(%EQU%,=)
      INFO(%TAB%,;)
      TASK(ZBPC_TEST,TAB,%TAB%)
      TASK(ZBPC_TEST,EQU,%EQU%)
      TASK(ZBPC_TEST,SUSER,%USER%)
      TASK(ZBPC_TEST,SAPPSET,%APPSET%)
      TASK(ZBPC_TEST,SAPP,%APP%)
      TASK(ZBPC_TEST,REPLACEPARAM,M%EQU%%MEASURES%)
      TASK(ZBPC_TEST,SELECTION,%SELECTION%%CATEGORY%%DATASRC%%RPT_CURRENCY%)
      TASK(ZBPC_TEST,LOGICFILENAME,ZBPC_TEST.LGF)
      
      I am not able to validate the script when i added the below code.
      *XDIM_MEMBERSET MEASURES=$M$
      Error Screenshot below.
      

      Please help..

      capture.jpg (29.2 kB)
  • avatar image
    Former Member
    Apr 26 at 05:56 PM

    Thanks for your time and reply Vadim.

    We are on BPC 7.5 and SP 15. BW 7 and SP 11.

    Let me save the script and try running it. I will update you ...

    I will change the PROMPT to select only one measure as per your suggestion.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded