Вы находитесь на странице: 1из 9

Internal ABAP Training

Contents

1. Correlation Databases..........................................................................................................1 2. ABAP Dictionary.................................................................................................................2 3. Object Navigator..................................................................................................................4 4. Reports..................................................................................................................................5 4.1 Variables and definitions...............................................................................................5 5. Internal Tables......................................................................................................................6 6. Subroutine.............................................................................................................................7 7. Functions..............................................................................................................................8 8. Selection Screens..................................................................................................................9 9. Debugging............................................................................................................................9 10. SQL Trace..........................................................................................................................9

1. Correlation Databases
Keys, Indexes, Table Fields and Types. If a field is indexed- it gives the ability to sort by this field. However this indexation creates a hidden virtual index tables. Which slows down the process of usage and update. SM59- Sequential Read trace- if ongoing- it is too slow. The relationships can vary from 1: 1, 1: N, N: M- usually transformed into multiple 1: N. The relationships are handled by the Structured Query Language, keeping the ANSI standards with commands: - Select: Get Data. Source- Target- From Where- Order.

Select * MATNR {space} ERSDA into Variable Where MATNR like 18%. Join- Inner Join, Left Join, Right Join, Outer Join - Update: Update Data Update MARA (table) set MEINS (field)= CS Where MATNR= 185719 - Insert: Insert New Data Insert MARA Values ( , , ) (quote all fields to update). - Delete: Delete data Delete MARA Where MATNR= 185719

2. ABAP Dictionary
SE11- ABAP Dictionary SE80- Object Navigator

Lock Object- To lock entries in a table to update them- to avoid multiple user interventions. Domain- used by the data elements and not by the programmer himself. The domain is the one holding the path to the field Help. The search priority- is ABAP program, then standard SAP Help. One domain can be used by many data elements. Data Type: Structures- does not really contain data- it gives you the freedom to define variables with multiple table sources (like combine data from 5 different tables).

Define maintenance parameters in the following tab:

3. Object Navigator
SE80 Package- the highest level 4

Report- SE38 Include- SE38 A way to handle different variables in a report- for more clarity and visibility. Function Modules- SE37 Function Groups Message Classes- SE91 Transaction: SE93

4. Reports
Visual Settings:

4.1 Variables and definitions


DATA- the way to define a variable: Each line code starts with KEY_WORD and ends with full stop .

Mere clicking on a function line and pressing F1 will bring the Help menu:

F1

Important codes for Cycling (repeating an action multiple times): DO<n times> SY-Index= 1 =2 =n EXIT.- mark an end of a cycle ENDDO. WHILE- Has the same logic og usage

5. Internal Tables
Like or Occurs- identify an Internal Table usage. They are Standard, Sorted and Hashed.

When heather is defined, it is used as a buffer part of the table, where data form a row is stored at loop. If no heather is defined- one should define a new variable. SORT can be applied after a table is filled with SELECT. A much faster way is to work with Views, instead of tables. Derived by checking in which views the table participates. The SELECT is much simpler and faster. As opposed to the Data Dictionary Table- who are saved and written to a hard disc, variables such as lt_ , ls_...- are temporary, Internal Tables. Good examples can be found in: SE38

SE30- Runtime Analysis

6. Subroutine
Used when there is a repetition in the code. Like Selecting a document and printing it, when each time we call up a new Document ID.

FORM . . END FORM. Example: This is a definition of Subroutine called multiply:


*********************************************** FORM multiply USING iv_var1 TYPE i iv_var2 TYPE i CHANGING ev_var3 TYPE i. ev_var3 = iv_var1 * iv_var2. ENDFORM. "multiply

It is then used in the code to perform 3 different multiplications, each time calling the multiply subroutin:
PERFORM multiply USING 5 6 CHANGING lv_result. WRITE:/ 'Multiply 5*6', lv_result. PERFORM multiply USING 15 16 CHANGING lv_result. WRITE:/ 'Multiply 15*16', lv_result. PERFORM multiply USING 35 56 CHANGING lv_result. WRITE:/ 'Multiply 35*56', lv_result.

SE37- Functions Functions are like Subroutine, however it is standalone, and can be used by many programs

7. Functions
Programs that call Functions. You have to define Entry and Exit parameters.

8. Selection Screens

Normal Screens If a program has the Execute Clock button- 90% of the cases the program uses Selection Screen. Otherwise form System Status, and the Screen Number is 1000- it is a selection screen.

9. Debugging
Enter debug mode- /h in a standard transaction F5 F8 F5- Process one step forward. SE24: Class Builder

10. SQL Trace


MM03 Open new session and exec ST05 Trace with Filter for own user Execute transaction Dipslay Trace

Вам также может понравиться