Ansicht
Dokumentation

BW_BADI_IP - BAdI: BAdI-Provider

BW_BADI_IP - BAdI: BAdI-Provider

RFUMSV00 - Advance Return for Tax on Sales/Purchases   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

The Enhancement Spot RSO_BADI_PROVIDER is used in the context of the BAdI-Provider in BW/4 HANA. The BAdI-Provider does not provide a graphical editor, instead the BAdI Defintion RSO_BADI_PROVIDER needs to be implemented to provide the corresponding metadata.

The BAdI is filter-dependent. Create a separate implementation for each InfoProvider. The BAdI does not allow multiple active implementations at runtime, and the instances can be reused. This allows the usage of instance methods and attributes, and the usage of exporting and changing parameters in the method signatures.

The BAdI is using the option Limited Filter Use, which means that the BAdI definition has exactly one filter.

For the filter, the following rules apply:

1.,,Each BAdI-Implementation must define exactly one filter expression.

2.,,As comparator in filter values, only the equals sign '=' is allowed.

3.,,The length of the filter value must have a length between 3 and 10.

4.,,Only characters A-Z and Numbers 0-9 are allowed.

The BAdI provides the interface IF_RSO_BADI_PROV, which needs to be implemented in a class.

Metadata

The BAdI-Provider does not provide a graphical modeling interface. Its metadata are solely derived from an implementation of the BAdI-Interface.

GET_INFOPROVIDER_NAMES

This method returns the name of the InfoProvider, which must be identical to the filter value assigned to the implementation. Since the technical name of InfoProviders must be unique, the prefix 3B is added by BW/4 to the technical name of the InfoProvider.

Sample code:

METHOD if_rso_badi_prov~get_infoprovider_names.

  DATA: l_s_ipro TYPE if_rso_badi_prov=>tn_s_infoprovider.

  l_s_ipro-infoarea_name = 'MY_INFOAREA'.

  l_s_ipro-infoprovider_name = 'MY_BDPR'. "same as filter

  l_s_ipro-description = 'BAdI-Provider 1'.

  INSERT l_s_ipro INTO TABLE e_th_infoprovider.

ENDMETHOD.

GET_INFOPROVIDER_FIELDS

This method is used to return the structure of a BAdI-Provider.

  • The structure is determined by BW Characteristics and Keyfigures, only InfoObjects are allowed. The three exporting parameter need to be provided: E_TSX_CHARACTERISTICS, E_TS_KEYFIGURES, E_TS_GROUPS.

  • Characteristics can be added to Groups (also known as Dimensions) similar to other InfoProviders like the DataStore Object or the Composite Provider. The dimensions need to be added to exporting parameter E_TS_GROUPS.

  • Navigation attributes can be added to characteristics (by using the name of the attribute).

  • For all fields (Characteristics, Keyfigures and Navigation Attribute), Provider-specific descriptions can be added (limited to 60 characters).

GET_METADATA_TIMESTAMP

The metadata of the BAdI-Provider can be buffered to avoid performance problems. The buffer is based on a timestamp, which needs to be returned by this interface method. If the returned timestamp is not equal to the timestamp in the buffer, then the buffer entry is deleted and the metadata of the Provider is built from scratch. Therefore it is very critical that a proper timestamp is returned by the implementation of this interface method.

One option is to return the “Last changed” timestamp of your class, which can be determined with the following service:

  TRY.

      r_tstmps = cl_rso_badi_prov_public_srvs=>get_class_timestamp(

                                      i_clsname = ' ).

    CATCH cx_rso_badi_prov_error.

      CLEAR r_tstmps.

  ENDTRY.

Calling this method is very performance-critical, therefore the implementation must ensure a very fast response.

GET_DATA_TIMESTAMP

The returned timestamp should reflect the last data change of the BAdI-Provider. This implementation of this method is not mandatory, however the OLAP Cache can only be used if a proper timestamp is returned.

Query Runtime

Similar to Virtual Provider in NetWeaver BW, a 3rd party application or a customer needs to create an implementation for the read access. The Virtual Provider offers an interface (only for SAP-internal applications) and function template (can be implemented by customers). For the new BAdI-Provider, new interface methods will be provided for the Read Provider Implementation. The interface methods are part of the BAdI-Interface.

RUNTIME_DEFINE

This method defines the query access and is called exactly one time for each atomic query access. Afterwards, the Method RUNTIME_READ is called until no more data exists.

This method prepares the atomic query access and provides the requested characteristics, Keyfigures, and selection criteria (Filter conditions), and so on. The interface is using the same data types as the RSDRI-Interface.

RUNTIME_READ

This method is responsible for fetching the data. The method is called until E_END_OF_DATA is set to ‘X’.

GET_RUNTIME_PROPERTIES

This method can be used to customize the runtime-relevant settings as shown in the table below. If the method is not implemented, then default values are used.

  • no_support_of_sel_cond: If this option is activated, no restrictions (selection conditions) are transferred to the BAdI Implementions. Default: Not Set.

  • do_not_transform_sel_cond: This optimization determines whether complex filters are passed on to the provider implementation or not. As an example, for Semi-Join optimizations (e.g. from restrictions on hierarchies or navigation attributes) there is a default threshold of 100 single value filters. If the number of single value filters exceeds this threshold, be default the filter is not passed but subsequently filtered by the Analytical Engine. Default: Not Set.

  • allow_complex_sel_cond: If this option is not set, then only global restrictions (FEMS = 0) are transferred to the read request (Parameter I_T_RANGE). Other restrictions (FEMS > 0), for example, created by restricting to columns, are deleted. If the option is set, complex restrictions (FEMS > 0) are added to parameter I_TX_RANGETAB. Default: Not set.

  • internal_format_of_key_figures: This property controls whether the Analytic Engine performs a currency shift in order to convert key figures from internal to external currency format. Default: Not Set.

  • provide_exact_data: This optimization can be set if the implementation will always exactly observe all filters specified on the interface. If the implementation cannot handle all possible filter conditions, then the Analytic Engine will need to post filter the returned superset of data. Default: Not set.

  • provide_sorted_data: This optimization can be set if the implementation returns the data already in a sorted table, according to the requested sort order in the list of requested characteristics. Otherwise the Analytic Engine will sort the data itself. Default: Not Set.

  • No_parallelization: Set to X of the provider cannot be read in another roll area (in other words, in a parallel process). Default: Not Set.

Re-Use of Function Modules from the BW Virtual Provider

If you are using the BAdI-Provider as replacement for the Virtual Provider on Function Module, then you can reuse your function module for query access. All you need to do is to call the service class CL_RSO_BADI_PROV_READ_FUNC as shown below.

Private attribute data P_R_FUNC type ref to CL_RSO_BADI_PROV_READ_FUNC.

METHOD if_rso_badi_prov~runtime_define.

  CREATE OBJECT p_r_func EXPORTING i_funcname = ''.

  p_r_func->define(

    EXPORTING

      i_th_sfc                  = i_th_sfc

      i_th_sfc_add              = i_th_sfc_add

      i_th_sfk                  = i_th_sfk

      i_t_range                 = i_t_range

      i_tx_rangetab             = i_tx_rangetab

      i_keydate                 = i_keydate

      i_maxrows                 = i_maxrows

      i_use_aggregation         = i_use_aggregation

      i_t_hieid                 = i_t_hieid,,,,

      i_infoprovider_name       = i_infoprovider_name ).

ENDMETHOD.

METHOD if_rso_badi_prov~runtime_read.

  p_r_func->read(

    EXPORTING

      i_packagesize    = i_packagesize

      i_show_statement = i_show_statement

    IMPORTING

      e_t_data         = e_t_data

      e_end_of_data    = e_end_of_data

      e_t_msg          = e_t_msg ).

ENDMETHOD.

RUNTIME_READ

For more information about implementing BAdIs for the enhancement concept, see the SAP Library for the Enhancement Framework.

RUNTIME_READ






Addresses (Business Address Services)   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 12831 Date: 20240524 Time: 012015     sap01-206 ( 181 ms )