cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debug BEX User Exit Variable with Olap Analysis 4.1 SP4 and DS 1.5?

leewlewis
Participant
0 Kudos


We have a user exit variable in BEX query that works in RSRT but is not applied in OLAP for Analysis, or Excel 4.1 SP4 or Design Studio 1.5.

The exit is fairly straightforward: pass a parameter 1-6, then the exit determines the calendar range to apply to the results.  We want to push all the date calculations previously done in Xcelcius to this BW user exit.

Example.  If variable value is 2, then results are restricted to last month, if 3, then results are for YTD.

  • The variable is unchecked as ready for input
  • The variable is placed with the info object 0CALMONTH in the characteristic restrictions frame
  • Checked  authorizations -  same user can execute the bex query in bex analyzer without error and retrieves the expected results.
  • Cleared saved prompt values in olap for anlaysis

How can we debug, trace, or confirm that the BW user exit variable is being executed?

The documentation for BI 4.1 and DS says user exits variables are now supported, but are there limitations, tricks to this?

Really appreciate any good info on this topic!

Lee Lewis

Accepted Solutions (1)

Accepted Solutions (1)

former_member193885
Contributor
0 Kudos

Lee,

You could use RSTT to record a trace on the BW side for the Design STudio BICS call and run in debug mode to see whether the customer exit code is executed.

Transaction RSTT - SAP NetWeaver Business Warehouse - SCN Wiki

Thanks.

Deepu    

leewlewis
Participant
0 Kudos

Thanks Deepu

We used RSTT and compared the trace file from BEX(RSRT) and OLAP (Webi and Olap Analysis)
and there are marked differences.

The OLAP trace seems to indicate the user exit was not processed where as the RSRT trace shows that the code executes and the expected high and low date range was returned.  We have entered an OSS incident...but surely we are missing something right?  User exits are supposed to work in BI 4.1....Help is appreciated

OLAP Trace

<?xml version="1.0" encoding="utf-8" ?>

- <asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">

- <asx:values>

  <E_MAX_MESSAGE_TYPE />

  <E_COUNT>0</E_COUNT>

  <I_DATA_PROVIDER_HANDLE>0004</I_DATA_PROVIDER_HANDLE>

  <I_CHARACTERISTIC_NAME>ZVAR_CE_CALMONTH_INTVL_OPT</I_CHARACTERISTIC_NAME>

  <I_ATTRIUTBE_NAME />

  <I_MAX_ROWS>2</I_MAX_ROWS>

  <I_READ_MODE />

  <I_TSX_ADDITIONAL_SELECTION />

  <I_START_INDEX>0</I_START_INDEX>

  <I_ONLY_COUNT />

- <I_T_STATISTIC_INFO>

- <RSSTA_S_EVENTINPUT>

  <EVENTID>000012500</EVENTID>

  <HANDLEID>0000</HANDLEID>

  <HANDLETP>APPL</HANDLETP>

  <OBJNAME />

RSRT Trace

<VRNID>0135</VRNID>

  <VNAM>ZVAR_CE_CALMONTH_INTVL_OPT</VNAM>

  <VARTYP>1</VARTYP>

  <VPROCTP>3</VPROCTP>

  <VPARSEL>I</VPARSEL>

  <VARINPUT />

  <DYNCHANGE />

  <ENTRYTP>0</ENTRYTP>

  <CMPSTA />

  <CMP_SUPPORT />

  <SIGN>I</SIGN>

  <OPT>BT</OPT>

  <LOW>201408</LOW>

  <HIGH>201408</HIGH>

  <SIDLOW>201408</SIDLOW>

  <SIDHIGH>201408</SIDHIGH>

  <LOWFLAG>0</LOWFLAG>

  <HIGHFLAG>0</HIGHFLAG>

  <KEYFL />

former_member193885
Contributor
0 Kudos

Lee,

based on your response to Mustafa's post note below might help.

http://service.sap.com/sap/support/notes/2182820

Deepu

IngoH
Active Contributor
0 Kudos

Hello Lee,

I would not expect your EXIT variable to show up in the OLAP Trace because Analysis OLAP has "nothing to do" on the EXIT variable as it is being processed completely in the background.

in RSTT it shows up as expected as it is part of the BEx query.

Could you try a simple step and configure the EXIT variable as "Ready for Input" so that it will be displayed and then setup a report in A OLAP or A Office and see what the behavior is then ?

thanks

Ingo Hilgefort, Visual BI

leewlewis
Participant
0 Kudos

Thank you Deepu.

We were able to resolve this using RSTT trace.  The formula variable passed from OLAP to the user exit was interpreted as 2.0 even though the variable input was entered as 2 and the KF assigned was set to 0 decimals.  Not sure why this is, but we adjusted the user exit accordingly.

WHEN 'ZVAR_CE_ZDAY_NO_INTVL_OPT'.

  " Grab the day number from the analysis date

  IF i_step = 2.

    " Read the time period and calculate according to that   ld_time_period = '1'.

    READ TABLE I_T_VAR_RANGE INTO wa_var_range

    WITH KEY VNAM = 'ZVAR_TIME_PERIOD'.

    IF SY-SUBRC = 0.

      ld_time_period = wa_var_range-LOW.

      CONDENSE ld_time_period.

    ENDIF.

    ld_time_period = ld_time_period+0(1).



    " Read the day number from the analysis date

    READ TABLE I_T_VAR_RANGE INTO wa_var_range

    WITH KEY VNAM = 'ZVAR_CALDAY_SING_MAND'.

    IF SY-SUBRC = 0.

      l_s_range-SIGN = 'I'.

      l_s_range-OPT  = 'BT'.

      l_s_range-LOW  = '01'.



      " Assign the ending date based on the time period value

      IF ld_time_period = '1' OR

         ld_time_period = '2' OR

         ld_time_period = '3' OR

         ld_time_period = '7'.

        " The date range will end by the analysis date

        l_s_range-HIGH = wa_var_range-LOW+6(2).

      ELSE.

        " The date range will end by the end of the month

        l_s_range-HIGH = '31'.

      ENDIF.

      " Assign the range

      APPEND l_s_range TO e_t_range.

    ENDIF.

  ENDIF.

Lee Lewis

Answers (2)

Answers (2)

MustafaBensan
Active Contributor
0 Kudos

By the way, if the BEx variable is "unchecked as ready for input" how did you enter the variable parameter value when testing with RSRT?

leewlewis
Participant
0 Kudos

Hi Mustafa,

I was not clear.  We use a separate formula variable to capture the time period choice.

The user inputs the time period using the ZVAR_TIME_PERIOD value that is a formula variable

ZVAR_CE_CALMONTH_INTVL_OPT gets the data filled from customer exit code (CMOD)

where it reads the value user entered in ZVAR_TIME_PERIOD

Similar to what is explained in this doc using formula variable in DS for What If..

http://scn.sap.com/docs/DOC-44767

Lee

MustafaBensan
Active Contributor
0 Kudos

Hi Lee,

I tried the Design Studio profiling feature with one of my own applications, as documented in Understanding Profiling and Statistics in Design Studio but it doesn't seem to output enough detail about processing of specific BW BEx variables.  I tried debugging/tracing in the browser but that didn't reveal the relevant detail either.  Others may have alternative technical suggestions. 

In the meantime, it may also be worthwhile reviewing how and where you are setting the BEx variable value in your application.  Are you able to share the script snippets related to setting your variable value?

Regards,

Mustafa.