Showing posts with label learn abap for free. Show all posts
Showing posts with label learn abap for free. Show all posts

Friday, 5 April 2013

ABAP Dictionary

ABAP data object are stored at application server while the actual data resides at database server.


ABAP Data Dictionary is the Central source of data of SAP system OR ABAP dictionary is the central core component which supports the creation and management of all the data definitions used in the system. ABAP Dictionary is completely integrated with the ABAP development workbench and is active in the development and run-time environments of the SAP system. This ensures that any changes made in the data definitions results in subsequent changes in the all related ABAP programs, function modules, menu, screen painter or any other application where it has been used.  
The major object types in the Data Dictionary are Database tables, views, data type (data elements, structures, table types), domains, search helps and lock objects. The user can create, modify or delete the data definitions using the above objects.
Please note that ABAP Dictionary contains Metadata (Data about data) about the data stored in SAP R/3 system. Thus the definition of the ABAP data object are stored at application server while the actual data resides at database server. The main aim of ABAP Dictionary is to improve the system performance by minimizing the overall database hits and provide a layer of abstraction between the various layers of R/3 system.
To open ABAP Dictionary from the SAP Easy Access Menu Go-To Tools->ABAP Workbench->Development and then Double Click the ABAP Dictionary option listed.  Alternatively, you can do so by entering the transaction code for ABAP Dictionary SE11 in the command field. The transaction SE11 provides you with all the important objects of ABAP Dictionary. However there are other transactions fromSE13 to SE17 for specific purpose related to Dictionary view or modification.

ABAP Dictionary
ABAP Dictionary



The SAP R/3 system comes loaded with the basic business functionality usage data objects. However if you want you can create your own data objects as well. These are called as user defined types. But before creating any of user defined data objects ensure that the one you are creating is already provide by SAP or else you might end up duplicating the object and hence inefficiently utilizing SAP’s features.

A brief Introduction ABAP Dictionary Objects

  1.  Database Table- A table is multi dimensional matrix which is used to store data. There are 3 layers of data description of ABAP data dictionary which is to isolate the end users and even developers from the underlying database management system. The three layers of data description are:-
  •      External Layer – This is the end user view of the database. It mainly consists of how the user sees and interacts with the data. 
  •  ABAP Layer – The ABAP/4 layer describes the data formats used by the ABAP/4 processor. This is the developer’s/programmer’s view of the database. 
  • Database Layer – It is the DBA view of database. It describes the data formats used in the database.
In R/3 database there are two types of tables:- A. Client Dependent  B. Client Independent
  • Client Dependent- Database Tables with their first field name as 'MANDT' and type as 'CLNT' are client dependent tables.
  • Client Independent- All the tables with the first field name is not "MANDT' are client Independent, or in other words, all the tables which are not client dependent are client Independent.
The data in client dependent table is stored and retrieved based on the client number of the user. This is helpful in the scenario where we want developers and testers data to be different. 

Based on SAP R/3 system there are three types of tables: - A. Transparent Table, B. Pool table C. Cluster Table.
A-Transparent Table: - These tables have the same structure both in the ABAP dictionary as well as in the underlying Database.  It means that there is a one to one mapping between the two and the both the dictionary table and database table shares the same name, number of rows and columns. As we create a Transparent table in the Data Dictionary a similar structure table is created in the underlying database as well.
Transparent tables are mainly used to store application data which is basically the master data or transactional data of table. And mostly, transparent tables are the only one you will create as pooled and cluster tables are not used to store transaction data.
E.g.:- BKPF, VBAK, VBAP, KNA1, COEP etc
B- Pool Table: - A pool table means a pool of tables of the data dictionary representing a single database table. There is a many to one relationship between the data dictionary and database and the names of table in ABAP dictionary are different from the one in database.  Pool tables are used to store system data and system configuration. A Pool table is stored along with other pooled tables in database as table pool.
E.g. of Pool Table: - M_MTVMA, M_MTVMB

C- Cluster Table: - Cluster Tables are similar as the pool tables while the only difference between the two is that all the pool table stored in table pool does not need to have any foreign key relationship but in the case of cluster table it are must. Cluster tables can be used to store control data.  They can also be used to store temporary data or texts, such as documentation.
E.g.  Of cluster table BSEC, BSET, BSEG. 

 2.VIEW: - A VIEW in SAP is same as in other programming languages. A VIEW is a table with no contents. A view could also be representation of data from 2 or more logically related tables combined using joins or any other database operations. A View is mainly used to either display data from two or more tables or to project only selected fields of tables. We can use a view either separately (through SE11) or we can use it in any report we create (SE38) There are four types of Views in SAP: -

A.      Database View- A database view is the one which we create to display logically related data distributed among various tables.

B.      Projection view- A projection view is the one which we create to display only selected fields of a table. You cannot define any select conditions or joins in the projection view.

C.      Maintenance View- Maintenance like database view displays application data from multiple tables but the tables in maintenance view must be connected through foreign key relation.

D.      Help View- Help views are created to provide Input Help(F4) for any field in selection screen. Please Note that we can only use Help view if we need to retrieve data from tables combining them using Outer Join.

3.       Domain: - Domain defines the technical attributes of a field such as the data type, length and value range of field. For e.g. A Domain ‘ID’ is of data type ‘Integer’, length ‘4’ and value range 1 to 9999.  

4.       Data Elements: - Data elements define the semantic characteristics of a field. A data element contains field labels and Documentation (F1) of the field. A data element consists of a domain and the short description about the domain for which it is defined.
For e.g. A data element ‘Employee Id’ for employee table has a domain ‘ID’ defined and the short text defined as ‘Employee ID for employee of XYZ company’.

5.       Structure: - Structures are complex data types composed of multiple fields including data elements, table types or other structures. Structures are mainly used when we want to retrieve the records from database tables and alter them for modifying database or for displaying it to users.

6.       TYPE GROUPS – Suppose, we require a group of data types or 2 or more structures or both for more than one programs. Then instead of declaring them individually I each program we can create a type pool or type group of them. Type groups allows us to define the data types or structures in data dictionary.
Syntax:-


TYPE-POOL ZDEMO .

TYPES: BEGIN OF ZDEMO_ZTEST_5005874DEM ,
EMPID TYPE INT4,
EMPBRANCH TYPE C LENGTH 20,
NAME TYPE C LENGTH 20,
LNAME TYPE C LENGTH 20,
DEPTID TYPE INT4 ,

END OF ZDEMO_ZTEST_5005874DEM.

TYPES : BEGIN OF ZDEMO_ZTEST_505874TEST,
DEPTID TYPE INT4 ,
DEPTNAME TYPE C LENGTH 20,
END OF ZDEMO_ZTEST_505874TEST.

7.       Search help: - Search helps provides advanced input helps to user for selecting input fields based on the conditions used to create search helps.

8.       Lock Objects:- It implement application-level locking when changing data.

Friday, 29 March 2013

ABAP Work Process and its Types



A work process executes the individual dialog steps of user requests. In other words, all the execution and processing of user requests is done by work  process and once a request is allotted to the work process, it executes only a single dialog step and then frees itself for handling other requests.
A Dialog step is referred to as the change of screen. A jump from one screen to another is a dialog step.

Components of a Work Process

There could be ‘N’ number of work processes in an Application server.  Each Work Process has 3 different components which it uses to process the request.

In ABAP application programming, there is a difference between user interaction and processing logic.  The user interactions are handled by Screen processor whereas the processing logic which might require DB interactions etc is performed by ABAP Processor.
The Screen Processor executes the Screen Flow Logic which consists of large part of user interactions. The screen processor also handles the communication between work process and SAP GUI and it also handles the field transfer from screens to flow logic.
The ABAP Processor executes the processing logic of the application program and also establishes connection between the work process and DB by communicating with the DB interface. The screen processor informs the ABAP processor about the Screen modules to be processed.

The DB Interface
The DB interface is responsible for connecting and disconnecting the work process and the database. It also provides services like access to database tables, repository information etc.

Types of Work Processes

There are 5 types of Work Processes. Please note that the structure of each work process remains same irrespective of its type. The various types of work processes are helpful in optimizing the use of resources of Application server. The dispatcher allots the requests to work process based on its type.

Work Process Type
Request Type
Dialog
D
Dialog Requests
Update
V
Update Requests to Update Database Records
Background
B
Requests which runs in background
Spool
S
Spool Printing requests
Enqueue
E
Logical Lock Requests


Dialog Work Process (D)

Every user request to execute dialog step is processed by Dialog Work Process. By default the response time of a Dialog Work Process is 300sec, after that it gets terminated. Every SAP instance should have a minimum of 2 Dialog Work Processes and can be increased to more as per business requirement. Services with long running Dialog steps (which require more time for processing) should not be loaded to Dialog work processes as it will affect the system performance as a single work process will be allotted to a single a single service and thus other work process would have to handle multiple user requests.. Services with dialog processing time more than 300 sec should be run in background.

Background Work Process (B):

All long running batch jobs and reports where user interaction is not required are executed by Background Work Process. Every instance should have a minimum of 1 Background Work Processes and can be increased to more as per requirement. Background work processes are designed for periodic tasks such as reorganization or the automatic transfer of data from an external system to the R/3 System.

Update Work Process (V)

All the database update related requests are taken care by Update Work process. This is of two types, Synchronous updates (V1) and Asynchronous updates (V2). Every instance should have a minimum of 1 Update Work Processes and can be increased to more as per requirement.

Enqueue Work Process (E):

Enqueue work process implements lock mechanism. When two users are trying to update same data in a table then Enqueue work process locks that table for other user and releases it when first user saves an commits it. It administers the lock table in shared memory which contains the logical databases lock. Only 1 Enqueue Work Process in Application server is sufficient enough to do this job. In order to execute lock requests we must first define a lock object. A lock object is defined in ABAP dictionary which consists of table entries which are to be locked. As per the standard all the user defined lock mechanisms must begin with the name  'EY' or 'EZ'. When we activate a lock object system automatically generates Enqueue and Dequeue function modules which we can use in our ABAP programs to use lock mechanism functionality.

Spool Work Process (S):

Spooling refers to the buffered transfer of data to output devices such as printers, fax devices, and so
on. All printing related requests are handled by Spool Work process. Every ABAP Application server can have only 1 Spool Work Processes and it can’t be increased to more. Spool requests are generated in dialog mode or during background processing and are then set in the spool database with details about the printer and the print format. The data itself is stored in the TemSe (TEMporary SEquential object) database.


In addition to the above work processes the R/3 application server also has two additional services for communication within R/3 system and between Non-SAP  or other SAP systems. They are:-

Message Server (MS or M):

The message server (MS or M) communicates between the distributed dispatchers within the
R/3 System and is therefore the prerequisite for scalability using several parallel-processing
application servers.

Gateway Server (GW or G)

 The gateway server (GW or G) allows communication between R/3, R/2 and external
application systems.

Thursday, 28 March 2013

Abap Transaction Codes List

Transaction List for Transactions from SE01 to SE100.


Transaction Code Program Name
SE01 Transport Organizer (Extended View)
SE02 Does Not Exist
SE03 Transport Organizer Tools
SE04 Does Not Exist
SE05 Does Not Exist
SE06 Post installation actions for Transport organizer
SE07 Import Monitor
SE08 Does Not Exist
SE09 Transport Organizer
SE10 Transport Organizer
SE11 ABAP Data Dictionary
SE12 ABAP Data Dictionary
SE13 Technical Settings for dictionary
SE14 Dictionary: Database Utility
SE15 Object navigator
SE16 data browser initial screen
SE17 general table display
SE18 BADI builder: initial screen for definition
SE19 BADI builder: initial screen for implementation
SE20 enhancement initial screen
SE21 package builder
SE22 Does Not Exist
SE23 Does Not Exist
SE24 class builder
SE25 Does Not Exist
SE26 Does Not Exist
SE27 Does Not Exist
SE28 Does Not Exist
SE29 application packets
SE30 ABAP Runtime analysis
SE31 Does Not Exist
SE32 Does Not Exist
SE33 context builder
SE34 Does Not Exist
SE35 maintain dialog module
SE36 logical database builder
SE37 function module
SE38 ABAP Editor
SE39 split screen editor
SE40 menu printer
SE41 menu printer: initial screen
SE42 Does Not Exist
SE43 Area menu maintained
SE44 Does Not Exist
SE45 Does Not Exist
SE46 Does Not Exist
SE47 Does Not Exist
SE48 Does Not Exist
SE49 Does Not Exist
SE50 Does Not Exist
SE51 screen printer
SE52 Does Not Exist
SE53 Does Not Exist
SE54 generate table maintenance
SE55 generate table maintenance
SE56 generate table maintenance
SE57 generate table maintenance
SE58 Does Not Exist
SE59 Does Not Exist
SE60 Does Not Exist
SE61 Document maintenance
SE62 short text activation
SE63 standard translation environment
SE64 Does Not Exist
SE65 Does Not Exist
SE66 Does Not Exist
SE67 Does Not Exist
SE68 Does Not Exist
SE69 Does Not Exist
SE70 Does Not Exist
SE71 form printer
SE72 style request
SE73 Does Not Exist
SE74 SAP script format conversion
SE75 SAP script format conversion setting
SE76 sap script form translation
SE77 sap script style conversion
SE78 form graphic
SE79 Does Not Exist
SE80 ABAP Work bench
SE81 application hierarchy display
SE82 application hierarchy display
SE83 Does Not Exist
SE84 object navigator
SE85 object navigator
SE86 Does Not Exist
SE87 Does Not Exist
SE88 Does Not Exist
SE89 R/3 repository maintenance
SE90 object navigator
SE91 message maintained
SE92 system log message maintenance
SE93 maintain transaction
SE94 simulation: customer
SE95 modification browser: object selection
SE96 Does Not Exist
SE97 maintained transaction call authorization in call transaction
SE98 Does Not Exist
SE99 Does Not Exist
SE100 Does Not Exist