The following flow chart diplays the most important processing layers of queries based on such virtual providers. When analyzing queries in RSRT(note 1591837 'How to analyze query results') , the mentioned ABAP Objects can be used to set propper breakpoints and check the relevant internal tables (see also note 1592982). This should help you to figure out fast which processing layer does not work as expected. In the following we mainly refer to Variant 2 (of Description of the Interface ) of the interface as described below (Description of Interface).
Step-by-Step Debugging Guide
- Simplify the query, in particular assure that the query only accesses the affected virtual provider (e.g. by setting a global filter for 0INFOPROV)
- Run query in RSRT and check which selections are transferred from the OLAP Engine to the DataManager. You can use the default breakpoint called OLAP Processor/DataManger(FILL_SP) and check the internal table
- BW74: <l_sx_rr>-seldr (method p_r_rsdrc_read_olap->read)
- BW73: <l_sx_rr>-seldr (function RSDRC_INFOPROV_READ_OLAP)
- Set breakpoint at the function assigned to the Virtual Provider. In the flow chart above we called it ZFUNCTION_VIRTUAL.Take a look at the internal table I_T_RANGE (and I_TX_RANGETAB)
- Check the data (e_t_data) returned by this function (ZFUNCTION_VIRTUAL) to the DataManager
- internal table e_t_data: the fields use internal IDs instead of the technical name of the infoobjects. E.g.
- S____005: SIDs for characteristic with ID=5: in the table /BI0/SIOBJNM you can look up the name of the object (select SID=5)
- K____005: Keys for characteristic with ID=5:
- Z____049_SUM: Key Figure with ID=49: in the table /BI0/SIOBJNM you can look up the name of the object (select SID=49)
- Check the data transferred from the DataManger to the OLAP Engine in the table <l_t_data>
- Please note that the query might process more than one data package. Importing Parameters like e_end_of_data and e_more_data are set to 'X' when there is no more data.
- Global selections are stored in the table O_T_RANGE, Local selections are stored in the table O_TX_RANGE when calling the function. The table O_TX_RANGE is empty if Only Global Selection Conditions is active (see below). In this case the system still tries to determine a superset of all locale selections which can be added to the global selections.
- Always check whether Infoprovider settings (see below) are as required
Creating VirtualProviders with Function Modules
If you create a virtual provider based on a function, you need to specify which features the function is able to handle. According to these properties, the data manager provides various function module interfaces for converting the parameters and data.
The most important settings are (see Creating VirtualProviders with Function Modules for further details) as follows. They mainly concern various options to support the selection conditions. These conversions only change the transfer tables in the user-defined function module. The conversions do not change the result of the query because the restrictions that the function module does not process are checked later in the OLAP processor!
- Do not Transform Selection Conditions: If this option is switched on, all selection conditions are passed to the function module, without being converted first.
- Supports Navigation Attributes: If this option is selected, navigation attributes and restrictions applied to navigation attributes are passed to the function module. If this option is not selected, the navigation attributes are read in the data manager once the user-defined function module has been executed. Restrictions applied to the navigation attributes are not passed to the function module in this case
- Derive Sel. Conditions from Navigation Attribute: This flag indicates whether selection conditions for navigation attributes are to be transformed into selection conditions of the attribute-carrying characteristic. This is only possible with InfoProviders that do not support any navigation attributes.
- Support of Selection Conditions
- No support: If this option is selected, no restrictions are passed to the function module.
Only Global Selection Conditions: If this option is selected, only global restrictions (FEMS = 0) are passed to the function module. Other restrictions (FEMS > 0) that are created, for example, by setting restrictions on columns in queries, are deleted.
Hierarchies: If this option is switched on, the relevant InfoProvider supports hierarchy restrictions. This is only possible if the InfoProvider also supports SIDs!
Data Format and Data Transport
SID Support: If the data source of the function module can process SIDs, you should select this option. If this is not possible, the characteristic values are read from the data source and the data manager determines the SIDs dynamically. In this case, wherever possible, restrictions that are applied to SID values are converted automatically into the corresponding restrictions for the characteristic values..
- Internal Format(Key Figures): In SAP systems, a different format is often used for displaying currency key figures. The value of this internal format differs from the correct value as the decimal places have moved. You can determine the correct value of this internal display using the currency tables. If this option is switched on, the InfoProvider provides the data in the internal format and this conversion is taken into account during the calculation in the Analytical Engine.
Sometimes (e.g. if you want to compare settings between different cubes) it is convenient to know the technical fields in the Table RSDCUBE which correspond to the settings listed above:
- NOTRANSFRESTR –> Do not Transform Selection Condition
- SVNAVATTR –> Supports Navigation Attributes
- SVTRANSFSEL –> Derive Sel. Conditions from Navigation Attribute
- SVRESTRNO –> No Support of Selection Conditions
- SVSUPPHIER –> Supports Hierarchies
- SVSID –> SID Support
- SVRESTRGLOBAL –> Only Global Selection Conditions
Description of the Interfaces
Different variants are allowed for the interface of the user-defined function module. These variants depend on the options you have chosen for the VirtualProvider, see Description of the Interface for further details.
SAP advises against using the interface with SID Support. The interface is intended for internal use only and is only mentioned here for completeness. Note that the structures used in the interface may be changed by SAP.
If the properties 'SID support' and 'Pack RFC' are not active (most used variant for customer specific functions), the Variant 2 of Description of the Interface of the interface is used. The most important paramters are
- i_infoprov: technical name of Infoprovider
- i_th_sfc: requested characteristics
- i_th_sfk: requested key figures
- i_t_range: global filter selections (FEMS =0)
- i_tx_rangetab: local filter selctions (FEMS >0); this table is always empty in case the option 'Only Global Selection Conditions' was selected
- In general, always double check whether these options are set correctly and your function really supports the chosen features! Incorrect settings may lead to wrong query results and terminations.
- If you flag the option 'Support Hierarchies' (which means that the function chosen for this virtual provider is able to handle hierarchies!) you need to flag 'SID Support' as well (see above 'Descrition of Interface'!) !
- If the query allocates too much memory or the query performnace is very bad: check whether all query restrictions are transferred as expected to the function
- if yes, check whther the function applies all theses selections correctly
- if no, check the provider settings, in particular 'Support of Selection Conditions)
- In case of incorrect data you need to check first whether the function returns the expected data records (to the DataManger)
- in case you use delivered functions like RS_BCT_FIGL_DATA_GET_VC10(RS_BCT_FIGL_DATA_GET) or RSSEM_CONSOLIDATION_INFOPROV3, you need to use the settings required by these functions. To get an idea you could check the settings defined for delivered cubes. E.g. search in table RSDCUBE for OBJVERS=D and FUNCNAME='....' and compare the settings.