Professional Documents
Culture Documents
Day2-ABAP BW Handbook
Day2-ABAP BW Handbook
Overview
The second day will consist of the following broad level topics
2 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
4 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Delta Type determines how extracted data is to be interpreted in BW, and into which data targets
it can be posted.
1. Additive Delta:
The key figures for extracted data are added up in BW. Data Sources with this delta
type can supply data to ODS objects and Info Cubes.
5 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
This field is used by Data Sources that determine their delta generically using a repetitively-increasing
field in the extract structure.
The field contains the discrepancy between the current maximum when the delta or delta init extraction
took place and the data that has actually been read.
Leaving the value blank increases the risk that the system could not extract records arising during
extraction.
The safety margin between read and transferred data must always be larger than the maximum length of
time that it takes to create a record for this Data Source (With a Time Stamp Delta), or it must display an
interval that is sufficiently large (for determining delta using a serial number).
Real Time:
The 'real time enabled' indicator determines whether a delta-enabled Data Source can be used as a
supplier of data for a real-time daemon.
6 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
7 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
8 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
9 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
10 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
11 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
You may want to implement a delta method on your Generic Data Source
that cannot be implemented by using the generic delta functionality
(timestamp, date,..)
You have to extract data from several DB tables and Using a view is not
possible because of insufficient JOIN. Only some fields of these tables are
relevant Data has to be enriched with information not available in the BW
system
12 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
1. Initialization call:
Only the request parameters are transferred from the module here. It cannot transfer
data at this point.
4. Last call:
The function module is now called until the exception NO_MORE_DATA is produced. No
more data can be transferred in the call in which the exception is produced.
13 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
CUBE1
ODS1
ODS2
Transformation (Here we can write
Start /End Routine as well as Field
Level Routine for the Data Target
i.e. Cube/DSO) Transformation
BW
R/3
R/3 Data Source
(DS1)
15 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Transformation
5)Data Transfer
Process
InfoPackage is used to
request data from a source system.
4)InfoPackage
Source System-1
16 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Transformation Routines
Start Routine
Routine for updating Characteristics / Key Figures : Field Routine
End Routine
Expert Routine
17 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
18 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
19 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
20 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Packet wise operation. Data Arrives in BW in Packet wise operation. Data Arrives in BW in
Data Packets (discreet amounts) which are Data Packets (discreet amounts) which are
2 manipulated. manipulated.
Less performance intensive than Field levels as More performance intensive than start
4 they are fired for all rows. routines.
21 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
22 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
23 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
For dynamic selection – e.g., to extract only the current fiscal period -
then two options exist: OLAP Variables or an ABAP Routine to fill
in the value of the selected data at extraction time.
24 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
25 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
26 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
27 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
28 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
The ABAP Compiler will search the whole table row by row. Even after reaching the row with index 3 it
will start its next search aging from row 1 in the next iteration.
29 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
LOOP AT SOURCE_PACKAGE.
READ TABLE < SORTED TABLE >
WITH KEY COLOUR = ‘Red’
BINARY SEARCH.
IF SY-SUBRC = 0.
“Match is found
L_TABIX = SY-TABIX.
LOOP AT < SORTED TABLE > FROM L_TABIX.
“Reading from pos. 3
IF < TABLE 7.3 >-COLOUR = ‘Red’.
30 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
IF sy-subrc = 0.
L_TABIX = SY-TABIX.
ENDLOOP.
ENDIF.
ENDLOOP
31 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
For Example, If cost center 1000, the long value with left-hand zeros 0000001000
(from the database) is not to be entered, but just to enter 1000, Conversion
routines can be linked to characteristics.
Conversion routines ALPHA, NUMCV, and GJAHR check whether data exists in
the correct internal format before it is updated.
A conversion occurs according to the data type of the field when changing the
content of a field from the display format into the SAP-internal format and vice
versa, as well as for output using the ABAP WRITE instruction.
32 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
ALPHA Conversion:
The most important conversion routine - due to its common use - is the
ALPHA routine that converts purely numeric user input like ‘1234' into '001234'
(assuming that the characteristic value is 6 characters long).
This possibly results in data inconsistencies, also for query selection; i.e. if
you select ‘1234', this is converted into '001234', so '01234' won't be selected.
33 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
34 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
35 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Variant in Details
Program with or
without variant
36 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
The Virtual Characteristic / Key Figure must be added to the cube as an Info Object but
not mapped in update rules or transfer rules.
The inputs by the user during query runtime can be used in the virtual characteristic and
key figure exits.
Transaction RSRT can be used to troubleshoot/ debug virtual characteristics like other
reporting exits.
37 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
DEFINE
Defining query
characteristics
and KF as
attributes of Class
INITIALIZE
BADI Read data from
MDX using FM and
Class populate the
internal table.
COMPUTE
Compare runtime
data of target
query with the
internal table and
populate virtual.
38 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
The CMOD Enhancement is different from the R/3 Enhancement for BEx. Reports.
40 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
The main parameters which we will look into in this scope are:
I_VNAM - It is the variable name of the Customer Exit in the BEx. Report.
I_T_VAR_RANGE - This is an internal table .This table contains the Input data to the B.Ex. Query which
was supplied by the User.
E_T_RANGE - This is a Range which is the Output value of the variable as mentioned in
I_VNAM.
I_STEP - This is a variable which can assume four values 0/1/2/3 depending on which the
Customer variable manipulation is done.
I_S_RKB1D-COMPID - The Report Name which is being executed.
41 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
I_T_VAR_RANGE E_T_RANGE
This is the technical This field states whether the range
name of the variable in is Inclusive (I) or Exclusive (E) for
the Selection Screen of the given values i.e. it includes or
VNAM the B.Ex Report. SIGN excludes the values provided.
This is the mathematical
This is the name of the operation, i.e. whether the variable
Info object on which the will be equal to (EQ) the value in
variable name in VNAM the Range or Less than (LE) the
IOBJNM was created. OPT value in the range and so on.
The Lower value of the Range .If
we are using the Range to Restrict
to one single instead of multiple
then we give that single value here
LOW and leave high as initial.
The Higher value of the Range .If
we are using the Range to Restrict
to one single instead of multiple
HIGH then we leave this as initial.
42 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
I_STEP = 2 :
Call up takes place directly after variable entry. This is mainly used for manipulating the
user input values which were given in the variable screen.
I_STEP = 3 :
In this call up, the values of the variables can be checked. Triggering an exception
(RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is
also called up again.
I_STEP = 0 :
The enhancement is not called from the variable screen. The call up can come
from the authorization check or from the Monitor.
43 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
If i_STEP = 3.
< Local Declaration>
<Logic to be followed for this case >
Endif.
44 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Include ZXRSRU01
I_STEP = 1 Example (Calculating all data starting I_STEP = 2 Example (CODE for Entering months (in Numeric value)
with CAT) and displaying the data for Enter Year - 1)
45 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Include ZXRSRU01
I_STEP = 3 Example (If Fiscal Period range entered by user exceeds two quarters, show Error message)
CASE I_VNAM.
WHEN 'ZS_J2ODS'.
IF I_STEP = 2.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = '0I_FYPER'.
….. Logic to check whether Fiscal Period range entered by user exceeds two quarters.
ADD 1 TO C_RECORD_COUNT. “For each Quarter
ENDIF.
IF I_STEP = 3.
IF C_RECORD_COUNT > 2.
CALL FUNCTION 'rrms_message_handling'
EXPORTING
I_CLASS = 'RSBBS'
I_TYPE = 'E'
I_NUMBER = '000'
I_MSGV1 = 'Fiscal period range can not exceed two quarters'.
RAISE NO_REPLACEMENT.
ENDIF.
ENDIF.
46 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
47 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
48 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007
IBM Global Business Services
Summary
49 ABAP Handbook for BW Developer | Sep 11, 2022 © Copyright IBM Corporation 2007