Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
8Activity
0 of .
Results for:
No results containing your search query
P. 1
ABAP Coding in BI

ABAP Coding in BI

Ratings: (0)|Views: 354|Likes:
Published by Vijay Chandra
FUNDAMENTALS OF ABAP IN BI
FUNDAMENTALS OF ABAP IN BI

More info:

Published by: Vijay Chandra on Jun 14, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

10/19/2013

pdf

text

original

 
General Guidelines for ABAP coding in BWMohan Kotwal Business CardCompany: Bradford & Galt, Inc.Posted on Jun. 09, 2011 06:24 AM inEnterprise DataWarehousing/Business Warehouse
General guidelines for ABAP coding in BW:Business Case:
ABAP coding is very widely used in any BW implementation for writing routines intransformation. Bad ABAP code written in transformation can adversely affect the dataaccuracy as well as data loading performance. This document is prepared for SAP BWdeveloper to follow some best practices while writing ABAP code in BW. By followingthese best practices, you will be able to achieve best data loading performance as well asdata accuracy.
1) When to use Start Routine:Make use of Start Routine for the scenarios listed below
 
Processing all the data packet records at once. For example, to delete records or update records with new value.
To acquire the runtime information of a data transfer process (DTP).
To populate internal table and utilize in field level routine. 
2) How to define Internal Table:
 1.1.Define TYPE structure.2.Define Internal table referring TYPE defined above.3.Define Internal table as Hashed table or Sorted table with keys.4.Define Internal table without header line.5.Try not to use OCCURS clause because of potential problem in ABAPOO programs.
Example:
TYPES: BEGIN OF TYPE_<name>,…………….END OF TYPE_<name>.
 
DATA: T_<name> TYPE SORTED TABLE OF TYPE_<name>WITH NON-UNIQUE KEY <key1> <key2> ……Or DATA: T_<name> TYPE HASHED TABLE OF TYPE_<name>WITH UNIQUE KEY <key1> <key2> …… 
3) How to Read Internal Table:
Always read Internal table using ASSIGNING Field Symbol unless there is aneed for the Work Area.
Example: 
READ TABLE <itab> ASSIGNING <field_symbol>WITH TABLE KEY <key1> = …..<key2> = …...
4) How to loop on SOURCE_PACKAGE :
Always use Field Symbols while looping on SOURCE_PACKAGE unless thereis a need for the Work Area.
Always use Field Symbols to modify SOURCE_PACKAGE field content.
Example:
LOOP AT SOURCE_PACKAGE assigning <field_symbol>.<field_symbol>-MATERIAL = ….ENDLOOP. 
5) Try to avoid:
 
Avoid SELECT … ENDSELECT.
Avoid multiple SELECT statements on the same table.
 
Avoid SELECT * from <TABLE> statement. Instead specify the explicit fieldslike SELECT <fld1> <fld2> <fld3> from <TABLE>.
Only use SELECT * or SELECT SINGLE * when all the fields are neededotherwise specify the fields individually.
Example:
 SELECT EBELN EBELP MATNR INTO CORRESPONDING FIELDS OF TABLE <itab>FROM EKPO. 
Avoid SELECT statement inside LOOP … ENDLOOP. Instead it is alwaysadvisable to collect all the data in an internal table before starting LOOP…ENDLOOP and then read that internal table inside LOOP…ENDLOOP.
Example:
SELECT EBELN EBELP MATNR INTO CORRESPONDING FIELDS OF TABLE itabFROM EKPO.LOOP AT SOURCE_PACKAGE assigning <SOURCE_FIELDS>.READ TABLE itab ASSIGNING <l_itab>WITH TABLE KEY <key1> = ……. <key2> = ….ENDLOOP. 
Avoid SELECT inside field level routine. Instead it is always advisable to collectall the data in an internal table in the start routine and then read that internal tableinside field level routine.
6) Important DON'Ts
 
DO NOT include the statement BREAK-POINT in any code sent to production.
DO NOT directly update, insert or delete records from SAP tables such as Master data table or DSO Active table.

Activity (8)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
kamalmadineni liked this
Sree Dhar liked this
naveen_thumu liked this
Sanjay Kumar liked this
chandru_abap liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->