How To Use Badis (Business Add-Ins) For Subsequent Processing in BW Data Staging
How To Use Badis (Business Add-Ins) For Subsequent Processing in BW Data Staging
How To Use Badis (Business Add-Ins) For Subsequent Processing in BW Data Staging
SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials.
These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the
implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages
that may result from the use of these materials.
SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within
these materials. SAP has no control over the information that you may access through the use of hot links contained in these
materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party
web pages.
HOW TO … USE BADIS FOR SUBSEQUENT PROCESSING IN BW DATA STAGING
1 Business Scenario
When executing data loads into BW, you often want to trigger subsequent processes automatically.
Those subsequent processes could include standard processes related to data staging (like
aggregate roll-up, infocube compression, ODS content activation or the rebuild of indices). However,
there also could be other subsequent processes, which are typically not part of the standard load
process (like the transmission of internet e-mails, or the execution of custom ABAP/4 reports).
This document describes a general-purpose interface, which gives you full flexibility over the
execution of processes, triggered by the data extraction into BW.
In the appendix also some sample ABAP Objects coding is listed, which can be used to execute an
SAP Office mail via the BADI.
2 Introduction
For subsequent processing in data staging in BW, there are 3 basic options available:
- Trigger of events, which can be picked up by other programs / processes / event chains.
- Call-up of a function module, supplied by SAP (this feature was implemented originally for BW1.2,
however should not be used anymore moving forward).
- Trigger of a Business Add-In (BADI).
This step-by-step guide explains the required steps to implement, test and troubleshoot the BADI
implementation.
Although the implementation of the BADI is fairly easy, you should have some knowledge and
experience in the following areas:
- BW scheduling and administration
- Business Add-Ins (see for example Online Documentation: Basis >> Changing the SAP Standard
>> Business Add-Ins)
- ABAP/4 programming (ideally some ABAP Objects programming)
- ABAP/4 debugger
Finally, also note that (while the upgradebility of the BADI interface is supported by SAP), like always
when you perform custom development, SAP cannot guarantee the correctness and upgradebility of
your coding. Hence, before indulging into extensive Add-In development, it is highly recommended to
first analyze the business needs, and to weight them against the potential risks. Also, make sure that
you familiarize yourself first with the standard BW functionality – you might actually not need to use
the BADIs, in many situations. Also please note, with BW Rel. 3.0 SAP started to ship Process
Chains, which might further reduce the demand for BADIs.
method IF_EX_BW_SCHEDULER~USER_EXIT.
* data: LSN.
* if sy-uname eq 'LOTHAR'.
* do.
* exit.
* enddo.
* endif.
case Source.
when 'LSRSCRM'.
exporting
document_data = document_data
document_type = 'RAW'
* put_in_outbox = ' '
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
tables
* OBJECT_HEADER =
object_content = i_object_content
* OBJECT_PARA =
* OBJECT_PARB =
receivers = i_receivers
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
when others.
endcase.