100% found this document useful (1 vote)
171 views139 pages

02 - Abap

ABAP is a programming language used to develop applications within SAP systems. It allows for both procedural and object-oriented programming. ABAP programs are coded and stored within the SAP system using the ABAP workbench. The ABAP runtime environment controls the execution of ABAP programs and includes components like the database interface.

Uploaded by

dina cordova
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
171 views139 pages

02 - Abap

ABAP is a programming language used to develop applications within SAP systems. It allows for both procedural and object-oriented programming. ABAP programs are coded and stored within the SAP system using the ABAP workbench. The ABAP runtime environment controls the execution of ABAP programs and includes components like the database interface.

Uploaded by

dina cordova
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 139

Application

Development
Management
SAP ABAP
Introduction
ABAP Stands for Advanced Business Application
Programming. ABAP is a programming language created and
used by SAP for the development of application programs
including: Reports, Screens, Interfaces & Data conversions.
ABAP is an event driven programming language. User
actions and system events control the execution of an
application.

Any ABAP Program, because it requires the BASIS modules,


can run only within an SAP environment. The language is
case-insensitive, and each statement terminates with a period.
Without an efficient IT infrastructure, apps, websites or digital processes, our economy
will remain at a standstill. With the far-reaching digitization of business processes, now
more than ever, we need more developers with a good understanding of both business
and IT. And this is where Advanced Business Application Programming (ABAP) comes
in. ABAP is a programming language that simplifies the development of business
applications within SAP landscapes. And as the necessary link within an organization,
the ABAP developer is the one to connect business and software development.

HOW CAN ABAP PROVIDE MEANS FOR ADM?


Why ABAP?
ABAP supports both Procedural and Object-Oriented programming

ABAP aimed to be used by SAP customers to create and enhance


SAP Applications

ABAP allows us to develop custom reports, and interfaces with


ABAP programming

ABAP supports portability and can easily be ported from one


platform to another

ABAP is easy to grasp for people who have programming


experience and background
Role of ABAP Consultants in SAP Projects
• Understanding and Analyzing Functional Specifications
• Preparing Technical Specs
• Development
• Code Review & Unit Testing
• Transport Management
• Support
• End user training (optional)
Consultants in SAP Projects
• Functional Consultants -> FI/CO, SD, HR, MM, etc. (SAP Modules)
• Technical Consultants -> ABAP
• BASIS Consultants -> BASIS (relatively like administration)
• Testers
ABAP Runtime Environment
The Runtime System is a part of SAP Kernel that controls
ABAP program execution. The runtime environment is
responsible for processing ABAP statements and responding to
events.

A key component of ABAP runtime environment is the


Database Interface, that converts database independent ABAP
statements (OpenSQL) into statements understood by the
underlying DBMS (Native SQL). The database interface
manages all the communication with the relation database on
behalf of ABAP programs. It also contains features that allow
management on database tables and data.
All ABAP programs are coded and
exist inside the SAP System and they
are not stored as a separate external
file like Java or C++ programs.

HOW IS ABAP CODED AND STORED?


Executable Programs Non-executable Programs
• Reports - User enters a set of input parameters and • Include Programs - Mostly used to split larger programs (Ex.
the program uses those to produce a report in the Separating Data Declarations, User Inputs into their own
form of list or table. include programs/modules).
• Module Pools - User interaction using a collection of • Subroutines - Contains ABAP subroutines that are coded in
screens. Each screen has their own flow logic. between FORM and ENDFORM and invoked with PERFORM
command.
• Function Groups - Libraries of function modules that are coded
in between FUNCTION and ENDFUNCTION and invoked by
CALL FUNCTION command.
• Object Classes - Defines set of methods and attributes.
• Interfaces - Contains empty method definitions that are to be
implemented.
• Type Pools - Defines set of data types and constants.
ABAP Workbench
Part of SAP System and accessed via SAP GUI. Contains various tools
for editing programs. Some of the workbench tools are:
• ABAP Editor - Used for writing end editing ABAP Code. (SE38)
• ABAP Dictionary - Where SAP Data Definitions are maintained
(Tables, Structures, Domains, Data Elements - SE11)
• Class Builder - Used for ABAP Objects like classes and interfaces.
ABAP Development (SE24)
• Function Builder - Used for function modules. (SE37)
THIS CAN BE DONE IN
The Object Navigator (SE80) provides a single integrated interface into
T W O P O S S I B L E WA Y S : these various tools.

ABAP Development Tools


Also known as "ABAP in Eclipse"; the Eclipse IDE is used to develop
ABAP objects using a set of plugins
ABAP Dictionary
• central source of information for the data in an
information management system. Its main function is to
support the creation and management of data definitions
(or "metadata").

• Transaction Code is SE11

• one the best tool of ABAP workbench and it is a central


repository for data definitions in SAP system. It is used to
store the data definitions, create, and maintain user
defined types.
Basic Object Types in ABAP Dictionary

1 2 3 4
D ATA STRUCTURES TA B L E S
DOMAINS
ELEMENTS
Domains
Describes the technical characteristics of a table field

Specifies a value range which describes allowed data


values for the fields

Fields referring to the same domain (via the data


elements assigned to them) are changed when a change
is made to the domain

Ensures consistency

Example is: EBELN


Data Elements
Describes the role played by a field in a
technical context

Fields of same semantic meaning can refer to


the same data element

Contains the field information. Used for the


Semantic Definition
Structures
Are record declarations that do NOT correspond to a
Database Table. A structure is just a list of fields defined
under a name.

Structures are data objects consisting of various


components or fields of any data types.

Does not store data and can then be addressed from


ABAP programs

Structures contain data only during the runtime of a


program.
Tables
• Represent the Database Tables where data resides.
• Tables can be defined independently of the database in the
ABAP Dictionary.
• The fields of the table are defined with their (database-
independent) SAP ABAP data types and lengths.
• There are five size categories (0-4) and 3 most common
data classes: (assigned in Tech. Settings)
⚬ APPL0 - Master data (frequently accessed - rarely
changed)
⚬ APPL1 - Transaction data (changed frequently)
⚬ APPL2 - Organizational data (customizing data entered
when system is configured - rarely changed)
Aggregated Objects of ABAP Dictionary

◌ ◌ ◌
VIEWS SEARCH LOCK
HELP OBJECTS
VIEWS
Views in SAP ABAP are used to summarize data which is
distributed among several tables

The data of a view is not actually physically stored. The data


of a view is instead derived from one or more other tables
VIEWS
·ABAP supports 4 different view types:
• Database View - a view which combines multiple tables
into a single view and is used only to read the records.
• Projection View - a view that contains exactly one table.
It projects only those fields that are assigned to the view.
VIEWS
·
• Help View - a view that combines multiple tables into a
single view using outer join and is mainly used as an
input to Search Help.
• Maintenance View - a view that combines multiple tables
into a single view using outer join and is mainly used to
maintain multiple tables altogether.
SEARCH HELP
A Search help is a tool to help you search for data records in
the system

An efficient and user-friendly search tool that assists users


when a value of a field is unknown

Used to display all the possible values for a field in the form
of a list.
LOCK OBJECTS
• Simultaneous accessing of the same data record by two
users in the SAP system is synchronized by a lock
mechanism.
• Locks are set and released by calling certain function
modules. These function modules are generated
automatically from the definition of so-called lock
objects in the ABAP/4 Dictionary

Function Modules: ENQUEUE_<obj name> – to lock the table;


DEQUEUE_<obj name> – to release the lock
Important Transactions
S E 1 1 : D AT A D I C T I O N A R Y I N I T I A L S C R E E N ( S E 1 2
D I S P L AY O N LY )

SE13: ABAP Dictionary: Technical Settings

SE14: Database Utility

SE15: Repository Information System

SE16: Data Browser

SE17: General table Display

SE55: Table View Maintenance

SM30: Table Maintenance


ABAP Editor
To begin, follow these steps:

Open Transaction SE38 or choose Tools > ABAP Workbench >


Development > ABAP Editor.

On the ABAP Editor initial screen, enter the program name, select the
Source Code radio button, and click the Create button. Because this
program will be a repository object, it should be in a customer
namespace starting with Z or Y
You’ll see the Program Attributes window to maintain the attributes for
your program. Program attributes allow you to set the runtime
environment of the program.
Here, you can maintain a title for your program and other attributes. The Title and Type are mandatory fields; the others are optional.
Attributes and their significance
Type Allows you to select the type of program you want to create. This is the
most important attribute and specifies how the program is executed. It's a
mandatory field.

From within the ABAP editor, you can only choose from the following
program types:
• Executable Program
• Module Pool
• Subroutine Pool
• Include Program

All other program types aren't created directly from within ABAP Editor
but created with the help of special tools such as Function Builder for
function groups or the Class Builder for class pools.
Attributes and their significance
Status Allows you to set the status of the program development, for example,
production program or test program

Application Allows you to set the program application area so tha the system can allocate the
program to the correct business area, for example, SAP ERP Financial
Accounting (FI)

Authorization Enter the name of a program group. This allows you to group different programs
Group together for authorization checks

Selection Screen Visible only when the program type is selected as an executable program. This
attribute allows you to specify the selection screen of the logical database that
should be used.
Attributes and their significance
Logical Visible only when the program type is selected as an executable program. This
Database attribute determines the logical database used by the executable program and is
used only when creating reports using a logical database.

Logical databases are special ABAP program created using Transaction SLDB
that retrieve data and make it available to application programs.

Editor lock If set, other users can't change, rename, or delete your program. Only you can
change the program, its attributes, test elements, and documentation, or release
the lock.
Attributes and their significance
Fixed point If set for a program, the system rounds types p fields according to the number of
arithmetic decimal places or pads them with zeros.

The decimal sign in this case is always the period(.) regardless of the user's
personal settings. SAP recommends that this attribute is always set.

Unicode Checks Allows you to set whether the syntax checker should check for non-Unicode-
Active compatible code and display a warning message.

As of SAP NetWeaver 7.5, the system doesn't support non-Unicode systems, so


this option is always selected by default.
Attributes and their significance
Fixed point If set for a program, the system rounds types p fields according to the number of
arithmetic decimal places or pads them with zeros.

The decimal sign in this case is always the period(.) regardless of the user's
personal settings. SAP recommends that this attribute is always set.

Unicode Checks Allows you to set whether the syntax checker should check for non-Unicode-
Active compatible code and display a warning message.

As of SAP NetWeaver 7.5, the system doesn't support non-Unicode systems, so


this option is always selected by default.

Start using Applicable only for executable programs. If you set this attribute, other users
variant can only start your program using a variant. You must then create at least one
variant before the report can be started.
Under the Attributes section, provide the following values as shown in
the figure below:
• Type: Executable program
• Status: Test Program
• Application: Unknown application
Check the Unicode Checks Active and Fixed point arithmetic
checkboxes.

Click the Save button when finished.


On the Create Object Directory Entry screen (see the figure below), you
can assign the program to a package. The package is important for
transports between systems. All the ABAP Workbench objects assigned
to one package are combined into one transport request.

When working on a team, you may have to assign your program to an


existing package, or you may be free to create a new package. All
programs assigned to the package $TMP are private objects (local object)
and can’t be transported into other systems. For this example, create the
program as a local object.
Either enter “$TMP” as the Package and click the Save button or simply
click the Local Object button
This takes you to the ABAP Editor: Change Report screen where you can
write your ABAP code. By default, the source code includes the
introductory statement to introduce the program type. For example,
executable programs are introduced with the REPORT statement,
whereas module pool programs are introduced with the PROGRAM
statement.

Write the following code in the program and activate the program:

PARAMETERS p_input TYPE c LENGTH 20.

WRITE : 'The input was:', p_input.


Enter a value in the input field, and click the Execute button or press (F8). This
should show you the output or List screen, as shown here:
The list screen (output screen) is generated by the WRITE statement in the code. With
the WRITE statement, you’re printing the contents of two data objects here. One is a
text literal, 'The input was:', and the other is the variable p_input created by the
PARAMETERS keyword.

Whatever input was entered on the selection screen was transferred to the program
and stored in the variable p_input, which was then processed by the WRITE statement
to display in the output.
Control Statements
Decision control statements are used to execute block of statements only when certain
conditions are met

The block of statements under decision control statements always executes when the
condition is determined as true

The block of statements executes only once when condition/s is/are determined true.
Decision control statements can be coded with one or more conditions together
Control Statements

IF Statement

IF-ELSE Statement

IF….ELSEIF….ELSE Statement

CASE Statement

LOOP Statements
IF Statement
A simple control statement that is used to verify one or more logical
expressions/conditions
IF-ELSE Statement
If the expression evaluates to true then the IF block of code will be executed. Otherwise,
ELSE block of code will be executed
IF….ELSEIF….ELSE Statement
When using IF, ELSEIF and ELSE statements there are a few points to consider:
• An IF statement can have zero or one ELSE statement and it must come after any
ELSEIF statement.
• An IF statement can have zero to many ELSEIF statements and they must come
before the ELSE statement.
• If an ELSEIF statement succeeds, none of the remaining ELSEIF statements or
ELSE statement will be tested.
CASE Statement
Used to validate one operand value with multiple values at a time. Each comparison value
has its own set of statements to execute
LOOP Statements
·A loop statement allows us to execute a statement or group of statements multiple times

Most basic and common form of LOOP statement is


Other types of LOOP Statements
WHILE Loop
Repeats a statement or group of statements when a given condition is true. It tests the
condition before executing the loop body.
Other types of LOOP Statements
DO Loop
The DO statement is useful for repeating particular task a specific number of times
LOOP Control Statements
CONTINUE
Causes the loop to skip the remainder of its body and starts the next loop pass.

CHECK
If the condition is false, then the remaining statements after the CHECK are just ignored and the
system starts the next loop pass

EXIT
Terminates the loop entirely and transfers execution to the statement immediately following the
loop
Logical Operators
Operators are symbols used to perform various types of functions.

They manipulate variables and other values to produce a result.

Operators are combined with variables, constants, and literals to produce a


meaningful expression that may produce a result.

Without operators, there is no meaning to an expression.


Types of Operators in SAP ABAP
Arithmetic Operators - used to carrying out mathematical operations
Types of Operators in SAP ABAP

Logical/ Comparison Operators - Logical operators are used for comparison between two
values. They are usually used as tests between two variables
Types of Operators in SAP ABAP

·Character String Operators - compare characters (single character text) with strings
(multiple character text) and evaluate results according to its presence or absence in the
string.
A SAP report is an executable program that reads data
from the database and generates output based on the
filter criteria selected by the end user.

 They are used when data from several tables must be selected
SAP Reports and processed before presenting

 Used when reports demand a special format

 Report Programs are always Executable Programs.

 Report Programming is an Event-driven programming


Selection Screen
 "Selection screen" is the screen where one specifies the input values for which the program
should run.
 Selection Screen normally consists of:
o Parameters
 Parameters help one to do dynamic selection. They can accommodate only one value for
one cycle of execution of the program.
 Parameters can be Checkboxes as well as Radio buttons.
 Parameters can also be a Listbox.
o Select-Options
 A Select-Option is used to input a range of values or a set of values to a program
Basic Events in an ABAP Report
ABAP report programs are event driven programs. The different events in a report Program
are:

Load-of-program
 Triggers the associated event in an internal session after loading a program of type 1, M, F, or
S.
 Also runs the associated processing block once and once only for each program and internal
session.
 The processing block LOAD-OF-PROGRAM has roughly the same function for an ABAP
program of type 1, M, F or S as a constructor has for classes in ABAP Objects
Basic Events in an ABAP Report
Initialization
 This event is executed before the selection screen is displayed.
 Initialization of all the values.
 You can assign different values other than the values defaulted on the selection screen.
 You can fill your selection screen with some values at runtime

At Selection-Screen
 The event is processed when the selection screen has been processed
 Validation & Checks of inputted values happen here
Basic Events in an ABAP Report
Start-of-Selection
 Here the program starts selecting values from tables.

End-of-Selection
 After all the data has been selected this event writes the data to the screen.
Types of Reports
These are the simplest reports. Programmers
learn this one first. It is just an output of data
using the WRITE statement

Events In Classical Reports.


• INTIALIZATION: This event triggers before selection
Classical Reports screen display.
• AT-SELECTION-SCREEN: This event triggers after
processing user input still selection screen is in
active mode.
• START OF SELECTION: Start of selection screen
triggers after processing selection screen.
• END-OF-SELECTION : It is for Logical Database
Reporting.
Interactive Reports
As the name suggests, the user can Interact with the report. We can have a drill down into the report
data. For example, Column one of the report displays the material numbers, and the user feels that he
needs some more specific data about the vendor for that material, he can HIDE that data under those
material numbers.

Interactive Report Events:


• AT LINE-SELECTION : This Event triggers when we double click a line on the list, when the event
is triggered a new sub list is going to be generated. Under this event what ever the statements
that are been return will be displayed on newly generated sub list.
• AT USER-COMMAND : It provides user functions keys.
• TOP-OF-PAGE DURING LINE-SELECTION :top of page event for secondary list.
ALV Reports

ALV stands for ABAP List Viewer. ALV gives us a standard List format and user interface to all our
ABAP reports. ALV is created by a set of standard function modules provided by SAP.

ALV provides a lot of inbuilt functions to our reports and some of the functions  are listed below.
• Sorting of records
• Filtering of records
• Totals and Sub-totals
• Download the report output to Excel/HTML
• Changing the order of the columns in the report
• Hide the unwanted columns  from the report

Because of the above functions, ALV substantially decreases the report development time. ALV takes
care of rendering the list and we can concentrate only on the data retrieval part.
SAP ABAP SQL OVERVIEW
• SELECT Statement
• JOINS
• INTO Table
• APPENDING Table
SELECT statement
SELECT * FROM <table_name> INTO TABLE <local_table>

Syntax Description
SELECT Specify that you are going to select
records in a table
* Indicate that you are going to fetch
all fields
FROM <table_name> Indicate which database table you
are fetching the records
INTO TABLE <local_table> Indicate which internal table you
are going to save the fetched
records
JOINS
• INNER JOIN
• OUTER JOIN
INNER JOIN
• Returns records that have matching values in both tables
LEFT OUTER JOIN
• Returns all records from the left table, and the matched records from the right table
RIGHT OUTER JOIN
• Returns all records from the right table, and the matched records from the left table
INTO TABLE

SELECT * FROM <table name>


INTO TABLE <local table>
APPENDING TABLE
SELECT * FROM <table name>
APPENDING TABLE <local table>
ABAP SQL
What is SQL?
• stands for Structured Query Language, a language for manipulating and talking about
data in databases.

• SQL is a domain-specific language used in programming and designed for managing


data held in a relational database management system, or for stream processing in a
relational data stream management system.
What is ABAP SQL?
It is ABAP’s version of SQL for table and data manipulation. It follows the native SQL in
its own version
SQL Statements in ABAP
SELECT statement
• SELECT is an Open-SQL-statement for reading data from one or several database tables
into data objects
INSERT statement
• INSERT is an Open-SQL-statement for inserting data to table using a work area or
variable.
MODIFY statement
• MODIFY is an Open-SQL-statement for modification/update of line items in a table if it
exist or insert the work area of it doesn’t exist.
UPDATE statement
• UPDATE is an Open-SQL-statement for modification/update of line items in a table.
DELETE statement
• DELETE is an Open-SQL-statement for deletion of line item/table.
Processing statements for internal table
APPEND statement
• APPEND statement is used to add a single row or line to an existing internal table. This
statement copies a single line from a work area and inserts it after the last existing line in
an internal table.
READ TABLE statement
• READ TABLE statement reads a row from the internal table into a work area
SORT statement
• SORT statement sorts an internal table by the size of its components.
ABAP FORMS
What is a Form?

Form is a document with spaces (also named fields or placeholders) in which to write or select,
for a series of documents with similar contents. The documents usually have the printed parts in
common, except, possibly, for a serial number.
Tools used in ABAP Forms

• SAP Scripts
• Smart forms
• Adobe forms
Sap Scripts

SAP Scripts is used to generate formatted documents and for external purposes to print and
transfer business documents. Formatted document contains logos, tables, and other
formatting objects. You can print preformatted text in forms which are not possible with
normal ABAP codes.
Tcode: SE71
• OPEN_FORM
• START_FORM
• WRITE_FORM
• END_FORM
• CLOSE_FORM
Smart forms

• SAP Smart Forms have been introduced by SAP to enhance the capabilities and key
features over SAP Scripts. In Smart Forms, you need minimum coding when you compare
it with SAP Scripts.
• SAP recommends to replace SAP Script by Smart Forms as smart forms provide various
advantages over Scripting.
Tcode: Smartforms
Smartforms vs Sap Scripts

• Multiple page formats are possible in SmartForms which is not the case in SAPScripts
• It is possible to have a SmartForm without a main window.
• Routines can be written in SmartForms tool.
• SmartForms generates a function module when activated.
• Labels cannot be created in SmartForms.
Adobe Forms
• Open standard or PDF
• Interactive behavior can be achieved
• Supports scripting
• Interface can be reused
• No Smart Style or separate object is required for formatting
ADS Prerequisites
Adobe Lifecycle Designer
ADS connection configured
Person responsible: SAP BASIS

How to check ADS connection?


Execute the following programs:
FP_TEST_00
FP_CHECK_DESTINATION_SERVICE
Tcode: SFP
Interface
• Determines the data passed to the form
• Contains the import and export
parameters
• Default parameter: DOCPARAMS
• The same parameters will be available
in the generated FM
Interface View
• Interface Types
Form View
• Context
• Contains the data used in the form
• Elements/nodes are defined for use in
the layout
• Layout
• Designing
Subform
• A section in the form design that provides anchoring, layout, and geometry. The
objects in a subform can be arranged in rows, columns, etc.
• Nested subforms is possible
Graphics
Images can be uploaded via the Image object or via SE78 transaction
Graphics
SE78
Graphics
SE78
• Upload the BMP file to the document server using SE78
• In the interface, create a global variable of type XSTRING (hexadecimal)
• Use CL_SSF_XSF_UTILITIES=>GET_BDS_GRAPHIC_AS_BMP to store image to your
global variable. Use the following parameters:
• Object: ‘GRAPHICS’
NAME: ‘<NAME>’
ID: ‘BMAP’
BTYPE: ‘BCOL’ (colored) or ‘BMON’ (black & white)
• Under the Form context, add a graphic node and bind the global variable
ABAP Consumption
To consume the form created in ABAP, the following FMs will be used:
• FP_JOB_OPEN
• FP_FUNCTION_MODULE_NAME
• FP_JOB_CLOSE
Debugging
Types of Debuggers
The ABAP Debugger is used tool to execute and analyze programs line by line.
Using it we can check the flow logic of a program and display runtime values of
the variables. Currently, SAP offers two types of Debuggers:
 The Classic ABAP Debugger
 The New ABAP Debugger
Classic ABAP Debugger
The Classic ABAP Debugger, with its old user interface and its limitations to
debug certain types of ABAP program is now not in use by many new and old
ABAP developers.
New ABAP Debugger
The New ABAP Debugger, with its state of the art and flexible user interface, can
be used to debug all types of ABAP programs. It provides many new features
which improve our efficiency of debugging, both in ABAP support and
development.
Switching between Classic to New Debugger
Goto -> Navigate to -> Switch to Classic Debugger
Watchpoints
Watchpoints can be used to break the execution of a program when the values in
a variable changes.
This help us to go to the exact position where the variable changes. You can also
specify conditions in Watchpoint and the execution of the program will break as
soon as the condition is fulfilled.
Watchpoints
To create a Watchpoint, click to the Watchpoint button in the New ABAP
Debugger.
Now, in the Create Watchpoint pop up enter the variable name for which you want
to create the Watchpoint.
Debugger Variants
With the help of Debugger Variant you can save the current debugger settings into
the database or to a local file. These settings include breakpoints, UI
customizations and other special options for debugging tools.
Next time, when you will be debugging the same application you will not have to
set breakpoints again or to do all the settings again. Also, when you are working
in a large team then you can also pass the debugging variants to other users.
Debugger Variants
To save the ‘Debugging Variant’ go to Debugger→ Debugger Session→ Save
Debugger Variants
You can save the current debugger session either to a file or in the database.
Debugger Variants
In the Debugger Variant you can save the following components :
• Layout
• Breakpoints
• Settings
• Options
Debugger Variants
To load the saved Debugger variants go to Debugger → Debugger Session
→ Load
Debugging Tricks
Many a times, due to an incorrect entry in a database table or a table without
maintenance view we are not able to create, edit or delete a database record. In
these cases we can use this debugging trick.
To do this, go to transaction code SE16.
Debugging Tricks
Enter the name of your database table. Select
the line which you want to process, and press
the display button. Enter /h in the command
line and hit enter button two times.
Debugging Tricks
Now, the debugger window will open and you can see the source code. Click on
the variable CODE, it will have ‘SHOW’ as its value.
Debugging Tricks
Here you can edit this variable and set the new value based on the operation you
want to perform.
By setting the variable ‘CODE’ with value as ‘EDIT’ you can edit records,
‘INSR’, Insert new records
‘DELE’, Delete records
And, ‘ANVO’ is for editing the record with primary keys.
Debugging Tricks
After setting the variable with the required
operation, hit F8. Now, you are in EDIT mode.
Press save button to save the record.
SHIFT + F12
You can use this key combination to bypass a specific line of code such as a
normal sy-subrc check or an authorization check. To jump or bypass any
line/lines of code all  you have to fo is just put your cursor on the desired line
and then press the SHIFT + F12 key.
Enhancements
Enhancements
• Enhancement is a concept of adding your own functionality to SAP’s standard
business applications without having to modify the original applications
• Modify the standard SAP behavior as per customer requirements, we can use
enhancement framework
• Each enhancement point is called an exit point
Why Enhancements?
• They do not affect Standard SAP source code.
The Customer Objects are Linked to Standard Applications but exist separately
from SAP’s Standard Software Package.
They Do not Impact the Functionality during Updates.
• Customer Objects’ Name ensures that they are not affected by any changes or
the new Functionalities to the Standard Software Package when it comes to
Upgrade to a Higher Version.
Types of Enhancements
• User Exits
• Customer Exits
• BAdi’s
User Exits
• Subroutines where we can write our custom code to enhance the
application
• outdated
• Requires sap access key for user exits
Customer Exits
• Zinclude programs which are available inside a function module
• Each function module is called a customer exit
• Procedure oriented approach
• No access key required
Types of Customer Exits
• Function module exit
• Menu exit
• Screen exit
Function Module Exit
• Used when we want to write custom coding to enhance standard sap
application
• Each function module exit have a predefined signature (ex. Importing &
Exporting parameters)
• Each function module exit starts with Exit_XXXX_001
Menu Exit
• Used to add custom menus to the standard menu bar
• Each menu exit is identified by + symbol
• Every menu exit should have a function module exit to add the abap
coding for the custom menu options
• Used to add custom menu and function module exit is used to add the
ABAP logic for the corresponding menu exit
Screen Exit
Used to add custom sap screen to the standard sap screen
The New Enhancement Framework
Components of Enhancement Framework
• Enhancement Points
• Enhancement Sections
• Implicit & Explicit Enhancements
• BADIs
BADI
SE18
BADI
SE19
SE84
SMOD

You might also like