0% found this document useful (0 votes)
21 views

Sap Abap

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Sap Abap

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SAP-ABAP

SAP - Systems Analysis and Program Development / Systems, Applications, and Products in
Data Processing

Sap is practically known for its ERP (Enterprise Resource Planning) software. SAP's ERP systems
enable businesses to integrate various functions across their operations, ensuring smooth and
efficient workflows.

SAP provides a comprehensive suite of applications and systems that ensure seamless
integration of business processes across departments such as finance, HR, manufacturing,
supply chain, services, procurement, and others.

SAP ERP Modules:


Some of the core modules in SAP ERP include:
● FI (Financial Accounting)
● CO (Controlling)
● MM (Materials Management)
● SD (Sales and Distribution)
● HR/HCM (Human Capital Management)
● PP (Production Planning)
● and more.

ABAP:Advanced Business Application Programming

ABAP is a high-level programming language developed by SAP for building business applications
within the SAP environment. It is specifically designed to meet the needs of SAP's ERP systems
and other SAP applications.

The primary tools for ABAP development:


ABAP Workbench, which provides an integrated development environment (IDE) within the SAP
system.
ABAP Editor,
Data Dictionary,
Function Builder,
to create and modify ABAP programs, data structures, and user interfaces.
SAP-ABAP Technical Part:-

As of now we are in the part of SAP-ABAP Technical Team we will be focusing on the
development server where we will be dealing with the creating and implementing the object
requirements of the client/User!!!

Frequently Used Tcodes in SAP ABAP development editor:

○ SE38: ABAP Editor->to create, edit, and execute ABAP programs.


○ SE80: Object Navigator-> access to various development objects , used to create
Package etc…
○ SE80: Package Builder
○ SE11: Data Dictionary->to see the database tables,Create tables
○ SE09,SE10,SE01:- Transport->managing transport requests,
○ SE93: Transaction Maintenance->Create Transaction Codes
○ SE37: Function Module
○ SE24: Class Builder ->to create and manage ABAP classes, which encapsulate data
and methods.
○ SE41: Menu Painter-> for creating and modifying SAP GUI menus and screen
elements.
○ SE93: Transaction Maintenance
○ SE16:-Display the contents of the table..
○ /0 :- To open new window
○ /n :- Close the current Window.

● In SAP development, Transport Requests and Transaction Codes are essential components
for managing changes and executing tasks within the system.

Transport Request:
A Transport Request (TR) is a container that holds one or more development objects (e.g.,
programs, tables, configurations) to be moved from one SAP system to another.
TR’s are used to move changes from one SAP system to another, such as from a development
system to a quality assurance or production system.

Steps to create:
● SE09/SE10:-initiate the creation of a new transport request and assign it a unique
identifier.
● Adding Objects:-objects can include ABAP programs, database tables, data dictionary
objects, configurations, and more.
● Release: Once all necessary objects are added, the transport request is released.

**Releasing a transport request locks the objects and marks them for export to other SAP
systems.

Transaction Code:
A TCode is a shortcut or abbreviation used to execute specific tasks or launch SAP applications
within the SAP system. Each transaction code corresponds to a particular function or program in
SAP.
Transaction Codes are used to navigate and perform tasks within the SAP system quickly and
efficiently.
Users can access transaction codes by entering the code in the SAP command field or using the
SAP Easy Access menu.

Steps to create:
● use the SAP Transaction SE93 to create
● link it to an existing program, object,function module, or report.

Package:
Package is a logical container used to organize and manage development objects within the SAP
repository. It serves as a unit of transport, authorization, and release management for ABAP
objects.
● Package can be created by using SE80
● Once the package is created, you can assign ABAP development objects

Syntax Concepts:-

Keywords in ABAP:-
● DATA: Used to declare variables and data objects.
● SELECT: Used to retrieve data from database tables.
● INSERT: Used to add new records to database tables.
● UPDATE: Used to modify existing records in database tables.
● DELETE: Used to remove records from database tables.
● IF / ELSEIF / ELSE: Used for conditional branching and decision making.
● CASE / END CASE: Used for multi-way branching based on different conditions.
● WHILE / ENDWHILE: Used for looping through a block of code while a condition is true.
● DO / ENDDO: Used for looping through a block of code a specified number of times.
● LOOP / ENDLOOP: Used for looping through internal tables.
● EXIT / EXIT. / EXIT FROM ...: Used to exit from loops or processing blocks.
● TRY / CATCH / ENDTRY: Used for exception handling and error catching.
● CALL FUNCTION: Used to call function modules or remote function modules.
● METHOD: Used to define methods within ABAP classes.
● EXPORT / IMPORT: Used for passing parameters between programs or function modules.
● MESSAGE / MESSAGE ...: Used for displaying messages to users or logging messages.
● CONCATENATE: Used to concatenate strings.
● PARAMETERS: Keyword indicating the declaration of input parameters.
● WRITE / WRITE ...: Used to output data to the screen or log.
● Information of keyword : Select key word +CTRL+F1

PARAMETERS: P_Name TYPE (DATAELEMENT)

SELECT:-
In ABAP, SELECT, SELECT SINGLE, and SELECT SINGLE * are different statements used for
retrieving data from database tables.

● SELECT retrieves multiple records based on specified criteria.


● SELECT SINGLE retrieves the first record that matches the criteria.
● SELECT SINGLE * retrieves the first record along with all its fields that match the criteria.

Local Variable - “Single Row Single Column “


Work Area-“Single Row Multiple Column”
Internal table -“Multiple Row Multiple Column”

Conditional Statements:-
IF / ELSEIF / ELSE:
Syntax:-
IF condition1.
" Code block 1
ELSEIF condition2.
" Code block 2
ELSE.
" Default code block
ENDIF.

Sy-Subrc
● If the last statement executed successfully, SY-SUBRC is set to 0.
● If the last statement encountered an error, SY-SUBRC is set to a non-zero value, typically
4

LOOP / ENDLOOP Loop:


● The LOOP loop executes a block of code repeatedly until an exit condition is met.
● It is used when the number of iterations is not known in advance and the loop should exit

based on a condition within the loop.
Syntax:-
Loop At Table_Name Into @Data(wa_name)
Conditions
Endloop

SAVE(Ctrl+s) -> CHECK(ctrl+F2) ->ACTIVATE(ctrl+F3)

Dynamic Programming:

-> Run Time Type Services


-> Run Time Type Information
● We can Dynamically call the queries by Variable names

Field Symbols: Stores the address of the Data ( acts as a pointer)

Dynamic Open Sql:

Dynamic FROM Clause:

Dynamic Field List:

Dynamic WHERE Condition (one line):

Dynamic WHERE Condition(Multiple Lines):

Dynamic Calls:

● Subroutines:
● Function Module:
● Method :
● Executable Program

Open SQL:
Ordered Data Sets:-
->Sorting by Primary Keys(Ascending):-

->Sorting by any key(asc):

->Sorting by any Key(asc or Dec):

Joins:

Modularisation:

Function Modules:

Best Programming techniques :

● Do not define any data objects in dialog modules and event blocks.
● Move source code to methods and subroutines, and use local data inside that.
● Use TABLES structures only in DYNPRO (screen) programming.
● Never create TABLES structures in processing blocks.
● When calculating with integer operands, use type p result fields.
● Avoid floating-point numbers with type f.
● Catch all runtime error from methods.
● Always check validity before dereferencing references.
● Always check validity before accessing field symbols.
● Sort the table once before accessing it with BINARY SEARCH.
● Before accessing the database with FOR ALL ENTRIES, always make sure that the internal
table is not empty.
● Use only key access when changing data in sorted tables.

Optimize Data Reading:


● To optimise performance, the application program must minimise the number of database
accesses and keeps the amount of data in each transfer small.
● To reduce the load on the network between the application servers and the database
server, it is important to query data in consolidated packages and not in individual
requests.
● Use buffering techniques that read all the data required during the course of the
program.
● Buffering techniques also help you avoid multiple reads of the same data.
● To reduce the load on the database, it is important to reduce the search effort by using
WHERE conditions that support the use of the primary or a secondary index.
● To reduce the data volume, specify a list of fields in the SELECT statement if you require
only a small section of the fields.

You might also like