Click here to load reader

ABAP Development for SAP NetWeaver BI - User Exits and BAdIs · PDF fileDirk Herzog ABAP Development for SAP® NetWeaver BI: User Exits and BAdIs Bonn Boston 255_5274_Book.indb 3 1/5/09

  • View
    242

  • Download
    4

Embed Size (px)

Text of ABAP Development for SAP NetWeaver BI - User Exits and BAdIs · PDF fileDirk Herzog ABAP...

  • Dirk Herzog

    ABAP Development for SAP NetWeaver BI: User Exits and BAdIs

    Bonn Boston

    255_5274_Book.indb 3 1/5/09 3:30:50 PM

  • 5

    Contents

    Preface to the 2nd Edition ......................................................................... 9

    1 Introduction .............................................................................. 11

    2 Performance .............................................................................. 15

    2.1 Table Types in ABAP ................................................................... 152.2 Loops and Read Accesses to Tables ............................................. 182.3 Field Symbols ............................................................................. 202.4 Database Accesses and Cache ..................................................... 22

    3 User Exits and BAdIs in the Extraction Process ....................... 25

    3.1 Usage Options ............................................................................ 253.2 Generic Extractors ....................................................................... 263.3 User Exit RSAP0001 .................................................................... 31

    3.3.1 How to Use the Exit ......................................................... 323.3.2 Structured Composition of the ZXRSAU01 Include ........... 343.3.3 Implementing the User Exit EXIT_SAPLRSAP_001 for

    Currency Extraction .......................................................... 393.3.4 Using the Hierarchy Exit ................................................... 413.3.5 Surrogate for the Generic Hierarchy Extractor ................... 433.3.6 Transferring Parameters to the User Exit ............................ 44

    3.4 BAdI RSU5_SAPI_BADI ............................................................... 453.4.1 Methods .......................................................................... 453.4.2 Advantages and Disadvantages ......................................... 46

    4 User Exits in Data Import Processes ........................................ 49

    4.1 Transformation ............................................................................ 494.1.1 Deriving Characteristics .................................................... 514.1.2 Deriving Key Figures ......................................................... 564.1.3 Start Routine in the Transformation .................................. 60

    255_5274_Book.indb 5 1/5/09 3:30:50 PM

  • 6

    Contents

    4.1.4 End Routine in the Transformation ................................... 644.1.5 Expert Routine in the Transformation ................................ 67

    4.2 Routines in the Data Transfer Processes ...................................... 764.2.1 Selecting a File Name in the Data Transfer Process ............ 774.2.2 Determining a Characteristics Selection in the Data

    Transfer Process ................................................................ 794.3 Importing a Hierarchy from an Unstructured Excel Sheet ............. 82

    4.3.1 Creating the DataStore Object .......................................... 844.3.2 Creating the DataSource ................................................... 844.3.3 Creating the Transformation ............................................. 864.3.4 Creating the Start Routine ................................................ 884.3.5 Creating the End Routine .................................................. 894.3.6 Creating a Data Transfer Process ....................................... 984.3.7 Creating a Query .............................................................. 1004.3.8 Implementation in SAP BW 3.x ........................................ 100

    4.4 Transfer Rules in SAP BW 3.x ...................................................... 1014.4.1 Start Routine in the Transfer Rule ..................................... 1024.4.2 Routine for InfoObject Derivation .................................... 1084.4.3 Implementing the InfoObject Derivation .......................... 114

    4.5 Update Rules in SAP BW 3.x ....................................................... 1164.5.1 Start Routine ................................................................... 1184.5.2 Filling of Fields in a Data Structure ................................... 1214.5.3 Characteristic Calculation ................................................ 1224.5.4 Key Figure Derivation ....................................................... 1254.5.5 Unit Calculation ............................................................... 1264.5.6 Return Table ..................................................................... 129

    5 User Exits and BAdls in Reporting ........................................... 131

    5.1 Variable Exit RSR00001 .............................................................. 1315.1.1 Interface of Function Module EXIT_SAPLRSR0_001 .......... 1335.1.2 Implementation for I_STEP = 1 ......................................... 1375.1.3 Implementation for I_STEP = 2 ......................................... 1425.1.4 Implementation for I_STEP = 0 ......................................... 1455.1.5 Implementation for I_STEP = 3 ......................................... 1465.1.6 Validating an Individual Variable ....................................... 1485.1.7 Checking Characteristic Combinations in Step 3 ................ 150

    5.2 Virtual Key Figures and Characteristics ........................................ 1535.2.1 Advantages and Disadvantages ......................................... 154

    255_5274_Book.indb 6 1/5/09 3:30:50 PM

  • 7

    Contents

    5.2.2 Implementation ................................................................ 1555.2.3 Other Useful Information .................................................. 1665.2.4 Transferring Variable Values to the BAdI ........................... 166

    5.3 VirtualProviders .......................................................................... 1685.3.1 Creating a VirtualProvider ................................................. 1685.3.2 Dos and Donts for the Implementation of the Service ..... 173

    5.4 BAdI SMOD_RSR00004 .............................................................. 1775.5 Implementing Own Read Routines for Master Data .................... 181

    5.5.1 Creating a Master Data Read Class .................................... 1825.5.2 Sample Implementation of a Master Data Read Class ........ 1895.5.3 Entering the Class in the InfoObject ................................. 196

    6 User Exits in Planning ............................................................... 199

    6.1 Variables in Planning ................................................................... 1996.1.1 Variables in SAP BW-BPS .................................................. 2006.1.2 Variables in SAP NetWeaver BI Integrated Planning .......... 208

    6.2 Characteristic Value Derivations .................................................. 2116.2.1 Characteristic Value Derivations in SAP BW-BPS ............... 2116.2.2 Characteristic Value Derivations in SAP NetWeaver

    BI Integrated Planning ...................................................... 2206.3 Exit Functions in Planning ........................................................... 229

    6.3.1 Exit Functions in SAP BW-BPS .......................................... 2306.3.2 Exit Functions in SAP NetWeaver BI Integrated Planning ... 238

    6.4 Conclusion .................................................................................. 246

    7 Summary ................................................................................... 247

    Appendices

    A Additional Extension Options ............................................................... 251A.1 Other BAdIs and User Exits in SAP NetWeaver BI ........................ 251

    A.1.1 BAdIs ............................................................................... 251A.1.2 Exits ................................................................................. 252

    A.2 Generated Tables and Objects in SAP NetWeaver BI ................... 252A.2.1 Tables in InfoCubes ........................................................... 253A.2.2 Tables in DataStore Objects .............................................. 254

    255_5274_Book.indb 7 1/5/09 3:30:50 PM

  • 8

    Contents

    A.2.3 Tables in InfoObjects ........................................................ 254A.2.4 Data Structures in the Dataflow ........................................ 255A.2.5 Generated Objects in SAP NetWeaver BI .......................... 255

    B The Author ................................................................................. 257

    Index ........................................................................................................... 259

    255_5274_Book.indb 8 1/5/09 3:30:50 PM

  • 49

    User Exits in Data Import Processes4

    Whereas the adjustment of extractor results predominantly occurs only with selected DataSources, most data import processes in SAP NetWeaver Business Intelligence involve a user exit that is run through between the DataSource and the InfoProvider. This may be done for conversion purposes, for the derivation of new characteristics, or for data cleansing. Because the entire logic of SAP NetWeaver BI has been changed significantly in SAP NetWeaver 7.0, Section 4.1, Transformation, provides a detailed description of the transformation options that have been newly implemented. Com-pared to the options available in the transfer and update rules, the trans

Search related