Skip to Content
Author's profile photo Former Member

Dynamic default values with prompt in webi reports (based on bex queries) in BO

     There has always been requirement wherein webi reports in BO are scheduled to run periodically for dynamic prompt values.

For e.g. We have reports which are scheduled to run monthly with cal.year month input as last month.

(P.S.  This document considers only universe based on bex queries for using this method.)

This obviously is easily achieved by using customer exit variables in BI. However, the only issue in using such variables is that there is no prompt for such variables in BO reports. Due to which such reports can by default be executed only for the values that are passed in the variables from the exit.

      But, many a time we have requirements wherein we want a report to by default get executed for the dynamic value passed through the variable when it is scheduled on periodic basis and also have a prompt option so that user can execute it for any value he/she requires. Since, there is no such option in BO ( as of now atleast ) to have a prompt with default values, and after looking out for a work around everywhere and failing to find any thing which could suffice such a requirement, I have found a work around which has helped to overcome this difficulty.


       To explain the method used, I would take a simple scenario where every month a BO report which is based on a bex query is scheduled to execute for last month i.e. Cal.year month(0calmonth) is the input for the query and the report should get executed by default for last month.

The idea is, whenever  ‘# ‘(not assigned ) value is passed to the query, the query would by default pick last month as value for the 0calmonth characteristic. However, if there is any other value passed as input other than  ” #” then the input value is to be considered as value for 0calmonth. To achieve this we would require two variables :

1. Manual Input variable (Based on 0Calmonth). 2. Customer exit variable (Based on 0Calmonth).


Here, the manual input variable (i.e. CV_CMON) would contain the value which would be provided as input in the query

and the customer exit variable (i.e. CV_MONDEF) would be filled in exit with the desired value at I_Step = “2” (Call after variable entry ).

Below is the screenshot of the logic used to fill the variable CV_MONDEF.


Next, while creating the query on which the universe would be built, restrict the 0calmonth characteristic to both the variables.

As shown in below screenshot.


On execution of query as shown in below screenshots, if ” #”  value is entered in variable CV_CMON then CV_MONDEF is filled with last month value

whereas if any other value is provided as input then CV_MONDEF is filled with value which is provided as input.



So as shown in the screenshots above, based on the input, the variable is restricted to the desired value and hence the desired output is achieved.

Now, using this a publication of the Webi report in BO can be created and scheduled with the Cal.year month as “#”.


So this way the report will be scheduled to run monthly based on the default value of last month and also at the same time

if user wants to change the cal.year month and execute the report the same can be done. Both the things can be achieved with the same webi report.

Hope this helps.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Nice one..Thank you

      Author's profile photo Shalaka Golde
      Shalaka Golde

      This is surely going to help me.Thanks Sujitha

      Author's profile photo Former Member
      Former Member

      Hello Sujitha,

      I applied the same logic for my WEBi report. Everything works fine.

      I just have one issue that when we remove '#' from the WEBi prompt screen. How to get it back ?

      Below is the screen with '#' value .


      Now i removed the '#' value from the prompt screen.


      ISSUE : how to get the '#' value back for the Fiscal year period ?


      Ashutosh Singh

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Ashutosh,

      As per my understanding the "#" value should be there in the list of values for the prompt.

      Please check and let me know.



      Author's profile photo Former Member
      Former Member

      Hey Sujitha,

      Yea even i thought so that i will find it in WEBi prompt. But i couldn't find. The least value that i could see is "001.2002".

      I am thinking that this might be a setting issue with FISCPER infoobject.

      I think in the below highlighted portion it should be "values in the master data table".



      Ashutosh Singh

      Author's profile photo Sateesh Kumar
      Sateesh Kumar

      HI Ashuthosh,

      If you are using Universe , then extent your fiscal period prompt syntax by adding "free". With this you can enter values for prompt selection.

      Author's profile photo Former Member
      Former Member

      Hi Satish,

      I am not using Universe . I am directly using BEx Query for my WEBi report.



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Ashutosh,

      Yes, I suppose since in your infoprovider there is no # value for the characteristic that is why it is not appearing, so you would have to change the setting.



      Author's profile photo Former Member
      Former Member

      Hi Sujitha,

      We have a similar requirement in our BO reports, where both default value along with prompt is required.

      we are trying to follow the same here, but facing difficulty in coding part. Will it be posiible to post/ send the full code used for the user variable.


      Author's profile photo Former Member
      Former Member

      Is it possible to schedule a Webi report based on another input, i.e. expose a time in which a process was finished (this can be obtained via a SQL call, etc). The issue is that if a user schedules a report for 9PM but a process to move data, etc has not completed then that forces them to keep re-freshing the report hoping that the process is complete. Thank you.

      Author's profile photo Former Member
      Former Member

      Hi Sujitha,

      Why you say "Since, there is no such option in BO (as of now at least ) to have a prompt with default values" ?

      Is it possible to do the same on the publications without create a BW variable on new version? Can you explain me that? I expected on 4.1 be able to create a variable in BO to do exactly what you are exposing and seems to be wrong. See my discussion.

      Thank you

      Author's profile photo Former Member
      Former Member


      As per the above document i gone thru.I am creating WEBI reports on BICS connectivity But the same is not working when Report runs on any of the particular Webi it is not allowing me to choose '#' value where as it is applicable for Calyear & Month.In this case we gone through a constant date '01.01.1990' if the condition works it will execute the code and will bring the current date data.if user wants to run for any of the history data he can run.

      (Consider the comments just as addins )

      Thank you.

      Author's profile photo Rahul P
      Rahul P


      I have same requirement to calculate Prior Day using 0CALDAY which is in InfoProvider.

      Here user don't enter any value but we have to calculate prior day value for the respective 0CALDAY value for all the days dynamically and use it for restricting to calculate Qty Prior Day column in report.

      Can you please help to write code, please find the sample code below?

      Example code:

      when 'ZVAR_PDAY'.

      IF I_STEP = 2.

      = '0CALDAY'.

      IF SY-SUBRC <> 0.
      *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      Clear l_s_range-low.


      l_s_range-low = PRIOR_DAY.
      -sign = 'I'.
      -opt = 'EQ'.





      Author's profile photo Former Member
      Former Member

      Really good one Sujitha, thank you very much for sharing this.

      Author's profile photo Uladzislau Pralat
      Uladzislau Pralat

      Hi Sujitha,

      I would simplify your logic eliminating #.

      If report is run online and user populates External Month variable then its value is copied to Internal Month variable

      Elseif report is scheduled or online user did not populate External Month variable, then Internal Month variable is set to whatever default value should be.


      Regards, Uladzislau