Beruflich Dokumente
Kultur Dokumente
Applies to:
SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C & above), SAP Netweaver BW 7.x. For more
information, visit the EDW homepage
Summary
As of SAP_BASIS 6.20 and PI_BASIS 2004_1 (R/3 Release 4.6C) is available a more efficient way to
enhance SAP standard content, using Business Add-In (BAdI - RSU5_SAPI_BADI) instead of using the
classical approach of user exits.
Author:
Author Bio
Brinto Roy is a SAP BI / BO Consultant with over 4 years of experience. He is currently working at Deloitte
Consulting India Pvt. Ltd.. He also has extensive experience in Business Objects suite of products.
Sohil Shah is working as Senior consultant at Deloitte Consulting India Pvt. Ltd. He has an experience
around 7 years in the field of SAP. He is the technical reviewer of an SAP Press book A Practical Guide to
SAP Netweaver Business Warehouse 7.0
Table of Contents
Business Scenario .............................................................................................................................................. 3
BAdI Implementation Steps ................................................................................................................................ 3
Appendix 1 .......................................................................................................................................................... 5
Related Content .................................................................................................................................................. 7
Disclaimer and Liability Notice ............................................................................................................................ 8
Business Scenario
In a projects with multiple locations within the same region & in the same time zone will face issue, of
multiple use of the Exit, with the conventional method of enhancing DataSources using Customer Exit (Tr.
Code: CMOD). With the introduction of BadI (RSU5_SAPI_BADI), we can enhance as many DataSources as
required at a time across the location.
SAP provides the definition of the BADI (RSU5_SAPI_BADI), and we need to create the
implementation using the Transaction code SE19 as shown in figure 1:
On the next pop up screen, we need to define our implementation name as shown in the figure 2. Plz
note to check the checkbox Multiple Use as shown on the Attributes tab.
Click on Interface Tab, where we will have information about the Implementing Class & methods.
Appendix 2 will show the Generic code for the DataSource enhancement SE38 Report.
Appendix 1
DATA: ls_oltpsource TYPE rsaot_s_osource,
lv_data TYPE REF TO data,
lv_method TYPE seocmpname.
FIELD-SYMBOLS: <lt_data> TYPE STANDARD TABLE.
DATA: l_prog_name TYPE C LENGTH 40.
* check BW system
* check _check_bw_system( ) = 'X'.
* check if any data is extracted
CHECK c_t_data IS NOT INITIAL.
CALL FUNCTION 'RSA1_SINGLE_OLTPSOURCE_GET'
EXPORTING
i_oltpsource
= i_datasource
i_objvers
= 'A'
IMPORTING
e_s_oltpsource = ls_oltpsource
EXCEPTIONS
no_authority
= 1
not_exist
= 2
inconsistent
= 3
OTHERS
= 4.
IF sy-subrc <> 0.
EXIT.
ENDIF.
* Create data for Extract Structure
CREATE DATA lv_data TYPE TABLE OF (ls_oltpsource-exstruct).
ASSIGN lv_data->* TO <lt_data>.
ASSIGN c_t_data TO <lt_data>.
CONCATENATE 'ZBWI_' i_datasource INTO l_prog_name.
PERFORM execute_user_exit IN PROGRAM (l_prog_name)
TABLES I_T_SELECT
I_T_FIELDS
<LT_DATA>
C_T_MESSAGES
IF FOUND.
Appendix 2
Create a Program in SE38 specific for each DataSource. For example, if we need to enhance
2LIS_11_VAHDR (Sales Order Header DataSource) then the program ZBWI_2LIS_11_VAHDR needs to be
created for the same.
Note: Naming convention ZBWI_<DataSource name>.
Make sure the Program type Executable Program and status is Customer Production Program.
REPORT zbwi_2lis_11_vahdr.
TYPE-POOLS: sbiwa.
* Data Definition
* DATA: lt_vbak type standard table of vbak,
* ls_vbak type vbak .
* FIELD-SYMBOLS: <L_S_DATA> TYPE <Extract structure name>.
*&---------------------------------------------------------------------*
*&
Form execute_user_exit
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->I_T_SELECT
text
*
-->I_T_FIELDS
text
*
-->C_T_DATA
text
*
-->C_T_MESSAGES text
*--------------------------------------------------------------------FORM execute_user_exit
TABLES i_t_select TYPE sbiwa_t_select
i_t_fields TYPE sbiwa_t_fields
c_t_data STRUCTURE <Extract structure name>
c_t_messages STRUCTURE balmi.
* Perform select
SELECT * FROM VBAK INTO TABLE lth_vbak
FOR ALL ENTRIES IN C_T_DATA
WHERE VBELN = C_T_DATA_VBELN.
* map the data
LOOP AT C_T_DATA ASSIGNING <L_S_DATA>.
READ TABLE lth_vbak into ls_vbak
with table key vbeln = <L_S_DATA>-vbeln.
if sy-subrc is initial.
<L_S_DATA>-VKORG = ls_vbak-vkorg.
Note: MODIFY statement is not required as the field will be populated immediately in the Internal table by using Field
Symbols.
endif.
* ENDLOOP.
ENDFORM.
Related Content
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0af763b-066e-2910-a784dc6731660f46?QuickLink=index&overridelayout=true
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0eade6c-692a-2c10-ac8680f6b2157791?QuickLink=index&overridelayout=true
For more information, visit the EDW homepage