cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a particular InfoProvider based on variable in BEx Query

venkat_kodi
Participant
0 Kudos

Hi,

The MultiProvider is built on InfoProvider 1, 2 & 3 and a variable on 0CALMONTH. If the 0CALMONTH is CURRENT month then it should get the data from InfoProvider 1 & 3 only, otherwise it should be from InfoProvider 2 &3. How could I accomplish it, please?

Thanks,

Venkat.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhishek_rajan3
Contributor
0 Kudos

Hi Venkat,

You restrict Infoprovider (0INFOPROV) in your query on a selection option characteristic variable with Customer exit processing. In the exit, you can read the Calmonth variable in i_step = 2 in the exit to check if it is CURRENT, in which case restrict the exit variable to 1&3, else 2&3.

Hope it helps.

Thanks,

Abhishek.

venkat_kodi
Participant
0 Kudos

Hi Abhishek,

Do I have to create a Customer Exit processing Type variable ZINFOPR for 0INFOPROV and User Entry Type variable ZCALMNTH for 0CALMONTH where the user enters the Cal Month? Do I have to write user exit like the below:

WHEN 'ZINFOPR'.

IF i_step = 2. "after the popup

LOOP AT i_t_var_range INTO loc_var_range

WHERE vnam = 'ZCALMNTH''.

CLEAR l_s_range.

CLEAR e_t_range.

L_YEAR = sy-datum+0(4).

L_MONTH = sy-datum+4(2).

CONCATENATE L_YEAR L_MONTH INTO w_calmonth.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

l_s_range-high = w_infoprov3.

if w_calmonth = loc_var_range-low+0(6).

l_s_range-low = w_infoprov1.

else.

l_s_range-low = w_infoprov2.

endif.

APPEND l_s_range TO e_t_range.

EXIT.

ENDLOOP.

ENDIF.

Could you please check and correct if it requires any changes.

Thanks,

Venkat.

abhishek_rajan3
Contributor
0 Kudos

Hi Venkat,

This logic looks fine.

Thanks,

Abhishek.

sap_cohort
Active Contributor
0 Kudos

Are you hardcoding those InfoCube Names? We would use a table that held the names of the InfoCubes so when it came time to add another infocube and shift the historical reporting all we had to do is maintain the table. But, it might be just as easy to maintain the variable logic.