ebook img

ABAP Notes PDF

580 Pages·2015·36.02 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ABAP Notes

ABAP Notes Page 2 of 580 Pages Table of Contents 1 SAP Portfolio.........................................................................................................................................3 2 SAP architecture ...................................................................................................................................7 3 Communication and Integration..........................................................................................................19 4 Program Flow .....................................................................................................................................30 5 ABAP Workbench................................................................................................................................37 6 ABAP DATA TYPES...............................................................................................................................60 7 MODULARIZATION..............................................................................................................................78 7.1 SAP- ABAP Macro........................................................................................................................78 7.2 Include Programs ........................................................................................................................79 7.3 Subroutines.................................................................................................................................79 7.4 Function Modules .......................................................................................................................80 7.5 Function Groups..........................................................................................................................81 8 Object Oriented Programming ..........................................................................................................103 9 COMPLEX DATA OBJECTS ..................................................................................................................118 10 Internal Tables ..............................................................................................................................128 10.1.1 Reading contents of internal table: ....................................................................................129 10.1.2 Reading multiple lines in Internal table..............................................................................130 10.1.3 Modifying contents of internal table :................................................................................130 10.2 Deleting contents of internal table: ...........................................................................................131 10.3 Append command:....................................................................................................................131 10.4 Insert command:.......................................................................................................................131 10.5 Collect command: .....................................................................................................................132 11 DATA MODELING ..........................................................................................................................140 12 ABAP Events..................................................................................................................................164 13 NEW TEST TOOLS ..........................................................................................................................166 14 DYNAMIC DATA OBJECTS ..............................................................................................................181 15 ABAP Open SQL.............................................................................................................................184 16 ABAP Dictionary............................................................................................................................195 16.1 INTRODUCTION TO THE DICTIONARY.........................................................................................195 16.2 DATA OBJECTS IN ABAP DICTIONARY.........................................................................................197 17 INPUT CHECKS...............................................................................................................................220 18 OBJECT DEPENDENCIES.................................................................................................................226 19 views and maintenance dialog ......................................................................................................238 20 Subscreens....................................................................................................................................328 21 INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING ...............................................................342 22 ALV Grid Control ...........................................................................................................................407 Page 3 of 580 Pages 1 SAP Portfolio Orchestration Layer ensures that all software and components fit perfectly in customer landscape. This includes life cycle management, mdm and process orchestration. Goal of investment:  Reduce cost of ownership  Ensure data consistency  Process management across multiple layers of applications On demand is synonymous with by design Page 4 of 580 Pages SAP Business One  Comprehensive ERP application with interface similar to windows  Suited for small or midsize companies (100 employees)  Caters for core functionality  Best Fit for companies that have outgrown packaged accounting only software and need to replace multiple non integrated solutions SAP Business By Design  Aimed at mid market, 100 to 500 employees  Integrated end to end application  On demand solution – therefore lower entry costs  Also supports regional and local legal requirements  Customisable ui based on roles  Best fit for companies that need to replace point to point solutions, manual processing using spreadsheets SAP Business All in One  CRM + ERP + applications from Business Objects portfolio  All in one – vertical solution (solutions that are industry specific or country specific)  Pre configured business scenarios and implementation accelerators  Up to 2500 employees  On premise or hosted by parent  Not on demand  Best Fit for companies that have outgrown packaged accounting only software and need to replace multiple non integrated solutions  Best Fit for companies that have solutions that may not meet industry specific requirements or lack of cross border functionality  Best Fit for companies that have increased business process complexity EIM – enterprise information management, it is the business activity of creating, cleansing, integrating, managing, governing and archiving the structured and unstructured data used by an organisation.  Portal – nw java stack  Pi – java stack  Solman – dual stack Page 5 of 580 Pages The beta shipment phase occurs before the restricted shipment phase (or the release-to-customer date), mostly for testing purposes. The restricted shipment phase is flagged off by the release to customer date. The new software release is subjected to the standardized ramp-up process, during this phase. This is to introduce new products in the market. Hence, only a limited number of customers have access to the software. A ramp-up usually takes about 6 months. The unrestricted shipment phase begins after the SAP ramp-up program is successfully concluded. This phase is flagged off by the default release date. The Default Release is the available version of the SAP software. Page 6 of 580 Pages The three phases of maintenance are mainstream maintenance, extended maintenance, and customer- specific maintenance. Mainstream maintenance starts from the release to customer date and generally ends after 7 years (that is, after covering the restricted and unrestricted shipment phases). Extended maintenance kicks in when customers extend the support period (in which corrections or legal changes are taken into account) for an increased maintenance fee. The scope of support remains the same as mainstream maintenance. Customer-specific maintenance starts after the extended maintenance or mainstream maintenance period ends. All releases enter this phase automatically. During this phase, customers receive support services similar to those offered in the mainstream maintenance phase but with some restrictions. No support packaged but customers specific enhancements released. Customers are charged for this. Netweaver business client – uniform look and feel Page 7 of 580 Pages 2 SAP architecture An instance combines SAP system components providing one or more services. These services can be started or stopped simultaneously. You can install and operate the database for an SAP system on a physical computer, separately from the instances of the SAP system. The central instance of the SAP system offers services that no other instance of the system offers. Examples of central instance services are the Message Server and the Enqueue work process for AS ABAP and the Software Deployment Manager (SDM) for AS Java. The central services instance provides the central services of the AS Java, the Message Service, and the Enqueue Service. Dialog instances constitute the other instances of the system. If the same computer constitutes both the central instance and the database, it becomes a central system. Lock = Enqueue Page 8 of 580 Pages AS ABAP PROCESSES On every application server, a number of parallel work processes are possible in the runtime environment for ABAP. Requests to run the work processes are distributed by the dispatcher. Requests for the execution of dialog steps are handled by dialog work processes. Each dispatcher must handle at least two dialog work processes. Spool work processes pass on the sequential data flows to printers. Each SAP system should have at least one spool work process. Requests to execute updates are handled by update work processes. At least one update work process is required for each SAP system. Background work processes execute programs that run without interacting with the user. Every SAP system needs at least two background work processes. The enqueue work process administers the lock table in the shared memory. Only one enqueue work process is needed for each system. Apart from these work processes, the AS ABAP provides additional services (these are not work processes) for internal and external communication: The Message Server (MS) handles communication between the distributed dispatchers. The message server is configured only once per SAP system. Communication between multiple SAP systems, or between SAP systems and external application systems, is possible through the Gateway reader (GW). You only need one Gateway reader for every dispatcher. The Internet Communication Manager (ICM) is used for communicating with the SAP system using web protocols such as HTTP. It receives requests from the client and forwards them to the SAP system for processing. You can configure a maximum of one ICM process per application server.  Dialog – min 2 per disp  Update - > 1  Lock management – only 1  Background = > 1, during transport 2  Spool = >1 Page 9 of 580 Pages AS JAVA PROCESSES Various processes exist in AS Java: The server processes receive incoming requests through the dispatcher. Every dispatcher handles 1 to 16 server processes. The server process executes the Java applications. A list of Java dispatchers and server processes is managed by the Java Message Service (MS), which communicates within the Java runtime environment. Logical locks set (by the executed Java application program) in a server process fall under the purview of the Java Enqueue Service. You can install Java software components on the SAP Web AS Java using the Software Deployment Manager (SDM). Sdm resides on java central instance Page 10 of 580 Pages AS ABAP+JAVA ARCHITECTURE In AS ABAP+Java, the central instance can be recognized by processes like ABAP MS, enqueue work process, and SDM. The Java central services instance provides the central services of the Java runtime environment (Java MS and Java ES). Dialog instances refer to all other instances. The Internet Communication Manager decides whether the request should be forwarded to the ABAP or the Java runtime environment. Depending on the URL the ICM forwards the request to the respective dispatchers. The work processes respond to the requests accordingly. The ABAP and Java runtime environments communicate with each other using SAP Java Connector (JCo). PROCESSING A USER REQUEST The processing of a user request in AS ABAP involves the presentation layer, the application layer, and the database layer. The screen entries of a user are accepted by the SAP GUI and are forwarded to AS ABAP. The ABAP dispatcher distributes the requests one by one to the available work processes for processing of data. You must read data from the ABAP schema of the database or write to it, to process user requests. Page 11 of 580 Pages The ABAP schema of the database has direct links with every work process. Once the process is complete, the dispatcher sends back the end result of the work process to the SAP GUI. The buffers help to speed up the processing of user requests by reducing the number of database hits for data processing. Each instance has its own buffers. PROCESS FLOW FOR REQUEST Work processes:  Abap interpreter  Dynpro interpreter – screen flow logic  Screen processor – informs abap about sub program that needs to be executed  Database interface  Task handler  Internal memory Application programs include process logic, which is executed by work processes. A work process includes  internal memory  a task handler that coordinates the actions within a work process  software processors; and  a database interface. The database interface translates the OPEN SQL statements from ABAP into the corresponding SQL statements for the specific database used (Native SQL). The ABAP interpreter executes the actual processing logic of ABAP application programs. The screen processor tells the ABAP processor which subprogram to execute, depending on the processing status of the screen flow logic. The dialog work process is selected by the dispatcher. It involves a roll-in of the user context first. The work process then processes the user request. This may be a request for data from the database or from the Page 12 of 580 Pages buffers in the shared memory. The dialog work process processes the dialog step, after which the work process rolls out the user context back to the shared memory. The user sees the result after it has been transferred to the SAP GUI on the new screen. DATABASE QUERY FLOW In ABAP, you can access the application data in the database using ABAP Open SQL (or Structured Query Language, which is a database query language), regardless of the Relational Database Management System (RDBMS) used. The database interface that interprets the OPEN SQL into Native SQL thus allows the programs to be database-independent. The buffer stores data that are frequently needed. Thus the system is spared the trouble of retrieving this data from the database. Furthermore, native SQL commands used directly in ABAP can fetch data. This eliminates the need for local buffers or interpretation of commands by a database interface. PROCESSING DIALOG REQUEST A program with individual dialog steps may consist of several screens. Each dialog step in a program is assigned to one specific dialog work process. A dialog work process sequentially processes the dialog steps for various users and programs. Work process multiplexing uses different dialog work processes during program runtime. Page 13 of 580 Pages DIALOG WORK PROCESS MULTIPLEXING Process Before Output or PBO refers to the processing before the screen image is sent. Process After Input or PAI refers to the processing after a user interaction on the screen. The PAI part of a dialog step logically belongs to the preceding screen image; whereas the PBO part logically belongs to the subsequent screen image. PRINCIPAL CHARACTERISTIC: TRANSACTION Transactions are processing units grouped to provide specific modules. The four principal characteristics of transactions can be summed up in the acronym ACID: Atomic Consistent Isolated Durable An atomic transaction either succeeds fully or does not have any effects at all. This ensures that inconsistent, partial results are not stored. A consistent transaction is one in which the system status always reflects one that is accurate and consistent in business terms and will not change otherwise. Changes made within a transaction are isolated, as they cannot be seen by any other transaction, unless the confirmation Commit is executed. Page 14 of 580 Pages The results of a transaction are durable because after the final confirmation they are stored permanently in the database. RELATIONSHIP BETWEEN DATABASE TRANSACTION AND SAP TRANSACTIONS SAP transactions need not be executed within one single dialog work process. For requests that change data on the database, database transactions are initiated. Applications whose dialog steps are sequentially executed by the same work process cannot run within the same database transaction if they are not related to each other. Therefore, a work process must start a new database transaction for each dialog step. LOCK MANAGEMENT IN AS ABAP The SAP lock principle is that SAP programs should make lock entries in a lock table. The lock table is located in the main memory of the instance with the enqueue work process. If a user wants to change the access to data, the executing dialog work process requests a lock. A dialog request processed on the enqueue server results in a dialog work process that can access the lock table directly; else, the work processes communicate through the MS. The application developer can choose between different lock modes, such as at most read access and change access. The application developer can choose between various lock modes. Write locks – in the lock mode Exclusive – can be edited only by one user. Any read / write locks are rejected Read locks – in the lock mode Shared – allows concurrent read access to the locked data for several users. Write is rejected Enhanced write locks – in the lock mode exclusive noncumulative – allow write locks to be successively Page 15 of 580 Pages requested and released by the same transaction. This is same as write lock + same transaction can successfully request and release write locks. Optimistic locks – in the lock mode Optimistic – respond like read locks at first; can be changed to write locks; and can be set if the user displays the data in change mode. Read lock, but can be changed to write lock. When saving, read lock changes to write lock Sm12 – display current locks Remove lock – by either ending user session or deleting manually THE PRINCIPLE OF ASYCHRONOUS UPDATES SAP transactions can off-load time-intensive database changes by using the updating system. During a dialog work process, the data temporarily stored for processing may be passed to an update work process for further processing. The dialog work process, in that case, does not wait for the update request to be completed. This type of update is asynchronous. With the ABAP command COMMIT WORK, you complete the dialog part. Each dialog step corresponds to a database transaction, which is executed either completely or not at all in the database. It is duly completed with a COMMIT command. THE ASYNCHRONOUS UPDATE PROCESS An asynchronous update process triggers several steps:

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.