Skip to Content
0
Jun 07, 2018 at 07:30 PM

read_mbr_data and selection condition(badi)

251 Views

Hello Friends,

Env- BPC 10.1/BW7.4

I have a requirement to read the member data from a dimension based on a flag, set on a dimension property. I use read_mbr_data function and populate the selection criteria in lt_sel.

I used sample code from sap help. It works well.

https://blogs.sap.com/2012/06/04/useful-abap-code-in-bpc-7x-nw-version/

Now I have an additional requirement to read the data from the dimension based on multiple flags set on multiple dimension properties. I have populated lt_sel for all the required conditions. But it seems the lines in lt_sel works like an AND condition. It returns data only if all the criteria set in all the lines of lt_sel are true.

I am looking for an OR condition, where it gives me data if any one condition is met.

an example - I need to get the data for all the time periods, where the current_time as well as the prior time is set to Y.

ls_sel–dimension = ‘TIME’.

ls_sel–attribute = ‘CURRENT_TIME’.

ls_sel–sign = ‘I’.

ls_sel–option = ‘EQ’.

ls_sel–low = ‘Y’.

APPEND ls_sel TO lt_sel.

Clear ls_sel.


ls_sel–dimension = ‘TIME’.

ls_sel–attribute = ‘PRIOR_TIME’.

ls_sel–sign = ‘I’.

ls_sel–option = ‘EQ’.

ls_sel–low = ‘Y’.

APPEND ls_sel TO lt_sel.

Clear ls_sel.

I have a workaround of calling the read_mbr_data multiple times for each criteria and then merging up the internal tables. But it would lead to multiple hits to the db, which I would like to avoid.

Thanks for your time.

Ed