Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhimanyu_sharma
Contributor

Problem - We had an problem in one of our assignments to schedule the BOBJ reports with Dynamic Dates.


For example – If the report need to be scheduled daily/weekly/Monthly then we have to change the date parameter of the report accordingly based on the system date..


Solution –

1. We created the Formula variable say TEST_FV as manual Entry in BEx Query.

2. We created the customer exit variable on our date variable say TEST_DATE

3. In the customer exit we then read the Formula variable and apply the below cases:


When  TEST_DATE.
     

        

       
read table i_t_var_range into loc_var_range with
                                  
key vnam =’TEST_FV’.
        

        
case loc_var_range-low.


          
when 1.    This is for daily scheduling.
             l_date_low
= sy-datum - 1.
             l_date_high
= sy-datum - 1.
             l_s_range
-opt   = 'EQ'.


          
when 2.   This is for Weekly Scheduling.


             l_date_low
= sy-datum - 7.
             l_date_high
= sy-datum - 1.
             l_s_range
-opt   = 'BT'.


          
when 3.  This is for scheduling the report on Current Month to date


             l_date_low
(6) = sy-datum(6).
             l_date_low+6
(2) = '01'.
             l_date_high
= sy-datum - 1.
             l_s_range
-opt   = 'BT'.


          
when 4. This is for scheduling the report on previous Month to date


             l_date_low
(6) = sy-datum(6).
             l_date_low+6
(2) = '01'.

             l_date_high
= l_date_low - 1.
             l_date_low
(6) = l_date_high(6).
             l_date_low+6
(2) = '01'.
             l_s_range
-opt   = 'BT'\

Append l_s_range into e_t_range.


4.        Go to BI launch Pad

5.         Open the Documents and schedule the respective WeBi report.

6.         Schedule the webi report as normally we do.

7.      But in this case, in the prompt section we have to specify our variants like below:




As,we can see in the screenshot, we put 1 in the Input variable for date which is our formula variable TEST_FV. As we set 1, the report will schedule daily based on the system date and give the output accordingly.

This is the logic we built to schedule the BOBJ reports based on the system date.

5 Comments
Labels in this area