Monday, June 11, 2018

ABAP

history
ABAP is one of the 4th generation dilden with a lot of application focus developed in the 1980s. ABAP was the reporting language for the SAP R / 2 platform, which initially allowed large companies to develop their business applications for resource management financial planning.

ABAP was also an abbreviation for Allgemeiner Berichts Aufbereitungs Prozessor, meaning "general report-making processor" in German, but was later called Advanced Business Application Programming. ABAP was one of the first languages ​​to include a logical database concept that provides a high level of abstraction from the basic database level.

The ABAP programming language was originally used by developers to develop the SAP R / 3 platform. SAP customers were planning to use ABAP to develop SAP applications where customers could develop customized reports and interfaces. Learning for language programmers is fairly easy, but it is not a tool that can be used directly for non-programmers. In order to be able to create ABAP programs, relational database design and programming skills, preferably object-oriented concept knowledge, are required.

When ABAP was first released in 1992, SAP was configured to create programs for the client-server R / 3 system. In 1990, SAP applications and systems were written in ABAP together with developing computer hardware. Until 2001, the most basic functions of the whole system were written in ABAP. In 1999, SAP released ABAP objects as an extension to ABAP, along with R / 3 version 4.6.

SAP's newest development platform, NetWeaver, supports both ABAP and Java.Application
Where does the ABAP program work
All ABAP programs are found in the SAP database. Java and C ++ programs are not stored in separate external files. All ABAP codes in the database are available in two ways: source code that can be displayed and edited with ABAP Workbench tools, and "generated code" in binary notation that can be thought of as a Java bytecode. ABAP programs run under the control of the runtime system, which is part of the SAP kernel (kernel). The runtime system is responsible for handling ABAP statements, controlling the flow of screens, and responding to events (such as a user clicking on a screen button). One of the key components of the ABAP runtime system is the database interface that translates database-independent ABAP expressions ("open sql") into expressions ("native sql") that DBMS (database management system) on the base can understand. The database interface handles all the communication with the relational database on behalf of the ABAP programs and also includes extra features like getting the application server's frequently accessed data in the built-in memory.

SAP's three different layers are the database layer from which the entire database is acquired and stored from the presentation layer (GUI), the application layer (programs run on top of it), and the user-created situations and commands from the presentation layer of the end user.

SAP-based
The ABAP language environment, which includes syntax checking, code generation, and the runtime system, is part of the SAP core component. SAP-based is the technological platform that supports all the students of SAP applications, typically implemented in the framework of the SAP web application server. In this respect, SAP-based can be seen as the operating system on which SAP applications operate. Like all operating systems, it includes both SAP-based low-level services (eg memory management, database communication or web-prompting) as well as high-level tools for end users and administrators. These tools can be executables (SAP kernel) that run directly in the underlying operating system, or they can be ABAP-developed or web-based interfaces. SAP provides an abstraction layer between SAP-based, business applications, the operating system and the database. This allows applications not to be directly dependent on a particular server or database platform, and to be easily moved from one platform to another.

SAP based on z / OS (officially zSeries, S / OS) on UNIX (AIX, HP-UX, Solaris, Linux), Microsoft Windows, IBM System i on i5 / 390) systems. Supported databases are DB2, Informix, MaxDB, Oracle, and Microsoft SQL Server. (Support for Informix has been removed with SAP Basis 7.00).

SAP systems and formatting
All SAP data is available at an SAP prompt and all SAP software runs on this system. Such a system consists of a central relational database and one or more application servers (instances) that access data in databases and applications. An SAP system contains at least one or more instances for reasons such as size and performance. In a multi-sample system, load balancing mechanisms distribute the load to the appropriate application servers. Web application server installations typically consist of three systems: the development system, the testing and control system, the production system. Formatting can include more systems: we can use the unit system and discrete systems for pre-production testing, the formatting can include fewer systems, for example, without a discrete quality control system, we can only consider a format with development and production systems, editing is used. ABAP programs are created in the development system and given the first test. It is then distributed to the different systems in the format. These processes are under the control of the replacement and transport system, which is responsible for concurrency control, version management and placement of programs on quality control and production systems.

The Web application server consists of three layers: the database layer, the application layer, and the presentation layer. These layers work on the same or different physical machines

Sample

*-----------------------------------------------------------------------
* set an exclusive lock at level object-type & object-id
*-----------------------------------------------------------------------
 IF NOT lf_bapi_error = true.
   IF ( NOT istourhd-doc_type IS INITIAL ) AND
      ( NOT istourhd-doc_id IS INITIAL ).
     CALL FUNCTION 'ENQUEUE_/DSD/E_HH_RAREF'
          EXPORTING
               obj_typ        = istourhd-doc_type
               obj_id         = istourhd-doc_id
          EXCEPTIONS
               foreign_lock   = 1
               system_failure = 2
               OTHERS         = 3.
     IF sy-subrc <> 0.
*       terminate processing...
       lf_bapi_error = true.
*       ...and add message to return table
       PERFORM set_msg_to_bapiret2
            USING    sy-msgid gc_abort sy-msgno
                     sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                     gc_istourhd gc_enqueue_refdoc space
            CHANGING lt_return.
     ENDIF.
   ENDIF.
 ENDIF.    " bapi error