0% found this document useful (0 votes)
514 views85 pages

ABAP Complete Interview Guide

Uploaded by

Vishwa Borbacchi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
514 views85 pages

ABAP Complete Interview Guide

Uploaded by

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

Basic & Data Dictionary

ECC – Enterprise Central Components/ ERP Central Components IDES- International


Demonstration and Education System
Data Dictionary
ABAP Dictionary
You use the ABAP Dictionary to create and manage data definitions (metadata). The ABAP
Dictionary permits a central description of all the data used in the system without redundancies.
New or modified information is automatically provided for all the system components. This
ensures data integrity, data consistency and data security.
The ABAP Dictionary supports the definition of user-defined types (data elements, structures
and table types). You can create the corresponding objects (tables or views) in the underlying
relational database using these data definitions. The ABAP Dictionary describes the logical
structure of the objects used in application development and shows how they are mapped to the
underlying relational database in tables or views.
The ABAP Dictionary also provides standard functions for editing fields on the screen, for
example for assigning input help to a screen field.
Data Dictionary: It is a central source of data management system its main functions is to
support the creation and management of data definition. It has details about:
• What data is contained?
• What are the attributes of the data?
• What is the relationship existing between the various data elements?

What ABAP In • a Management data functions management does of data a

system, data definitions.

Interview dictionary the principal perform?

Guide
functions performed by the data dictionary Pran
are:
• Provision of information for evaluation.
• Support for s/w development.
• Support form documentation.
• Ensuring that the data definitions are flexible and up-to-date.
What are the features of ABAP/4 Dictionary? The most important features are:
• Integrated to a ABAP/4 Development Workbench.
• Active in the runtime environment.
What are the uses of the information in the Data dictionary? The following information is
directly taken from the Data dictionary:
• Information on fields displayed with F1 help.
• Possible entries for fields displayed with F4 help.
• Matchcode and help views search utilities.
What are the aggregate objects in the data dictionary?
• Views
• Match codes
• Lock objects. In the ABAP/4 Dictionary Tables can be defined independent of the
underlying database. True.
Objects of Data Dictionary/Repository Objects of Data Dictionary There are seven
objects of Data Dictionary:
1) Database Table
2) View
3) Data Type
4) Type Group
5) Domain
6) Search Help
7) Lock Objects
1. Database Table
Tables are defined in the ABAP Dictionary independently of the database. From this table
definition follows the creation of a table with the same structure in the underlying database.
Types of Database Tables
There are three types of database tables as follows:
Transparent Table Pool Table Cluster Table
Contain a single table. Used to store master data
Transparent table There is a physical table on the database for each transparent table. The
names of the physical tables and the logical table definition in the ABAP/4 Dictionary
correspond. All business data and application data are stored in transparent tables. Exists with
the same structure both in the dictionary and database exactly with same data and fields. It’s to
store transaction data. It’s one to one Relation table
Pooled table Pooled tables can be used to store control data (e.g. screen sequences, program
parameters or temporary data). Several pooled tables can be combined to form a table pool.
The table pool corresponds to a physical table on the database in which all the records of the
allocated pooled tables are stored. These are logical tables must be assigned to a table pool
when they are defined. Its use to store control data. It’s many to one relation table
They are used to hold a large number of very small tables (stores customizing data or system
data)
They are used to hold data from a few number of large tables.(stores system data)
It has a one-to-one relationship with a table in the database
It has a many-to-one relationship with a table in the database

It has a many-to-one relationship ABAP For one each associated transparent

table in table the


Interview there is

It single is stored table with called other table pooled pool Guide in tables the

with table in the database


database
in a

Pran database

Many cluster tables are stored in a single table in the database called a table cluster
The database table has the same name, same number of fields and the fields have the same
names
The database table has different name, different number of fields and fields have different
names
The database table has different name, different number of fields and fields have different
names
There is only a single table Table pools contain more tables than
table clusters
Contains less tables than table pools
Single table can have one or more primary key
Primary key of each table does not begin with same fields or fields
Primary key of each table begins with same fields or fields
Secondary indexes can be created Secondary indexes cannot be created Secondary indexes
cannot be created
They can be accessed using open and native SQL
They can be accessed using open SQL only
They can be accessed using open SQL only
Cluster table Cluster tables contain continuous text, for example, documentation. Several
cluster tables can be combined to form a table cluster. Several logical lines of different tables
are combined to form a physical record in this table type. This permits object-by-object storage
or object-by-object access. In order to combine tables in clusters, at least parts of the keys must
agree. Several cluster tables are stored in one corresponding table on the database. These also
logical tables and must be assigned to table cluster when they are defined. It’s also used to
store control data, temporary data or text ex., documentation. It’s also many to one relation
table.
2. View
Views are logical views of more than one table. The structure of the view is defined in the ABAP
Dictionary. A view of the database can then be created from this structure. A view on one or
more tables i.e., the data from a view is not actually physically stored instead being derived from
one or more tables.
Types of Views There are four types of views. They are as follows
a) Database View: Often several database tables contain the data about an application object.
A database view
provides an application-specific view of such distributed data. Database views are defined in the
ABAP Dictionary. The system automatically creates a database view in the underlying database
when you activate the view. Application programs can access the data of a database view using
the database interface. You can access the data in ABAP programs with both OPEN SQL and
NATIVE SQL. Since a database view is implemented in the database; a database view can
only contain transparent tables. Inner Joins are only allowed.
Database view are implement an inner join, that is, only records of the primary table (selected
via the join operation) for which the corresponding records of the secondary tables also exist are
fetched. Inconsistencies between primary and secondary table could, therefore, lead to a

reduced selection set. In database views, the ABAP join view, view conditions

if they they must are can linked be taken be Interview formulated to

from one another existing using via foreign equality foreign keys. relationships keys.

Guide
That is, tables between can only any be base collected

Pran
fields. in In maintenance the other types or help
of
b) Projection view: Projection views are used to hide fields of a table. A projection view
contains exactly one
table. You cannot define selection conditions for projection views. You can also access pooled
tables and cluster tables with a projection view.
Projection view Projection views are used to suppress or mask certain fields in a table
(projection), thus minimizing the number of interfaces. This means that only the data that is
actually required is exchanged when the database is accessed. A projection view can draw
upon only one table. Selection conditions cannot be specified for projection views.
c) Maintenance View (SE54): Data distributed on several tables often forms a logical unit all
the tables in a
maintenance view must be linked with foreign keys, that is the join conditions for
maintenance views are always derived from the foreign key .Join conditions cannot be directly
entered as for database views. Existing view entries can be changed. Records cannot be
deleted or inserted. Only entries whose non-time-dependent part of the key is the same as that
of existing entries may be inserted in Maintenance view (se54).
Maintenance views enable a business-oriented approach to looking at data, while at the same
time, making it possible to maintain the data involved. Data from several tables can be
summarized in a maintenance view and maintained collectively via this view. That is, the data is
entered via the view and then distributed to the underlying tables by the system.
d) Help view: Created with outer join for search help. The selection method of a search help is
either a table or a view. For records from multiple tables joined by inner join, database view is
utilized in search help; if an outer join is needed, help view is used. All the tables included in a
help view must be linked with foreign keys.
Help views are used to output additional information when the online help system is called.
When the F4 button is pressed for a screen field, a check is first made on whether a Matchcode
is defined for this field. If this is not the case, the help view is displayed in which the check table
of the field is the primary table. Thus, for each table no more than one help view can be created,
that is, a table can only be primary table in at most one help view. Views improve
performance in the following aspects
• If you want to use more than two tables in 'JOIN' condition better to use Views. It will
improves performance of a program
• If you want to use multiple FOR ALL ENTRIES clause, better to club all SELECT statement in
a view.
3. Data Type
Data types are the actual type definitions in the ABAP Dictionary. They allow you to define
elementary types, reference types, and complex types that are visible globally in the system.
The data types of database tables are a subset of all possible types, namely flat structures.
Global object types (classes and interfaces) are not stored in the ABAP Dictionary, but in the
class library. You create them using the Class Builder.
Three Data Types that can be created in Data Dictionary:
• Data Element
• Structure
• Table Type

❖ Data Element ABAP Data complex OR

Interview
elements types in described the ABAP below, Dictionary and

Guide
are describe used to specify individual the fields. types of They columns

are the in smallest the Pran


database.
indivisible units of the
It is used to describe the semantic definition of the table fields like description the field. Data
element describes how a field can be displayed to end-user.
Domains are used to provide the technical properties to the field. (Data type, size and value
constraints).
Data elements are provide the semantic properties to the fields. Those are labels and
documentation,
Domains are not directly attached to the fields. But data elements are directly attached to the
fields.
One domain can be attached to the no of data elements. And one data element can be attached
to the no of fields, Data elements can be of two types:
➢ Elementary Types. ➢ Reference Types.
➢ Elementary Types
Elementary types are part of the dual-level domain concept for fields in the ABAP Dictionary. The
elementary type has semantic attributes, such as texts, value tables, and documentation, and has
a data type. There are two different ways to specify a data type:
Elementary types are the smallest indivisible unit of types. They can be grouped as those with
fixed length and those with variable length. Fixed-Length Elementary Types There are eight
predefined types in ABAP with fixed length:
• Four character types:
Character (C), Numeric character (N), Date (D), and Time (T).
• One hexadecimal type:
Byte field (X).
• Three numeric types:
Integer (I), Floating-point number (F) and Packed number (P).
Variable-Length Elementary Types There are two predefined types in ABAP with variable
length:
• STRING for character strings
• XSTRING for byte strings
1. By Directly Assigning An ABAP Dictionary Type
You can assign a predefined ABAP Dictionary type and a number of characters to an
elementary type. The ABAP Dictionary has considerably more predefined types than the ABAP
programming language. The number of characters here is not the field length in bytes, but the
number of valid characters excluding formatting characters. The data types are different
because the predefined data types in the ABAP Dictionary have to be compatible with the
external data types of the database tables supported by the R/3 System.
When you refer to data types from the ABAP Dictionary in an ABAP program, the predefined
Dictionary types are converted to ABAP types as follows:
Dictionary Type Meaning Maximum Length n ABAP Type
DEC Calculation/amount field 1-31, 1-17 in tables P((n+1)/2)

INT1 Single-byte integer 3 Internal only ABAP INT2 INT4


Interview Two-byte Four-byte integer integer Guide 5

Pran
10

Internal I
only
CURR Currency field 1-17 P((n+1)/2)
CUKY Currency key 5 C(5)
QUAN Amount 1-17 P((n+1)/2)
UNIT Unit 2-3 C(n)
PREC Accuracy 16 Internal only
FLTP Floating point number 16 F(8)
NUMC Numeric text 1-255 N(n)
CHAR Character 1-255 C(n)
LCHR Long character 256-max C(n)
STRING. String of variable length 1-max STRING.
RAWSTRING Byte sequence of variable length 1-max XSTRING
DATS Date 8 D
ACCP Accounting period YYYYMM 6 N(6)
TIMS Time HHMMSS 6 T
RAW Byte sequence 1-255 X(n)
LRAW Long byte sequence 256-max X(n)
CLNT Client 3 C(3)
LANG Language internal 1, external 2 C(1)
("max" in LCHR and LRAW is the value of a preceding INT2 field. The "internal" length of a
LANG field is in the Dictionary, the "external" length refers to the display on the screen.
2. Assigning A Domain
The technical attributes are inherited from a domain. Domains are standalone Repository
objects in the ABAP Dictionary. They can specify the technical attributes of a data element. One
domain can be used by any number of data elements. When you create a domain, you must
specify a Dictionary data type (see above table) and the number of characters.
➢ Reference Types
Reference types describe single fields that can contain references to global classes and
interfaces from the ABAP class library. In an ABAP program, you can use the TYPE addition to
refer directly to a data element. The predefined Dictionary data types of the domain are then
converted into the corresponding ABAP types. OR Reference types describe data objects that

contain references (pointers) to other objects (data objects and objects in ABAP Objects).
There is a hierarchy of reference types that describes the hierarchy of objects to which the
references can point. There are no predefined references - you must define them yourself in a
program.
❖ Structure
A structure is a sequence of any other data types from the ABAP Dictionary, that is, data

elements, structures, ABAP table name In If you an types, ABAP and define a

or data program, a database local type.

data Interview you tables. type can in use When a program the you

TYPE create by addition referring a structure to to refer Guide a in structure

directly the ABAP as to follows:


Dictionary, a structure.

Pran
each component must have a
TYPES <t> TYPE <structure>.
The construction blueprint of the structure is used to create a local structure <t> in the program.
The predefined Dictionary data types of the domains used by the data elements in the structure
are converted into the corresponding ABAP types. The semantic attributes of the data elements
are used for the corresponding components of the structure in the program. The components of
the local structure <t> have the same names as those of the structure in the ABAP Dictionary.
To ensure compatibility with previous releases, it is still possible to use the LIKE addition in an
ABAP program to refer to a structure in the ABAP Dictionary (except in classes).
❖ Table Types
Table types are construction blueprints for internal tables that are stored in the ABAP Dictionary.
When you create a table type in the ABAP Dictionary, you specify the line type, access type,
and key. The line type can be any data type from the ABAP Dictionary, that is, a data element, a
structure, a table type, or the type of a database table. You can also enter a predefined
Dictionary type directly as the line type, in the same way that you can with a domain. In an
ABAP program, you can use the TYPE addition to refer directly to a table type. If you define a
local data type in a program by referring to a table type as follows: TYPES <t> TYPE <table>.
The construction blueprint of the table type is used to create a local internal table <t> in the
program. The predefined Dictionary data types of the domains used by the data elements in the
structure are converted into the corresponding ABAP types. The semantic attributes of the data
elements are used for the corresponding components of the internal table in the program.
4. Type Group
Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to
which you could refer using a TYPE addition in an ABAP program. It was only possible to refer
to flat structures. Structures in programs corresponded to the structures of database tables or
structures in the ABAP Dictionary.
In ABAP programs, you could only refer to database tables and structures in the ABAP
Dictionary using LIKE. It was, however, possible to refer to individual components of the
Dictionary type. Complex local data types such as internal tables or deep structures had no
equivalent in the ABAP Dictionary.
The solution to this from Release 3.0 onwards was to use type groups. Type groups were based
on the include technique, and allowed you to store any type definitions globally in the Dictionary
by defining them using TYPES statements. The definition of a type group is a fragment of ABAP
code which you enter in the ABAP Editor. The first statement for the type group <pool> is
always: TYPE-POOL <pool>.
After this came the definitions of data types using the TYPES statement, as described in Local
Data Types in Programs. It was also possible to define global constants using the CONSTANTS
statement. All the names of these data types and constants must begin with the name of the
type group and an underscore: In an ABAP program, you must declare a type group as follows
before you can use it:
TYPE-POOLS <pool>. This statement allows you to use all the data types and constants
defined in the type group <pool> in your program. You can use several type groups in the same
program.

Let the type group HKTST be created as follows in the ABAP Dictionary: ABAP
TYPE-POOL TYPES: BEGIN col1(10) Interview hktst.

OF TYPE hktst_typ1,
c,

Guide Pran col2 TYPE i, END OF hktst_typ1.

TYPES hktst_typ2 TYPE p DECIMALS 2.


CONSTANTS hktst_eleven TYPE i VALUE 11.
This type group defines two data types HKTST_TYP1 and HKTST_TYP2, as well as a constant
HKTST_ELEVEN with the value 11.
Any ABAP program can use this definition with the TYPE-POOLS statement:
TYPE-POOLS hktst.
DATA: dat1 TYPE hktst_typ1,
dat2 TYPE hktst_typ2 VALUE '1.23'.
WRITE: dat2, / hktst_eleven.
The output is: 1,23 11 The data types defined in the type group are used to declare data

objects with the DATA statement and the value of the constant is, as the output shows,
known in the program.
5. Domain
A domain defines a value range. A domain is assigned to a data element. All table fields or
structure components that use this data element then have the value range defined by the domain.
The relationship between the field or component and the domain is thus defined by the data
element of the field or component.
Fields or components that refer to the same domain (with the assigned data elements) are also
changed when the domain is changed. This ensures that the value ranges of these fields or
components are consistent. Fields or components that are technically the same can thus be
combined with a reference to the same domain. OR
Domain is the central object for describing the technical characteristics of an attribute of
a business objects. It describes the value range of the field.
The value range of a domain is defined by specifying a data type and length (and number of
decimal places for numeric data types). Example
A personnel number is defined by the data format NUMC and by specifying the number of
places for this personnel number. The value range of a domain can be restricted by defining
fixed values. If all the fields or components that refer to the domain should be checked against a
certain table, this table can be defined as the value table of the domain. Output attributes can
also be defined for all the fields or components that refer to the domain (see Creating Domains).
A conversion routine can be assigned to a domain. This conversion routine converts values
from display format to internal format for the fields or components that refer to this domain.
Can you delete a domain, which is being used by data elements? No.
Can a domain, assigned to a data element be changed? Yes. We can do so by just
overwriting the entry in the field domain.
Can you delete data element, which is being used by table fields? No.
Can you define a field without a data element? Yes. If you want to specify no data element
and therefore no domain for a field, you can enter data type and field length

ABAP 6. Search and a Help

Interview
short text directly in the table maintenance.

Guide Pran Search helps can be used to assign an input help

(F4 help) to screen fields. You can do this by creating a search help in the ABAP Dictionary and
attaching it to the corresponding screen field.
The input help (F4 help) is a standard function of the SAP System. The user can display the list
of all possible input values for a screen field with the input help. The possible input values can be
enhanced with further information. This is meaningful especially when the field requires the input
of a formal key.
There are two types of search help:
• Elementary Search helps describe a search path. The elementary search help must define
where the data of the hit list should be read from (selection method), how the exchange of
values between the screen template and selection method is implemented (interface of the
search help) and how the online input help should be defined (online behavior of the search
help). An elementary search help defines the standard flow of an input help. You can define
the following components of this flow in the search help:
• where does the data displayed in the hit list come from (selection method)
• what information should be displayed in the dialog box for value selection and in the hit list
(search help parameters)
• what field contents can be taken into account for hit list selections and which values in the hit
list can be returned to the screen fields (search help parameters)
• what dialog steps should be executed in the input help (dialog behavior)
• Collective Search Helps combine several elementary search helps. A collective search help
thus can offer several alternative search paths. OR A collective search help combines several
elementary search helps. The user can thus choose one of several alternative search paths with
a collective search help.
When you define a collective search help, you only have to specify the search helps that are to
be combined in the collective search help. In the input help, the values are transported between
the elementary search help selected by the user and the input template using the collective
search help. This is why a collective search help also has an interface for transporting the
values.
7. Lock Objects
These objects are used to synchronize access to the same data by more than one user.
Function modules that can be used in application programs are generated from the definition of
a lock object in the ABAP Dictionary. OR The SAP system synchronizes several users'
simultaneous access to the same data records with a lock mechanism. When interactive
transactions are programmed, the system sets and releases locks by calling function modules.
These function modules are automatically generated from the definition of lock objects in the
ABAP Dictionary.
Structure In a lock object, you must define the tables in which data records must be locked with
a lock request, and the key fields of these tables. When you select the tables, you must first
select the primary table. You can also add further tables (secondary tables), using foreign key
relationships. The following figure shows a primary table and its relations with two other tables
(secondary tables).
Types of Locks
You can use different types of locks. The lock mode describes what type of lock it is. The lock

ABAP
modes are listed in the table below. Locks Modes Shared Type of lock

Lock S (Shared) Lock Interview mode Several users (transactions)


Guide Description

Pran
can access locked

data at the same time in display mode. A request for another shared lock is accepted, even if
it comes from another user. An exclusive lock set on an object that already has a shared lock
will be rejected.
Exclusive lock E (Exclusive) An exclusive lock protects the locked object against all types
of locks from other transactions. Only the same lock owner can reset the lock (accumulate).
Exclusive but not cumulative lock
Read Lock (Shared Locked) Read locks allow the system to set other read locks, but prevent
other transactions from setting write locks for the objects in question.
Write Lock (exclusive lock) Write locks do not allow other transactions to set any locks for the
objects in question.
Enhanced write lock (exclusive lock without cumulating) Works like a write lock except that
the enhanced write lock also protects from further accesses from the same transaction.
X (eXclusive non- cumulative)
Exclusive locks can be requested several times from the same transaction and are processed
successively. In contrast, exclusive but not cumulative locks can be called only once from the
same transaction. Each further lock request will be rejected.
Optimistic lock O (Optimistic) Optimistic locks initially behave like shared locks and can be
converted into exclusive locks.
You can create a lock on an object of SAP through transaction SE11 and enter any meaningful
name start with EZ. Example EZTEST_LOCK.
When you create a lock object System automatically create two function modules. 1.
ENQUEUE_<Lockobject name>. To insert the object in a queue. 2. DEQUEUE_<Lockobject
name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
Buffering Types
The buffering type defines which table records are loaded into the buffer of the application
server when a table record is accessed. OR Table buffering is used to increase performance
when reading data from database table. Data from a buffered table is read from a local buffer on
the application server thus reducing database access. There are three types buffering as
follows:
1. Full buffering: All the records of the table are loaded into the buffer when one record of the
table is accessed. 2. Generic buffering: When a record of the table is accessed, all the records
having this record in the generic key
fields (part of the table key that is left-justified, identified by specifying a number of key fields)
are loaded into the buffer. 3. Single-record buffering: Only the records of a table that are really
accessed are loaded into the buffer.
What is table maintenance generator (SM30)? Table Maintenance Generator is a tool used to
customize the tables created by end users and can be changed as required, such as making an
entry to that table, deleting an entry etc. OR In other words, table maintenance generator is a
user interface tool which is used to change the entry of the table or delete an entry from the

ABAP
table or create an entry for the table. Prerequisite To Maintenance'

make this feature tab, the work 'Table Interview care View should

Guide
Maint.' be taken should while have creating the "Maintenance the

database allowed" table that property in Pran


the defined.
'Delivery and
Table Maintenance Events The value to be displayed on the maintenance screen for any field
can also be altered as per the requirement like for every new entry in the table one of the field
should have the constant value appearing automatically. For this purpose, the event needs to
be chosen which performs the action. In this case event "05 creating a new entry". Table
Maintenance is used to maintain the values of a custom table. Based on the requirements, one
can change or add/delete the contents of the custom table. Table Maintenance generator is
required to do Manual entries in the Table. If the requirement is to update the table only
programmatically and not manually then table maintenance generator is not required. Manual
entries in table can be maintained (New record can be inserted / existing can be modified) using
transaction SM 30, if the table maintenance for the table is generated.
List of Events available in Table maintenance generator:
Events Description
01 Before saving the data in the database
02 After saving the data in the database
03 Before deleting the data displayed
04 After deleting the data displayed
05 Creating a new entry
06 After completely performing the function 'Get original'
07 Before correcting the contents of a selected field

ABAP Interview Guide


Pran
For selecting the events follow the path as Environment → Modification → Events
08 After correcting the contents of a selected field
Dispatcher 09 After getting the original of
an entry
10 After creating the header entries for the change task (E071)
11 After changing a key entry for the change task (E071K)
12 After changing the key entries for the change task (E071K)
13 Exit editing (exit main function module)
14 After lock/unlock in the main function module
15 Before retrieving deleted entries
16 After retrieving deleted entries
17 Do not use. Before print: Event 26
18 After checking whether the data has changed
19 After initializing global variables, field symbols, etc.
20 After input in date sub screen (time-dep. tab. /views)
21 Fill hidden fields
22 Go to long text maintenance for other languages
23 Before calling address maintenance screen
24 After restricting an entry (time-dep. tab./views)
25 Individual authorization checks
26 Before creating a list
27 After creation or copying a GUID (not a key field)
28 After entering a date restriction for time-dep. views
AA Instead of the standard data read routine
AB Instead of the standard database change routine
AC Instead of the standard 'Get original' routine
AD Instead of the standard RO field read routine
AE Instead of standard positioning coding
AF Instead of reading texts in other languages
AG Instead of 'Get original' for texts in other languages
AH Instead of DB change for texts in other languages
AI Internal use only
ST GUI menu main program name
An SAP application server has to process SAP requests from multiple front ends. The application
server has the use of a dispatcher, which gathers the requests and transfers them for processing
to the work processes. The work processes then execute the desired requests. OR
The dispatcher is the link between the work processes and the users logged onto the ABAP
application server (that is, the SAP GUIs of these users). Its task is to receive requests for
dialog steps from the SAP GUI and direct them to a free work process. In the same way, it
directs screen output resulting from the dialog step back to the appropriate user.
Shared Memory
All of the work processes on an ABAP application server use a common main memory area
called shared memory to save contexts or to buffer constant data locally. The resources that all
work processes use (such as programs and table contents) are contained in shared memory.
Memory management in the NetWeaver AS ABAP ensures that the work processes always
address the correct context, that is the data relevant to the current state of the program that is
running. A mapping process projects the required context for a dialog step from shared memory
into the address of the relevant work process. This reduces the actual copying to a minimum.
Work Process
Work processes execute the individual dialog steps in R/3 applications. The next two sections
describe firstly the structure of a work process, and secondly the different types of work process
in the R/3 System. Each work process handles one type of request. OR
Work processes are components that are able to execute an application (that is, one dialog step
each). Each work process is linked to a memory area containing the context of the application
being run. The context contains the current data for the application program. This needs to be

available in each dialog step. There ABAP 1. 2. Dialog Update are five Work

Work types Process Process of work Interview →Dialog →Update

processes:

work work processes processes deal execute with database requests Guide
from update an requests. active user Pran
Update to execute requests dialog are part steps.
of an SAP LUW that bundle the database operations resulting from the dialog in a database
LUW for processing in the background. 3. Background Work Process →Background work
processes process programs that can be executed without user
interaction (background jobs). 4. Enqueue Work Process →The Enqueue work process
administers a lock table in the shared memory area. The
lock table contains the logical database locks for NetWeaver AS ABAP and is an important part
of the SAP LUW concept. In NW AS, you may only have one lock table. You may therefore also
only have one ABAP application server with Enqueue work processes. Normally, a single
Enqueue work process is sufficient to perform the required tasks. 5. Spool Work Process →The
spool work process passes sequential datasets to a printer or to optical archiving.
Each ABAP application server may contain only one spool work process.
Work Process Type Use
Dialog Executes dialog programs (ABAP). Processes only one request at a time
Update Asynchronous database changes (is controlled by a COMMIT WORK statement in a
dialog work process)
Background Executes time-dependent or event-controlled background jobs
Enqueue Executes locking operations (if SAP transactions have to synchronize themselves)
Spool Print formatting (to printer, file or database). Generated online or during back ground
processing for printing)
What are the user context, roll and page areas? User context is defined as temporary
memory area that contains the information about users. Roll area is memory area which is
allocated by work processes for program instance. Page area paging area holds data from the
application programs.
What is a Spool request? - Spool requests are generated during dialog or background
processing and placed in the spool Database with information about the printer and print format.
Data Types – Describes data objects.
Data Objects – Data objects are fields their contain data with which programs work at runtime.
Function of the transport system and workbench organizer: is to manage any changes
made to objects of the ABAP/4 Development Workbench and to transport these changes
between different SAP systems.
Generated view structure In activation a structure is generated for a view. This structure
serves as interface for the runtime environment. It does not generally appear in the ABAP/4
Dictionary.
TYPE - It will allocate memory during execution (object type). Type will improve performance.
When you want to create a data object of an existing data type
LIKE - When you have a data object and you want to create a similar data object. Like: it will
allocate memory immediately
What are the Data types of the ABAP/4 layer? Possible ABAP/4 data types:
C: Character -1
D: Date, format YYYYMMDD - 8.

F: Floating-point number in DOUBLE PRECISION (8 bytes) - 8. ABAP I: N:

Integer Numerical - 4.

Interview
character string of arbitrary length - 1.

Guide Pran P: Amount of counter field (packed; implementation

depends on h/w platform) - 8.


S: Time Stamp HHMMSS - 6.
V: Character string of variable length, length is given in the first two bytes.
X: Hexadecimal (binary) storage - 1.
T: Time field – 8.
Cluster tables: BSEC, BSED, BSEG, BSES, BSET, AUAA, KONV and AUAB.
Pool tables: M_MTVMA, M_MTVMB, M_MTVMC, M_MTVMD, M_MTVME, M_MTVNF.
Independent transport objects: Domains, Data elements, Tables, Technical settings for
tables, Secondary indexes for transparent tables, Structures, Views, Matchcode objects,
Matchcode Ids, Lock objects.
Structure: No data records exist in the database for a structure. Structures are used for the
interface definition between programs or between screens and programs (max 9 structures)
INCLUDE Structures: Include Structure is used to include the structure to a Custom Table. The
same Structure can be Included in any number of Custom Tables. To include it in the Custom
Table Provide .INCLUDE as field name and Structure name as Field Type.
APPEND Structures: Append Structure is used to append to the Standard Tables. The Same
Append Structure cannot be appended in more than one Standard DB Table. We need to create
the Append Structure by opening the Table in Display mode and by clicking on the Append
Structure button. Append structures are used to support modifications.
Note: we cannot include customizing include or an append structure with Pooled or Cluster
tables.
What is Append Structure and .Include? Append Structure is assigned to exactly one table.
i.e., an append structure can be used only for the table it is created. Append structures cannot
be used with cluster and pool tables
An include structure is reusable i.e., can be used in several tables. If you add a field to an
include structure, all tables that contain that include structure will be updated. Customizing
includes begin with CI_ and is part of the customer namespace One Customizing include can be
inserted into more than one table. As an example the customizing include that we created
(CI_DEMO) could be a part of multiple tables in the database whereas the append structure
(ZDEMO_APPEND) can only be assigned to one table. (Here MARA).
Local objects (Dev class $TMP) are independent of correction and transport system.
Technical Settings: By specifying technical settings we can control how database tables are
created in the database. OR You use the technical settings of a table to define how the table is
handled when it is created in the database. You can specify whether the table is buffered and
whether changes to data records of the table are logged.
The most important parameters are:
• Data class
• Size category
• Buffering permission The buffering permission defines whether the table can be buffered.
• Buffering type If the table can be buffered, you must define a buffering type (full, generic,
and single-record). The buffering type defines how many table records are loaded into the buffer
when a table entry is accessed.
• Logging This parameter defines whether the system logs changes to the table entries. If
logging is switched on, the system records each change to a table record in a log table.

ABAP The converted Data Convert Class: into The to transparent transparent
Data class Interview tables table determines earlier flag (transparent

on in which with this table flag) flag.

space is also the Guide displayed table is stored for pooled when it tables

Pran
is created or for in tables the database. which were OR Each data class corresponds to a
physical area in which all the tables assigned to this data class are stored.
• APPL0 - Master data (data frequently accessed but rarely updated)
• APPL1 - Transaction data (data that is changed frequently)
• APPL2 - Organizational data
Two further data classes, USR and USR1, are provided for the customer. These are for user
developments. The tables assigned to these data classes are stored in a table space for user
developments. In the following figure you can see tables assigned to different data classes. The
figure presents the tables in the ABAP Dictionary and in the database.
Size Category: The Size category describes the probable space requirement of the table in the
database. There are ten size categories (0-9). A certain fixed memory size in the database,
which depends on the database system used, is assigned to each category. Selecting the
correct size category prevents the creation of a large number of small extents for a table. It also
prevents the waste of space if extents that are too large are created.
Control Tables: The values specified for the size category and data class are mapped to
Database-specific values via control tables.
Table Pool: a table in the database in which all records from the pooled tables assigned to the
table pool are stored corresponds to a table pool.
Table Cluster: several logical data records from different cluster tables can be stored together
in one physical record in a table cluster.
Note: A table pool or table cluster should be used exclusively for storing internal control
information (screen sequences, program parameters, temporary data, and continuous
texts such as documentation). Data of commercial relevance is usually stored in
transparent tables.
Database Utility: is the interface between the ABAP Dictionary and the relational database
underlying the R/3 System. The database utility allows you to edit (create, delete and adjust to
changes to their definition in the ABAP Dictionary) database objects derived from objects of the
ABAP Dictionary.
What is the difference between a Substructure and an Append Structure? In case of a
substructure, the reference originates in the table itself, in the form a of a statement .include... In
case of an append structure, the table itself remains unchanged and the reference originates in
the append structure.
Delivery Class: The delivery class controls the degree to which the SAP or the customer is
responsible for table maintenance.
A – Application Table (master & transaction data).
C – Customizing Table, maintenance only by cust, not SAP import.
L – Table for storing temporary data, delivered empty.
G – Customizing Table, protected against SAP Upd., only INS all.
E – Control Table, SAP and customer have separate key areas.
S – System Table, maint. Only by SAP, change = modification.
W – System Table, contents transportable via separate TR objects.

Data Browser/Table View Maint. ABAP X: N: Display Display Display

/Maintenance /Maintenance /Maintenance Allowed Allowed

Interview Not Allowed with Restrictions.

Guide Pran Table Attribute: The table’s attributes determine

who is responsible for maintaining a table and which types of access are allowed for the table.
The most important table attributes are: Delivery class, Table maintenance allowed.
Match Code: is a tool to help us to search for data records in the system. Match codes are an
efficient and user- friendly search aid where key of a record is unknown. The number 0 to 9 are
reserved for us to create our own Match Code Ids for a SAP defined Match code object.
Primary Key – It can accept 0 values and cannot be NULL. Each internal table has a primary
table key that enables access to individual rows in the table by means of a key specification.
The components of the primary table key are declared using the UNIQUE|NON-UNIQUE KEY
additions of the statements TYPES, DATA, and so on. The standard key, which can be declared
both explicitly and implicitly, has a special part to play here. The primary table key of a standard
table can also be empty, meaning that it does not contain any key fields. In the case of key
accesses for internal tables, the primary key is always used implicitly as long as no secondary
key is specified.
Access to an internal table using the primary table key is determined by the table type and not
the table key. For sorted tables and hashed tables, key access is always optimized using the
primary table key. Primary key access to standard tables, however, uses a linear search. The
key fields of the primary table key of sorted tables and hashed tables are always read-only.
In the case of sorted tables and hashed tables, separate key administration exists for the
primary table key, which enables optimized access but also affects the memory requirement of
the internal table. There is no separate key administration for the primary table key of standard
tables.
Notes
• Since sorted tables and hashed tables have real key administration for the primary key,
unlike standard tables, these tables are also grouped under the term key tables.
• To achieve optimized key access to standard tables, secondary keys can be used.
Difference between Primary Key & Unique Key
Standard Key
The standard key is a special primary table key in an internal table.
Key Fields of the Standard Key
The key fields of the standard key are defined as follows:
• In tables with a structured row type, the standard key is formed from all components with
character-like and byte- like data types, with any substructures being expanded by elementary
components. If the row type does not contain components like these, then the standard key is
empty for standard tables, meaning it does not contain any key fields.
• The standard key for tables with non-structured row types is the entire table row, if the row
type itself is not table- like. If the row type is table-like, then the standard key is empty for
standard tables.
Empty standard keys are not possible for sorted tables and hashed tables, and an error occurs
if an attempt is made to create a key like this.
Notes
• In tables with non-structured row types, the standard key can also have a numeric type or
reference type; this does not apply for the key fields if the row types are structured.
• The static boxes of a structured row type are handled like regular components, with respect
to the standard key.
Foreign Key
If you want to link two tables, then primary key of one table will be added to another table where
primary key of first table will be become the foreign key of second table. This is sometimes
called a referencing key. The main purpose of the foreign key is data validation.
Data Objects
Primary Key Unique Key
It will not accept null values One and only one Null values are accepted.
There will be only one primary key in a table
More than one unique key will be there in a table.
Clustered index is created in Primary key Non-Clustered index is created in unique key.
Primary key makes the table row unique (i.e. there cannot be 2 rows with the exact same key).
You can only have 1 primary key in a database table.
Unique key makes the table column in a table row unique (i.e., no 2 table row may have the
same exact value). You can have more than 1 unique key table column (unlike primary key
which means only 1 table column in the table is unique).
Primary key allows each row in a table to be uniquely identified and ensures that no duplicate
rows exist.
Unique key constraint is used to prevent the duplication of key values within the rows of a table
and allow null values.

ABAP Interview Guide


Pran
A data object is a part of the repository whose content can be addressed and interpreted by the
program. All data objects must be declared in the ABAP program and are not persistent,
meaning that they only exist while the program is being executed.
Before you can process persistent data (such as data from a database table or from a
sequential file), you must read it into data objects first. Conversely, if you want to retain the
contents of a data object beyond the end of the program, you must save it in a persistent form.
Repository Info. Systems? : It is a tool with which you can make data stored in the ABAP/4
Dictionary available.
Aggregated Objects: Views, match codes, and lock objects are aggregate objects because
they are formed from several related tables.
Type group: There are several type groups available in SAP. For example ‘ABAP’ and ’SLIS’
etc. To use them in program we use key word ‘TYPE-POOLS’. It allows us to define non-
predefined types. Combination of all such non- predefined types is knows as type-pool or type-
group. In simple terms, if we want to use some custom types in various programs then we need
not define them separately, we can simply create a type group in ABAP dictionary and use that
in our programs. Restrictions on Pooled and Cluster Tables ➢ Secondary indexes cannot be
created.
➢ Distinct or Group by Statements cannot be used.
➢ Native SQL cannot be used.
➢ Order by statements cannot be used; only order by primary key cannot be used.
Distinct: If you do not use DISTINCT (<lines> is then empty), the system reads all of the lines

that satisfy the WHERE ABAP Order Binary By: Search condition. The

Interview
means results If you that are use sorted you DISTINCT, can

by access employee an the entry system ID in in ascending a excludes standard

Guide order

duplicate table by its entries

key as quickly Pran


as you would be able to in a sorted table
Foreign key: One/more fields in a table that occurs as key field in another table
Primary key: Columns in a table whose values are uniquely identify the rows in a table.
How to write select statement for secondary index: SELECT carrid connid cityfrom FROM
spfli INTO (xcarrid, xconnid, xcity from) WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'
%_HINTS ORACLE ‘INDEX ("SPFLI" "SPFLI~001")'. SELECT ...FROM table INTO ...WHERE
...%_hints oracle 'index ("TABLE" "INDEX_NAME")'.
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only
one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user
can see the key fields in the first screen and can further go on to edit further details. By creating
events we can do field validation in table maintenance generator 05 for validation on create, 01
before saving the data into database, 02 after saving data in database, To create Tcode for
table maintenance generator we have to select transaction with parameters maintain view name
= ‘TABLE NAME’ and update = ‘X’.
We Can Maintain Table By Function Module: Let’s see how to maintain the table entries
using FM VIEW_MAINTENANCE_CALL
View cluster: is the set of objects, such as views, reports or tables, which belong to one
business function. The data can be arranged either hierarchically or non-hierarchically in view
cluster. A view-cluster transaction edits the complex cross-table data in a view cluster.
SAP memory: this is a memory area to which all sessions with in a sap GUI have access. You
cab use sap memory either to pass data from one program to another with in a session. Get &
set
ABAP memory: is a memory are in the internal session of a ABAP program. Import & export
System Fields: You can find all system fields in Table SYST. The ABAP system fields are
active in all ABAP programs. They are filled by the runtime environment, and you can query
their values in a program to find out particular states of the system.
SY-LSIND List Processing, Details List Index of the list for
current event for basic list = 0.
SY-PFKEY Status of the list currently being displayed.
SY-SUBRC Return value after ABAP statements.
SY-INDEX Loops, Current Loop Pass
SY-TABIX Internal Table, Current Line Index
SY-TFILL Internal Table, Current No. Of Lines
SY-LILLI List Processing, Current List Line
SY-DBCNT Db Operations, No. Of Table Lines Processed

SY-CPROG ABAP Program, Caller In External Procedures ABAP SY-DATUM

Interview Displays Current Date

Guide Pran
SY-DYNNR ABAP Program, No. Of Current Screen
SY-TLENG Line Length
SY-STEPL Loop Information In Table Control
SY-LOOPC Loop Information In Table Control
SY-FDPOS Contains Off Sets For The Found String
SY-DBSYS Database System
SY-DYNGR Screen group of current screen
SY-DYNNR Number of current screen
SY-MSGID Message ID
SY-MSGNO Message number

SY-MSGTY Message type (E, I, W,...)

SY-MSGV1 Message variable

SY-MSGV2 Message variable

SY-MSGV3 Message variable

SY-MSGV4 Message variable

SY-PAGNO Runtime: Current page in list

SY-PFKEY Current GUI Status

SY-COLNO Current List Column

SY-LINCT Page Length of List


Line of in list List

ABAP SY-LINNO SY-LINSZ


Guide
Interview Current Line width
Pran
SY-MACOL Number of Columns on Left Margin of Print List
SY-BINPT Program Running Under Batch Input

SY-MODNO Index of External Session

System fields for SCREENS.

System fields are set at the PAI (Process After Input) event for every screen. These can be also used for interacti
processing, except for SY-DATAR, SY-LOOPC, and SY-STEPL SY-CUCOL : Horizontal cursor position Counting
column 2 SY-CUROW : Vertical cursor position Counting starts at row 1 SY-DATAR : Set to X at time of PAI if at le
screen input field was changed by the user or other data
transfer, otherwise empty. SY-LOOPC : Number of rows currently displayed in a screen table (tab
SCOLS : Number of columns in current screen. SY-SROWS : Number of rows in current screen. SY-STEPL : Index
in a screen table (table control) is set at every loop pass. Outside a loop, for
example during the POV (Process On Value Request) event for a table row, SY-STEPL is not set app
SY-TITLE : Text that appears in the title bar of the screen. For selection screens and lists this is the program
name, otherwise SAP R/3. Can be set during PBO (Process Before Output) using SET TITLEBAR. SY-UCOMM
code that triggered the event PAI. Every user action that triggers PAI is assigned a unique
function code, with one exception: Choosing Enter triggers PAI and different function codes can be transferred t
UCOMM:
• If there is an entry in the command field of the standard toolbar, this is transferred to SY-UCOMM as the functi
• If there is no entry in the command field and a function code is assigned to the ENTER key, this function code
to SY-UCOMM.
• If the command field does not contain an entry and no function code is assigned to the ENTER key, it is empty
content of SY-UCOMM is not affected.
Selection Screens SY-SLSET : Variant used to fill the selection screen.
Date and Time System Fields.
The following system fields are always set automatically. If necessary, the GET TIME statement synchronizes th
server time with that of the database server and writes it to the system field SY-UZEIT. SY-DATUM and the sys
the local time zone, which is SY-TIMLO, SY-DATLO, and SY-ZONLO, are also reset. SY-DATLO : Local date o
example 19981129, 19990628. SY-DATUM : Current (application server) date, for example 19981130, 1999062
DAYST : During daylight saving time X, otherwise empty. SY-FDAYW : Factory calendar weekday, Sunday 0 ...

ABAP
SY-TIMLO : Local time of user, for example 154353, 225312. SY-TZONE SY-UZEIT SY

Time Time Current difference zone Interview (application of user, to Greenwich for ser

time, Mean CET, for Time UTC.

example (UTC) Guide 164353, in seconds, 215312.


for example Pran
3600, 10800.
System Fields in Lists
SY-LSIND : Index of the list for current event for basic list = 0. SY-LISTI : Index of the list level from which the e
triggered. SY-LILLI : Absolute number of the line from which the event was triggered. SY-LISEL : Contents of th
which the event was triggered. SY-CUROW : Position of the line in the window from which the event was trigger
starts with 1) SY-CUCOL : Position of the column in the window from which the event was triggered (counting s
SY-CPAGE : Page number of the first displayed page of the list from which the event was triggered. SY-STARO
the first line of the first page displayed of the list from which the event was triggered
(counting starts with 1). This line may contain the page header. SY-STACO : Number of the first column displa
from which the event was triggered (counting starts
with 1). SY-UCOMM : Function code that triggered the event. SY-PFKEY : Status of the list currently being disp
Internal Table Events/Control Break Events
AT FIRST: the statements before records are processed. Used for system field heading.
AT LAST: execute the statements after all records are processed. Used for calculation of grand total.
Note: In AT FIRST and AT LAST event blocks the numeric values in the work area contains zeros. SUM statem
the totals of numeric fields and places the totals in the corresponding fields of work area.
AT NEW: This event is used when we want to execute the statement before group of records are processed. Th
display the Fields.
AT END OF: execute the statements after processing of group of records. Used for row-wise calculation.
Note: In AT NEW and AT END OF event blocks SUM statement finds all the rows within the control level and ca
totals of numeric fields that are right to the control level and places the totals in the corresponding fields of work
Control break statements are like events inside the loop. There are five control break statements in ABAP. Th
within loop. (Except ON CHANGE OF which can be used outside the loop as well)
• AT FIRST - ENDAT
• AT NEW - ENDAT
• AT END OF - ENDAT
• AT LAST – ENDAT
• ON CHANGE OF
ABAP/SAP Query (Tcode - SQVI): Is used to create reports not already contained in the default. It has been de
users with little or no knowledge of the SAP programming language ABAP.
SAP Query offers users a broad range of ways to define reporting programs and create different types of reports

basic lists, statistics, and ranked lists. ABAP The users define ABAP with reports little Query a

application create no knowledge different Interview is used of types the to ABAP creat
programming. reports such not as basic already ABAP Guide lists, present Query statistics, in

and users system. ranked Pran


a broad lists.
It has range been of designed ways to
for
The ABAP Query comprises four components:
1. Queries
The Queries component is used by end users to maintain queries. One can create queries, change queries and
queries. Transaction SQ01
2. InfoSets
InfoSets are special views of data sources. An InfoSet describes which fields of a data source can be reported o
An InfoSet can be assigned to several roles or user groups.
Advantages
• By creating InfoSets and assigning them to roles or user groups, the system administrator determines the ran
that the individual application departments or end-users are able to generate using the SAP Query.
• End-users are able to work only with those InfoSets that are relevant to their particular area, as designated b
user group that they are assigned to.
3. User Groups
The User Groups component is used to maintain user groups (from a security standpoint). Users working in the
application are assigned to the same user group. It does not matter who actually defined a query in a user group
assigned to the user group is able to execute the query. Users in a user group need to have the necessary aut
before they are able to change or redefine a query. Every user in a system can be assigned to several user grou
4. Translation of Query
A lot of texts are generated when defining queries, InfoSets, and user groups. These texts are displayed in the l
we chose when we log on to the SAP system. We can compare the text/languages using this component.
Data processing in Queries
Data can be processed and presented in three ways:
1. Basic List - Presents data in the order defined by the functional area (supports sorting and summation).
2. Statistic - Shows the statistical figures calculated from the basic data.
3. Ranked List - A ranked list is a specialization of a statistic. Ex. Top ten customers of a travel agency.
A query can have one basic list, Upto nine statistics and Upto nine ranked lists.
Internal tables- Internal tables are a standard data type object which exists only during the runtime of the progr
Standard Table – have an internal index by default. Records can be accessed by using the index number or wi
key. The response time always depends on the volume of data in the standard internal table. Record can be acc
through both INDEX and Condition. These are default table. The key of a standard table is always non- unique,
are allowed.
Sorted Table – also has an internal index but it is pre-sorted by the key. They also have an internal index. Reco
accessed by using the index number or with the any key. The system uses binary search by default to retrieve t
Records are always in sorted order. This is the most appropriate type if you need a table which is sorted as you
sorted tables using INSERT statement. Entries are inserted according to the sort sequence defined through the
The response time for key access is logarithmically proportional to the number of table entries, since the system

ABAP Note: sorted Records again.

Interview
always can uses be a binary accessed search.

through both INDEX and with Guide Pran KEY (Condition). Sorted

Internal tables cannot be


Hashed Table – have no internal index and should be accessed by a key which must be specified as unique. T
time totally depends on the Hash Algorithm. This is the most appropriate type for any table where the main oper
access. You cannot access a hashed table using its INDEX.
INDEX TABLE - For creating a generic table type with index access.
Check Table – Check Table is for Field level Validation the Check Table is the table used by system to check if
or not exist. While creating a table if you want to be sure that a field can have some values And these are in a c
you can give IT this table as CHECK TABLE
Value Table - This is maintained at Domain Level. Whenever you create a domain, you can enter allowed value
some cases you can see when you define a domain that all the table fields or structure components referring to
should be checked against a certain table. This information can be stored in the domain by entering a value tab
The system proposes the value table as check table when you try to define a foreign key for the field or compon
proposal can be overridden.
Table Type – A table type describes the structure and functional attributes of an internal table in ABAP.
Type & Like – Type is used to refer existing data type while like is used to declare data objects
If a table that is to be extended contains a long field, we cannot use append structures why? Long fields
must always be located in the end, as the last field of the table. If a table has an append structure the append lin
be on the last field of the table.
Include – They are solely for modularizing source code, and have no parameter interface.
Get – This is the most important event for executable programs that use a logical database. It occurs when the
database has read a line from the node and made it available to the program in the work area declared using th
NODES node.
Put – is used to direct the program flow according to the structure of program.
Get Late – This event is triggered when all of the data records for a node of the logical database have been rea
Dataset –The sequential files on application server are called datasets they are used for file handling in sap.
Extracts – Extracts are dynamic sequential datasets in which different lines can have different structures. You c
the individual records in an extract using key or index. Instead, you always process them using a loop. You may
one extract in any ABAP program.
A field containing currency amounts (data type CURR) must be assigned to a reference table and a refer
Explain.
As a reference table, a system containing all the valid currencies is assigned or any other table, which contains
the currency key format. This field is called as reference field. The assignment of the field containing currency a
reference field is made at runtime. The value in the reference field determines the currency of the amount.
A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a refer
Explain?
As a reference table, a system table containing all the valid quantity units is assigned or any other table, which c
field with the format or quantity units (data type UNIT). This field is called as reference field. The assignment of
containing quantity amounts to the reference field is made at runtime. The value in the reference field determine

ABAP
unit of the amount. Unit unit Integration testing Testing is Testing – usually Means – p

Interview
testing When all related modules in DEV to your server.

Guide
are module integrated configuration and you test only it after in realization having a dry

Pran
run of in ASAP final preparation roadmap. Yes,
phase of ASAP roadmap (checking of FI entries during goods movements) the integration testing is usually take
QAS server.
Regression Testing – Checking the earlier data and configuration at transaction level after any new configurati
system.
UAT: User Acceptance Testing is done in Quality client which is a close replica of Production environment. In th
end users will do the testing and confirm it is as per the design requirements. Unless UAT is completed the chan
be moved to Production client.
Unit Testing: Once the development or Configuration is completed it is tested in a client in Development box w
as UNIT TESTING. This is to ensure that at a broad level the changes are working.
SDLC – Software Development Life Cycle ASAP stands for Accelerated SAP. Its purpose is to help design
implementation in the most efficient manner possible. Its goal is to effectively optimize time, people, quality and
resources, using a proven methodology to implementation: Phase 1 Project Preparation, Phase 2 Business Blue
3 Realization, Phase 4 Final Preparation, Phase 5 Go-Live and support.
1. Project Preparation
In this phase you plan your project and lay the foundations for successful implementation. It is at this stage that
strategic decisions crucial to your project:
• Define your project goals and objectives
• Clarify the scope of your implementation
• Define your project schedule, budget plan, and implementation sequence
• Establish the project organization and relevant committees and assign resources
2. Business Blueprint
In this phase you create a blueprint using the Question & Answer database (Q&Adb), which documents your en
requirements and establishes how your business processes and organizational structure are to be represented
System. You also refine the original project goals and objectives and revise the overall project schedule in this p
3. Realization
In this phase, you configure the requirements contained in the Business Blueprint. Baseline configuration (major
followed by final configuration (remaining scope), which can consist of up to four cycles. Other key focal areas o
are conducting integration tests and drawing up end user documentation.
4. Final Preparation
In this phase you complete your preparations, including testing, end user training, system management, and cut
activities. You also need to resolve all open issues in this phase. At this stage you need to ensure that all the pr
your system to go live have been fulfilled.
5. Go Live & Support
In this phase you move from a pre-production environment to the live system. The most important elements

ABAP How 1. Top-To-Bottom include many setting ways you up approach: production can

Interview create In this support, Table? approach, monitoring : User first can fields cre

are a Database transactions, defined Guide and table later and in optimizing two domain ways

Pran and overall data element system are performance.

defined.
2. Bottom-To-Top approach: In this approach, first domain and data element are defined and later fields are de
What is the difference between transparent and non transparent database tables? Transparent tables hav
cardinality between Data Dictionary and Database, and non transparent (Cluster and Pooled) tables have Man
cardinality. Transparent table can access with using OPEN & NATIVE SQL statements where as Nontransparen
SQL. Transparent tables can store Table relevant data and non transparent tables can store system data/ applic
based on the transparent tables.
What is a binary search? Binary search is used to get the more data from internal table instead of linear searc
search is the faster and efficient. OR The Binary Search addition means that you can access an entry in a stan
its key as quickly as you would be able to in a sorted table.
What are the Data types of the external layer : ACCP, Char, CLNT, CUKY, CURR, DATS, DESC, FLTP, INT1
LANG, LCHR, LRAW, NUMC, PREC, QUAN, RAW, TIMS, UNIT,VARC.
4.6C is not a Unicode system, ECC 6.0 is a Unicode system: Unicode means it supports almost all the lang
Whereas non-Unicode supports only few languages (may be 4English, German, Dutch, Chinese Unicode is a ch
encoding system similar to ASCII. This encoding standard provides the basis for processing, storage and interc
data in any language in all modern software and information technology protocols". Unicode covers all the chara
the writing systems of the world, modern and ancient. It also includes technical symbols, punctuations, and man
characters used in writing text.
Most of the SAP implementations are done on Unicode system as it supports all kind of languages, which is go
Company to expend their business. Another thing is Unicode system requires 70% more storage area and proce
to run the system perfectly.
To maintain events in table maintenance generator → environment→ modifications → events To maintain a
group in table maintenance generator → environment→ authorization → authorization group
What is Table Description Generator? It Generate Structure Description of given Table for Higher-Level Prog
Language. Based on the input data, the program generates structure descriptions from the ABAP/4 Dictionary.
Matchcode: in Unicode systems we can’t create Matchcode object In non Unicode system utilities → other di
objects → Matchcode
Building Matchcodes
There are two ways to build a matchcode:
Logically The matchcode data is built temporarily when the matchcode is accessed. In this case it is implement
database view. This is called transparent storage of matchcodes. The Matchcode data is set up temporarily at th
when the match code is accessed (Update type I, K).
Physically The matchcode data is stored redundantly as a separate table in the system. You must define here
sets should be adjusted in these redundant tables to changes in the base tables of the matchcode objects. All th
stored matchcode IDs of a matchcode object are stored in a table pool (called M_<Matchcode_object>). This m
is automatically created in the ABAP Dictionary and in the database when the first physically stored ID of the ma

object is activated. A pooled table (called M_<Matchcode_object><Matchcode_ID>) which ABAP


match a is pooled assigned code table data to is the is activated.

Interview
physically table pool stored of the in matchcode a separate object table is in

Guide database in the (Update ABAP Dictionary type Pran


A, S, for P).
each matchcode ID
Update Types The update type of a matchcode ID defines how the matchcode is built and how it is adjusted to
the data records of the base tables. IDs with different update types can be defined for a matchcode object.
Types of Update
Update Type A The matchcode data is stored redundantly as a separate table in the system. The matchcode d
built independently of data changes at certain times using the matchcode utility. Since it could be quite time-co
build the matchcode data, you should do so at times when the system load is low, for example during the night.
searching for a matchcode, it might not always be possible to access the most current data. This inaccuracy is u
acceptable when using the online search help.
Update Type S The matchcode data is stored redundantly as a separate table in the system. The matchcode d
adjusted to each modification operation performed on the base tables of the ID with ABAP Open SQL (INS
DELETE or UPDATE). The matchcode data affected by the table change is therefore updated automatically with
explicitly requested by the application. Automatic updating, however, results in a loss of performance.
Update Type P The matchcode data is stored redundantly as a separate table in the system. The matchcode d
updated by the application program itself, so that this application program and other programs always have
current matchcode data. To do this, a function module MC_UPDATE_<matchcode_object_name> is generated
matchcode ID is activated. The matchcode data is updated when the application program calls this function mod
Update Type I The matchcode data is implemented logically as a database view. Only transparent tables
in transparent matchcodes. When a transparent matchcode ID is activated, a view definition is automatically c
ABAP Dictionary. This view definition contains the fields defined in the matchcode ID (in exactly the same order
defined matchcode selection condition as view selection condition. A corresponding database index should be c
user-defined matchcode IDs to support view access. The transparent matchcodes are much more efficient than
synchronously maintained matchcodes, especially for modification operations, since there are no extra databas
thus reducing the costs for communications with a remote database server in a client/server environment. The m
selection itself can be compared with the selection behavior of the physically stored matchcodes if there are sui
in the database.
Update Type K Classification matchcodes are user-specific search paths that can be accessed with the F4 help
matchcodes. However no matchcode data can be recorded for them (logical structure). The data is obtained fro
module. This module must be specified in the matchcode ID definition and is called in the matchcode selection.
Text Table: Only one text table can be created for main table. Se11-> Goto -> text table
Type Groups: There are several type groups available in SAP. For example ‘ABAP’ and ’SLIS’ etc. To use them
we use key word ‘TYPE-POOLS’. It allows us to define non-predefined types. Combination of all such non- pred
is knows as type-pool or type-group. In simple terms, if we want to use some custom types in various programs
not define them separately, we can simply create a type group in ABAP dictionary and use that in our programs

System ABAP If (Programs saved. you set Debugging</u>

this with option, status the S in Debugger Interview their program is also attributes). ac

for system you Guide save programs

Pran
breakpoints, the System

Debugging setting is also


Update Debugging</u> Update function modules do not run in the same user session as the program that is cu
running in the ABAP Debugger. These function modules are therefore not included in debugging. Only if you se
Update Debugging option can you display and debug them after the COMMIT WORK. Debugging to go direct
record - we can set a watchpoint for the particular value of a field or variable. Table will update, when ra
update termination error: VBHDR, VBDATA, VBMOD, and VBERROR ST22 Dump analysis:
SM21 System log, usages, when it will trigger SM21 - System log: these are system generated messages wh
soon as the system is started. It may include user locked messages; update failures, ABAP dumps, network erro
Physically, you can find the file in the location mentioned in the parameter rslg/local/file in SAP. the naming con
usually SLOG<SAPSYSTEM number>
SM21 (SAP System Log): The SAP System logs all system errors, warnings, user locks due to failed logon attem
known users, and process messages in the system log. These can be helpful when analyzing issues.
SM20: the Security Audit Log to record security-related system information such as changes to user master rec
unsuccessful logon attempts. This log is a tool designed for auditors who need to take a detailed look at what oc
SAP System. By activating the audit log, you keep a record of those activities that you specify for your audit. 8Y
access this information for evaluation in the form of an audit analysis report. The Security Audit Log provides for
data access. The audit files are retained until you explicitly delete them.
SM13 Update termination, Update task Local Update: In a local update, the update program is run by the sam
process that processed the request. The dialog user has to wait for the update to finish before entering further d
of update is useful when you want to reduce the amount of access to the database. The disadvantage of local
their parallel nature. The updates can be processed by many different work processes, unlike asynchronous or
update, where the update is serialized due to the fact that there are fewer update work processes (and maybe o
switch to local update using the ABAP statement SET UPDATE TASK LOCAL. This statement sets an u201 (loc
switchu201). When it is set, the system interprets CALL FUNCTION ...IN UPDATE TASK as a request for local
update is processed in the same work process as the dialog step containing the COMMIT WORK. The transacti
the update to finish before continuing. By default, the local update switch is not set, and it is reset after each CO
or ROLLBACK WORK. You therefore need to include a SET UPDATE TASK LOCAL statement at the beginning
LUW.
If you reset data within the local update, the ROLLBACK WORK statement applies to both the dialog and the up
the transaction, since no new SAP LUW is started for the update.

ABAP
Types of Structures Flat types. Deep Structures Structures contain contain only strin

Interview fields internal of the tables elementary and field types or C, object Gu
N, D, references T, F, I, P, in and addition X, Pran
or structures to the elementary containing types. these It references at least
Nested Structures are structures that contain substructures as components. It references at least one further s
not a table type.
Non-nested Structures are structures that do not contain any substructures.
How can we set the table spaces and extent sizes? You can specify the extent sizes and the table space (ph
area in the database) in which a transparent table is to be stored by setting the size category and data class.

What is the function of the correction system? The ABAP What Local correction objects ar

system objects?
Interview
class$TMP) manages changes are independent to internal of correction syst

components. andGuide transport Such system.

as objects Pran
of the ABAP/4 Dictionary.
What is a Development class? Related objects from the ABAP/4 repository are assigned to the same develop
This enables you to correct and transport related objects as a unit.
What is the max. no. Of structures that can be included in a table or structure? Nine.
To how many tables can an append structure be assigned? One.
Can we include customizing include or an append structure with Pooled or Cluster tables? No.
Structures can contain data only during the runtime of a program? True.
What are two methods of modifying SAP standard tables?
• Append Structures and
• Customizing Includes. If a table that is to be extended contains a long field, we cannot use append struc
Long fields in a table must always be located in the end, as the last field of the table. If a table has an append st
append line must also be on the last field of the table.
What are the two ways for restricting the value range for a domain?
• By specifying fixed values.
• By stipulating a value table.
=============================Smartforms====================================== Wha
Smart Forms? SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintain
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple gr
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for ta
and subtotals, and sorting data before output. SAP Smart Forms allow you to include graphics, which you can d
as part of the form or as background graphics. You use background graphics to copy the layout of an existing (s
or to lend forms a company- specific look. During printout, you can suppress the background graphic, if desired.
Forms also support postage optimizing.
Possible exceptions for the generated function module are:
• FORMATTING_ERROR
• INTERNAL_ERROR
• SEND_ERROR
• USER_CANCELED
In addition, you can define your own exceptions. If an error (or a warning) occurs, the system internally fills an e
application can now read this table as soon as the function module for the form is processed to the end. To read
contains all errors and warnings that occurred, call function module SSF_READ_ERRORS. The table has struc
SSFERROR. The fields in the table are the number of the document within the job, the form name, an error num
message class, a message type, a message number and four additional message variables. If processing is ter
application can dynamically display a message. The error numbers are defined in the include SSF_ERROR. If y
trigger your own exception in the free coding of the Smart Form, you can use one of the Following methods:

ABAP
• Use the macro user_exception, This After values triggers the required termination the

your additional own Interview and exception.

fills system the above variables tables.

for the error (sy-msgno, Guide sy-msgtyp, and Pran


so on) do not contain the
• If you want to access the system variables sy-msgno, sy-msgtyp, and so on for your exception directly, pro
follows: Call function module SSF_MESSAGE and trigger your exception yourself using the RAISE statement.
System fields of Smart Forms Within a form you can use the field string SFSY with its system fields. During fo
the system replaces these fields with the corresponding values. The field values come from the SAP System or
the processing. The following rules apply for system fields:
• You can display the values of any system fields in the form
• You are not allowed to assign values to system fields (in program lines nodes)
• You can query all system fields (for example, in conditions) except SFSY-FORMPAGES and SFSY-JOBPAGE
query SFSY-FORMPAGES only within final windows, SFSY-JOBPAGES not at all.
Field Name Description
&SFSY-DATE& Displays the date. You determine the display format in the user master record.
&SFSY-TIME& Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE& Inserts the number of the current print page into the text. You determine the format of
the page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES& Displays the total number of pages for the currently processed form. This allows you
to include texts such as ‘Page x of y’ into your output.
&SFSY-JOBPAGES& Contains the total page number of all forms in the currently processed print request..
&SFSY- WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME& Contains the name of the current page (string in the Page field)
&SFSY-XSF& Smart Forms sets this flag (SFSY-XSF = ’X’), if you want to print the form in XSF
format or HTML format. On the Conditions tab of a node, you can use this field to suppress output that is intend
these output formats (for example, pushbuttons).
&SFSY-COPYCOUNT& Queries whether the original is printed or which number the copy has.
COPYCOUNT = 1: original, COPYCOUNT = 2: first copy; COPYCOUNT = 3: second copy, and so on.
&SFSY-COPYCOUNT0& Queries whether the original is printed or which number the copy has.
COPYCOUNT = 0: original, COPYCOUNT = 1: first copy; COPYCOUNT = 2: second copy, and so on.
SFSY-SUBRC Return value that you can query in program lines nodes. This enables you to react
dynamically to error situations during output. Up to now, this field can be used only for include texts and text mo
• SFSY-SUBRC = 0 :Text module or include text found and printed
• SFSY-SUBRC = 4 :Text module or include text not found
SFSY-USERNAME Logon name of the user who prints the form.

ABAP &SFSY-PAGEBREAK& &SFSY-MAINEND& &SFSY-EXCEPTION& Interv


Is Is Contains set set to ' X ' as soon the after a page as processing name of the break raised of Gui
(either exception. main automatic window You must on or the command-controlled) trigger Pran
p
exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_excepti
name >).
When using the fields &SFSY-FORMPAGES& or &SFSY-JOBPAGES& you must keep all output pages in the
till the end of the form or the print job, to allow these fields to be replaced with their respective values. For large
jobs, this may require a huge amount of memory space.
Barcode with smartforms: If you want to assign barcode for date field go and create style or se73 – character
this style to Smartform and c1 to date field it will display in barcode format.
Difference between SAP Script and Smartforms – Client dependent, accepts only .tif images, 0-99 main wind
page formats are not possible, and background image cannot be uploaded. Client independent, accepts .bmp im
only one main window, multiple page formats are possible, and allows background images.
How to debug Smartform in prd server: get the function module generated by the Smartform. Now just put th
in the function module for debugging in the production server. Moreover you can use SF_TRACE to debug a Sma
Protect & End protect – command pairs to allow you to define the areas to be protected against a page break.
Why SAPScripts are client dependent and Smartforms are client independent?-: Smartforms create its
module so it doesn’t need to transport the request through SCC1.As all the Development Object are stored in clien
tables. Whereas Script doesn’t generate any function module while executing so we need to transport the re
through SCC1.Sap script is stored inside the client depended table as a TEXT. So
SAPScripts are client dependent and Smartforms are client independent.
SAP Smart Forms Advantages
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programm
knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configura
business processes with data from an SAP system. 2. Displaying table structures (dynamic framing of texts) 3. O
background graphics, for form design in particular the use of templates which were scanned. 4. Colored output o
User-friendly and integrated Form Painter for the graphical design of forms 6. Graphical Table Painter for drawin
Reusing Font and paragraph formats in forms (Smart Styles) 8. Data interface in XML format (XML for Smart Fo
XSF) 9. Form translation is supported by standard translation tools 10. Flexible reuse of text modules 11. HTML
forms (Basis release 6.10) 12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-R
Form Interface is where you declare what must be passed in and out of the Smartform (in from the print progra
Smartform and out from the Smartform to the print program).
Global definition is where you declare data to be used within the Smartform on a global scope, i.e. anything yo

ABAP Additional here Events can Events be used in Smartforms

Interview
in any other node in the form.

Guide Description

Pran
Only on first page Output appears only on the first print page.
Not on first page Output appears on all print pages except the first.
Only after end of main window Output starts only after all nodes within the main window are processed. It
makes no sense to activate this event for a node within the main window, since it would never be printed.
Only before end of main window Output appears as long as the system still processes nodes of the main
window. This event is of interest for nodes that appear before or after the main window definition in the navigatio
Form Builder.
Only on page Output appears only on print pages that are defined using draft page <S>.
How to protect lines in the main window from splitting between pages?
It was easy with SAPScript, but how to do it with SF's. For 4.7 version if you are using tables, there are two opt
protection against line break:
• You can protect a line type against page break.
• You can protect several table lines against page break for output in the main area.
Protections against page break for Line Types:
• Double-click on your table node and choose the Table tab page.
• Switch to the detail view by choosing the Details pushbutton.
• Set the Protection against page break checkbox in the table for the relevant line type. Table lines that use thi
output on one page.
Protection against page breaks for Several Table Lines:
• Expand the main area of your table node in the navigation tree.
• Insert a file node for the table lines to be protected in the main area.
• If you have already created table lines in the main area, you can put the lines that you want to protect again p
under the file using Drag & Drop. Otherwise, create the table lines as sub nodes of the file.
• Choose the Output Options tab page of the file node and set the Page Protection option. All table lines that a
with the Page Protection option set are output on one page. In 4.6, alternatively in a paragraph format use the P
protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you wa
that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enoug
for the paragraph, the entire paragraph appears on the next page.
Smartforms to PDF
Convert Smartform to PDF: Run Smartform and type PDF!
Second method: * Function Module CONVERT_OTF is used to convert the OTF format to PDF = CALL FUNC
'CONVERT_OTF' * To display File SAVE dialog window = CALL METHOD cl_gui_frontend_services=>file_save
the FM GUI_DOWNLOAD to download the generated PDF file onto the* presentation server = CALL FUNCTION
'GUI_DOWNLOAD'
Page Protection in Smartforms is used to avoid displaying the broken contents of the page and allow it to displ
page from the beginning after the previous page.
How to do page break in smartforms: To give a page break in smartforms we need to create a COMMAND lin

ABAP the How How Main to can do Window.

I page insert break symbols in Interview sap in Smart scripts: Forms with CALL : S

Function the Text CONTROL_FORM.

node. Guide Change Editor (Click Pran


the button above Check near the Editor) Go to menu Include→Characters→SAP Symbols Choose the SAP symb
want to insert. How to print a watermark? IN SMART FORM GO WITH BACK GROUND DIRECTLY. FOR SA
GO TO TEXT ELEMENT IN SE71 – INSERT – GRAPHICS. How to print barcodes?
Difference with Smartforms vs. SAPScript (SE71)
• 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.
• Labels cannot be created in smartforms.
• Routines can be written in smartforms tool.
• Smartforms generates a function module when activated.
SAPScript 1. Client dependent 2. Multiple page formats is not possible 3. Scripts allows only black & white texts
no mixture of portrait and landscape format 5. Scripts allows more than one main window 6. This is not support
Smartform 1. Client independent
2. Multiple page format is possible
3. Text can be written in various colors
4. There is an option to print a mixture of portrait and landscape format
5. Smartforms allows only one main window on page
6. This is online support.
Types of Windows in Smartforms
There are four types of windows in smartforms as follows:
Main Window In a main window you display text and data, which can cover several pages (flow text). As soon a
window is completely filled with text and data, the system continues displaying the text in the main window of the
automatically triggers the page break.
Secondary Window In a secondary window you display text and data in a predetermined output area. There is
display with page break. If you position a secondary window with the same name on several pages, the system
contents of this secondary window on each page.
Copies Window
It is special type of secondary window. You use the copies window to define an output area for the print output,
content you want to appear either only on the copy or only on the original. This allows you to flag copies as copi

ABAP You on Final the use Window

copy when the or copies the only form window on is the printed.

Interview original. to define This an output allows area you for to flag the print copies

Guide output, as copies whose when content the form Pran


you is want printed.
to appear either only
You may want to display or query values on the first page that are determined only during processing. For exam
want to name the grand total in the letter text of an invoice. However, this amount is determined only after listing
items. Or you may want to query on the first page within a condition the total number of pages, which the system
only after processing all pages. In such a case, you use the final window: Processing first skips all windows of th
tree and works its way to the end of the tree. Only after the actual processing is finished, the final windows are p
the order in which they appear in the tree (from top to bottom). Now any information is available that is known on
of the form processing.
Parameters of the Generated Function Module The function module generated from a Smart Form provides a
standard parameters. After you created a Smart Form these parameters appear directly in the form interface of
Form and cannot be changed. When you call the module from within your application program, you can use the
parameters, for example, to specify the output device (printer, FAX, e-mail) or to adapt the spool dialog.
Overview From the function module's point of view there are imports (kind K= I) and export parameters (kind K=
Parameter Name K Type Description
ARCHIVE_INDEX I TOA_DARA

ARCHIVE_INDEX_TAB I TSFDARA SAP Archive Link parameter for archiving forms. ARCHIVE_PARAMETE
ARC_PARA
MS
CONTROL_PARAMETERS I SSFCTRLOP Control structure for the general control of the form putput (output m
with/without dialog, language, and so on)
MAIL_APPL_OBJ I SWOTOBJID Business Communication Interface (BCI) parameter for
MAIL_RECIPIENT I SWOTOBJID

sending forms as e-mail (see also: Sending Forms as E- Mail or Telefax) MAIL_SENDER I SWOTOBJID
OUTPUT_OPTIONS I SSFCOMPOP Structure with output options for output to spool, as FAX,
or in XSF format
USER_SETTINGS I TDBOOL If the parameter is set ('X'), SAP Smart Forms copies the
user defaults for the Spool Control, which you set under System→User Profile →Own Data (Output Device, Prin
Immediately, and Delete after Output). If it is not set, SAP Smart Forms instead evaluates the following paramet
structure for the output options ( SSFCOMOP ): Printer settings (TDDEST , TDPRINTER , RQPOSNAME) TDIM
immediately) TDDELETE (Delete after output)
DOCUMENT_OUTPUT_IN FO
E SSFCRESPD This structure contains nothing but the TDFPAGES field

of type TDFPAGES , which contains the number of ABAP JOB_OUTPUT_INFO

Interview Guide
E SSFCRESCL printed After which form actions form

Pran
produced you can which use

this results structure (see: Querying to query


the Output Result)
JOB_OUTPUT_OPTIONS E SSFCRESOP This structure contains a subset of the fields of
OUTPUT_OPTIONS: the fields that the user is allowed to change. It enables you to determine whether your set
been modified.
Calculating and Printing Grand Totals Use You want to calculate a grand total for a column of your table and
wish, you can print the grand total at the end of the table and subtotals at the end of each page.
• If you do not want to calculate totals for different currencies or quantity units, use the Calculations tab of the t
Note: Form SF_TOTALS in the system illustrates how to print grand totals for different currencies using the old
table types. Use application program SF_TOTALS to call this form.
Procedure To print a subtotal of the grand total before a page break, the subtotal must be calculated in a specia
However, you can also use this method if you only want to print the grand total at the end of the table. We will u
data model to explain this summing method. A table containing the flights of the airline carriers is already being
form. The corresponding internal table (T_SFLIGHT) is defined in the form interface and has type TABLE OF S
print a table line, you have defined field GS_SFLIGHT of type SFLIGHT as a global field. You now want to calcu
on the flight prices, taking into account that the airlines use different currencies to indicate their prices.
1. Create three additional fields in the global definition:
• GT_TOTAL of type TABLE OF SFLIGHT
• GS_TOTAL of type SFLIGHT
• GS_4NEXT_ADDITION of type SFLIGHT 2. In the navigation tree, you are already printing the table in the m
using table node B. To keep it simple, the table output in our example (see below) consists only of the nodes C
the price) and E (containing the currency). Enhance the form logic as follows:
Form logic for calculating the grand total
Navigation Tree Node Attributes/Contents/Conditions
Output parameters: GT_TOTAL, GS_4NEXT_ADDITION Program lines: refresh gt_total. clear: gs_total,
gs_4next_addition.
Loop : B
internal table T_SFLIGHT INTO GS_SFLIGHT
&GS_SFLIGHT-PRICE&
Input parameters: GS_SFLIGHT, GS_4NEXT_ADDITION D
Output parameters: GT_TOTAL, GS_4NEXT_ADDITION Program Lines: if not gs_4next_addition is initial.

collect gs_4next_addition into gt_total. ABAP Interview endif.

Guide
gs_4next_addition-price gs_4next_addition-currency = gs_sflight-price.

= gs_sflight-currency.

Pran
&GS_SFLIGHT-CURRENCY&
Footer Make sure to assign enough height to the footer.
Condition: only at end of section Input parameter : GS_4NEXT_ADDITION Output parameter : GT_TOTAL
lines : if not gs_4next_addition is initial.
collect gs_4next_addition into gt_total. endif.
Loop : internal table GT_TOTAL INTO GS_TOTAL
&GS_TOTAL-PRICE&
&GS_TOTAL-CURRENCY&
Result If the table output covers several pages, a subtotal of the grand total appears at the end of each page. If
print a total only at the end of the table, include the condition only at end of section into the loop node (G). Discu
steps within the form logic are self-explanatory:
A
C
E
G
F
I
H
• To be able to calculate the price in accordance with the currency, we need the internal table GT_TOTAL We
the ABAP statement COLLECT to add up the values, thereby easily assigning each new value to the correct cu
entry in table GT_TOTAL corresponds to the totals value in one currency.
• At the beginning of the table, all summing fields must be cleared (node A).
• When printing the footer, we use loop G to print the totals sorted by currencies. Other steps, in contrast, are h
understand at first sight, for example, what do we need field gs_4next_addition for? Why don't we simply add t
value of gs_sflight to the corresponding value in the internal table GT_TOTAL? The reason for this lies in the o
for Loops and Tables. Determining the page break requires the output control to buffer table lines before printing
output control needs the height specifications of the entire line before it can determine when to trigger the autom
break. The program lines nodes, in contrast, are not buffered but executed directly during processing.
The output control recognizes that the last table line is finished as soon as it starts processing the next line. To s
the calculation of the total with its output, the calculation must be delayed. And for this reason we need the addi
gs_4next_addition: 1. Within the loop, the total is calculated after the first output (node D). The node can even
further
down in the tree. The important fact is that the output control has recognized that a new table line starts (with th
type, this is achieved by explicitly creating table lines). If this last line does not fit onto the page, the output contr
the footer processing. In this case, node D is not processed. This would not have happened if node D had been
before node C. 2. If no new table line starts, the value of the last line above node D is added to the total. Since
gs_4next_addition is
empty at the beginning, we must query this in the programming. Otherwise, the COLLECT statement would use
currency in GT_TOTAL. Then, we temporarily store the current value of gs_sflight ings_4next_addition, befor

the total in the next loop pass. This means that we do the ABAP 3. same After sure program th

Interview
table lines this that last node. lines the addition output have Here, been happ

again, processed, we does only query with at one the whether the last end table calculation of gs_4next_additi

Guide
table We is output, buffer missing, the we is which value enter empty of the we to this

Pran
appropriate execute catch line.
the in case the condition footer. that
To make in the
T_SFLIGHT might have no entries.
Calculating and Printing Subtotals Use You want to print subtotals in accordance with a value in a different c
column is then called the sort criterion.
• If you do not want to calculate totals for different currencies or quantity units, use the Calculations tab of the t
(see: Calculations). Note: Form SF_TOTALS in the system illustrates how to print grand totals for different curre
the old or the new table types. Use application program SF_TOTALS to call this form.
Procedure We assume that you are already printing an internal table T_SFLIGHT of type TABLE OF SFLIGHT
want to print the table sorted by airline and include a subtotal of the price after each airline.
1. Define two global fields for summing:
• GT_SUBTOTAL of type TABLE OF SFLIGHT
• GS_SUBTOTAL of type SFLIGHT 2. Go to the Data tab of the table node. In the Sort Criteria group box ente
which you want to sort.
In our example, this is the CARRID column. If you already sorted the table before you passed it to the form, ma
Sorted so that SAP Smart Forms does not have to sort the table again. 3. Before printing the table lines of an ai
you must clear the summing fields. To do this, mark the checkbox Event on Sort Begin for the criterion. In the n
(B) an event node appears whose inferior node you can use to clear the fields at the appropriate event (program
C). 4. Within the loop calculate the subtotal. To do this, you need another program lines node (E).
5. To print the subtotal after finishing the items of an airline, mark the checkbox Event on Sort End of the sort
criterion. Another event node (G) appears in the navigation tree, whose inferior node you can use to print the su
facts explained above result in the following form logic:
Form logic for calculating a subtotal according to a criterion
Navigation Tree Node Attributes/Contents/Conditions
Loop : internal table T_SFLIGHT INTO GS_SFLIGHT Sort criteria: Field name: CARRID Event on Sort Begin/E
CARRID Beginning of sort level
Output parameters: GT_SUBTOTAL, GS_SUBTOTAL. Program lines: REFRESH GT_SUBTOTAL. CLEAR
GS_SUBTOTAL.

&GS_SFLIGHT-PRICE& D ABAP Interview Input Output Program d

parameter parameter lines type :


: GS_SFLIGHT
: sflight.
GT_SUBTOTAL

Guide Pran
ls_sflight-price = gs_sflight-price. ls_sflight-currency = gs_sflight-currency.
collect ls_sflight into gt_subtotal.
&GS_SFLIGHT-CURRENCY&
CARRID End of sort level
Loop : internal table GT_SUBTOTAL INTO GS_SUBTOTAL
&GS_SUBTOTAL-PRICE&
&GS_SUBTOTAL-CURRENCY&
Result The subtotal (for each airline carrier) is printed before a break in the sort level.
Output Options for Field Contents
A
G
F
B
E
H
C
J
I
You can use the Formatting options to adapt the value of a field before printing it. You can enter the relevant pa
directly behind the field name. Write the abbreviations of the different options in uppercase letters. Some of the
be combined.
General Information The formatting options are not suitable for all data types of a field (for example, you do no
exponential representation for character fields). You must distinguish between numeric fields and character field
that the value of a field cannot take up more than 255 characters.
Numeric Fields
• The system first evaluates the length (<length>), if specified.
• If no length is specified, the system displays the value in its overall length.
• The trailing blank indicates a positive sign. To suppress it, use the formatting option S.
• Any offset (<offset>) specified is ignored. Sequence of evaluation: (<length>), sign to the left(<), Japanese da
suppress blanks (C), right-justified display (R), insert fillers (F).
Character Fields By default, the system displays the value of a field in its overall length, but truncates trailing b
Sequence of evaluation: suppress blanks (C), <offset> and (<length>), right-justified display (R), insert fillers (F)
Formatting Options for Fields
Syntax Description
&field+<offset>& Skips offsets (<offset>) in the field value (character fields only). If the offset is

greater than the length of the value, nothing is displayed. ABAP &field(<length>)& &field(*)&

Interview Sets If the the field output is defined length by to a <length>.

Guide
Data Dictionary type, Smart Pran
Forms sets the output length to the value specified there.
&field(S)& Suppresses the sign
&field(<)& Displays the sign to the left of the number
&field(.<nat.number>)& Limits output of decimal places to <nat.number>
&field(E<nat.number>)& Displays the field value with the fixed exponent <nat.number>. The mantissa is
adapted to this exponent by shifting the decimal character and inserting zeros.
&field(T)& Suppresses thousand indicators when displaying fields of
types DEC, CURR, INT, and QUAN.
&field(Z)& Suppresses leading zeros in numbers
&field(I)& Suppresses display of initial values
&field(K)& Deactivates a conversion routine specified in the Data Dictionary
&field(R)& Right-justified display. Use this option only when specifying an output length as
well.
&field(F<filler>)& Replaces left-justified blanks in the value by the fill character <filler>.
&field(L)& Converts a date field to a local date and displays it. The date is then formatted
using the edit mask JPDAT. Since this representation uses Japanese characters, it is only to be used in the Jap
version of the SAP System.
&field(C)& The system takes the field value as a sequence of words separated by blanks.
Option C shifts these words to the left and leaves one blank in-between as a separator. Any leading blanks are
effect corresponds to that of the ABAP statement CONDENSE.
How to print double sided? Your customer wants your PO Smart Form to be able to print "Terms and Conditio
back side of each page. They don't want to purchase pre-printed forms with the company's logo on the front and
conditions on the back. If for example there was a 3 page PO to be printed, they want 3 pieces of paper, the fron
to contains the PO information (page 1, 2, and 3) and the back side of each piece of paper to containing the sta
Conditions" information. This can be done by this method: - page FRONT lists page CONTACTS as next page a
CONTACTS lists FRONT as next page. Since CONTACTS does not contain a MAIN window, it will print the con
then continue on to FRONT for the rest of the main items. Additionally, set print mode on FRONT to D (duplex)
CONTACTS to 'blank' (for both resource name and print mode - this is the only way to get to the back of the pag
How to force a page break within a table? Put a Command node inside the table that forces a NEWPAGE on
condition you want.
How can I make the Smart Forms to choose a printer name by default? In the CALL FUNCTION of the Sma
Function Module, set the output options parameter to set the printer name. The output options are of the type S

which contains the field TDDEST. Set the TDDEST field to your default ABAP How If field you

printer CONTROL_PARAMETERS get the want name.

Smart to generate Form Interview the as a spool, PDF?

Guide
parameter), When you then call the you smart convert form, the you OTF can data requ

Pran
to CONVERT_OTF get the OTF data function
(GETOTF
module. OR you can call RSTXPDFT4 and enter the spool number.
How to maintain Smartforms in different languages? Se63 translation- ABAP objects- long text- maintain ob
language
How to add a check box in smartforms?
In your text general attributes insert-characters-SAP symbols-SYM_LARGE_SQUARE & you can't find it in print
directly get it in printout.
How to insert logo in SAPScripts: BITMAP 'HPIMAGE' OBJECT GRAPHICS ID BMAP TYPE BCOL DPI 300
Attributes of Smartform: window, flow logic, graphics, address, text , table template , folder, reference.
What is the’ form interface’ in smart forms: This is the place where parameters will interface the program and
IMPORT, EXPORT and Tables are declared.
Dynamic page break in smart forms In main window - Conditions tab - we can define the page break.
The system date in this format ’15th Jan 2008’ on scripts: Use SET DATE MASK control_form function mo
useful in scripts driver program to call control commands like bottom endbottom, top endtop, protect endproject.
How to create dynamic text: to insert run time text in Smartform we can use dynamic text for this define your f
definitions with x type tsftext. STXH table stores all these standard texts with a combination of Text object, Sta
name, Text ID and Language.
Using Subroutine in Smartforms
• In the global definitions of the smart form: click at the initialization tab. Write like:
• PERFORM SUBROUTINE_NAME (REPORT_NAME_WHERE_THIS_SUBROUTINE_IS_THERE).
• If some tables are used, write:
• PERFORM SUBROUTINE_NAME (REPORT_NAME_WHERE_THIS_SUBROUTINE_IS_THERE) TABLES
ITAB2...
Using Subroutine in SAPScript
• /: PERFORM FETCH_TABLE_DATA IN PROGRAM Z_SUBROUTINE_POOL
• /: USING &INVAR1&
• /: CHANGING &OUTVAR1&
• /: ENDPERFORM
• /* Now call the standard text
• /: INCLUDE Z_TABLE_DATA OBJECT TEXT ID ST LANGUAGE EN
SAP SYMBOL: INCLUDE – CHARACTERS - --- SAP Symbols Is it possible to migrate a SAPScript form to
Form: Smart Forms provides a migration tool for this purpose which migrates layout and texts of a SAPScript fo
Form It does not migrate SAPScript form logic of the print program. Using Smart Forms, this logic is described b
structure of the Form Builder. The effort involved in migrating it depends on the complexity of the print program.
do this one-by-one in transaction SMARTFORMS, under Utilities -> Migrate SAPScript form
&SYMBOL (Z)& Omit leading zero’s

&SYMBOL (<)& Display Leading sign to left


&SYMBOL (>)& Display Leading sign to right

&SYMBOL(S)& Omit Leading sign ABAP &SYMBOL(C)& &SYMBOL Intervie


(N)& Compress Display Upto space

Guide
n decimals

Pran &SYMBOL (T)& Omit thousands separator

&SYMBOL(R)& Right Justified


&SYMBOL (I)& Suppress output of initial value
How to pass values from driver program to smartforms: CALL FUNCTION w_fname: Exporting all the fields
Smartform --- form interface—import, tables. How to use routines in smartforms: in smartforms if you want to
text use form routines tab Write form text using changing Endform Go to main window and create program code
perform text using changing
Standard Smartforms in SAP
SF_LE_PASS_TRA SF_LE_PASS_PER SF_HRRCF_INITIAL_EMAIL SF_EXAMPLE_01 SF_EXAMPLE_02
SF_EXAMPLE_03 SF_BC_TEST_PRINT SF_SUBTOTALS
SF_TOTALS
===============================SAPScripts=================================
What is SAPScript and explain its purpose? Tcode – SE71 SAP Script is the SAP system’s own text-proces
You’ll find that it looks and feels a lot like other leading text-processing system that you may use on your person
Every company needs to output documents with a uniformly defined layout (e.g. Invoices, delivery notes, etc.) a
The basic layout of the document is pre-defined, but in many cases, other data has to be merged with it, such a
data or purchase order items. This data might be entered manually by a employee, or retrieved from a database
quantities of these documents have to be produced. From printing is usually a matter of large print runs of docum
pay slips, checks, order confirmation, reminders etc. SAPScript has been developed to meet the above requirem
integrated tool for text entry and form printing in R/3 applications. These documents are normally provided by SA
organization have their unique ways of these documents so to customize these and for creating newer ones if re
script is used.
To upload / download sap script: go to se38 RSTXSCRP – object name (script name) – mode export / import
To compare two forms – SE71 → utilities → compare forms
Compare client - - SE71 → utilities → compare client
Copy from client → SE71 → utilities → copy from client

ABAP
To such. SAP debug provides User – just SE71 a modifies standard → utilities the layo

Interview existing → set activate for layout every debugging

sets printable as per requirement document Guide and of usually client. Following there is no

Pran
are need some to create standard layout SAPScript sets as
layout sets provided by SAP:
• RVORDER01 Sales order confirmation
• RVDELNOTE Picking List
• RVPICKSIN Picking List
• RVINVOICE 01 Invoice
• MEDRUCK Purchase Order
• F110_PRENUM_CHCK Pre-numbered check
SE72: to create styles SE 73: SAPScript font maintenance (barcode) SE 74: SAPScript format conversion SE 7
setting (text object and id, graphics) SE 76: SAPScript form translation (language) SE 77: SAPScript style conve
(language) SE 78: to upload logo
Usually you don’t create layout sets, instead, you copy the existing layout sets with some modification to the exi
sets. SAP doesn’t allow you to modify the layout sets. You need to copy the existing layout set to your own layo
then do all the modification.
Individual Migration
• Go to the SAP Smart Forms initial screen (transaction SMARTFORMS).
• In the Form field enter the name of the Smart Form you want to create.
• Choose Utilities → Migrate SAPScript form. The dialog window Migrate SAPScript Form appears.
• Enter the name and the language of the source form (SAPScript).
• Choose Enter. This takes you to the change mode of the SAP Form Builder. If the selected SAPScript form d
in the selected language, a dialog window appears on which you can select one of the existing languages.
• Now change the design of the form and of the form logic. To activate the Smart Form choose Activate.
Converting a SAPScript Style
• Go to the Smart Styles initial screen (transaction SMARTSTYLES).
• In the Style name field enter the name of the Smart Style you want to create.
• Choose Smart Styles ® Convert SAPScript style.
• Enter the name of the SAPScript style you want to convert and Press Enter.
• A list of the converted styles appears.
• Choose Back. You can now change the Smart Style (Change). To activate the Smart Style choose Activate.
Mass Migration of SAPScript Forms
• Run the mass migration program. In Reporting (transaction SE38), select the program SF_MIGRATE and ex
Select the names and the language of the SAPScript forms and click the execute icon. The system creates the S
named for the SAPScript forms plus the extension SF. It displays a list of the migrated forms.
• Make changes (if necessary). To change and adapt a form, go to transaction SMARTFORMS. Then activate

Smart Form. ABAP Once during conversion the the SAPScripts conversion is often standard a

converted, Interview procedure, in terms whether of as attributes, SAPScript in Smart w

Guide
Forms have or alignment, Smart used Styles, local or syntax logic.

Pran
you should errors.

Cleaning clean up any up errors errors during


made
Errors may occur when a field displayed is extracted or manipulated to display and doesn’t exist, or fields exist b
with no values. Errors may also arise in ABAP syntax. You have to check the Import and Export Parameter in G
of Smartform .Remove the unnecessary node. Check the text node and then check the Syntax.
Procedure to copy the existing layout sets. Tools → Word processing → Layout sets. Utilities → Copy from c
• Enter the name of the layout set in layout name.
• Enter target layout set name
• Click execute
The SAP standard layout set uses D German as the original language. In order to modify the copied layout set,
language of the set must be changed to the language in which you are working. To convert language: Utilities –
original language and Click OK.
Layout set Layout set is used to design the document. Layout set on its own does not contain any data. The se
for the document is done through the print program i.e. the print program selects the data from database table a
the layout set. The document is printed after the print program gets executed.
Layout set consist of following components:
• Header
• Paragraph Formats
• Character Formats
• Windows
• Pages
• Page Window Header: The header consists administrative information for the layout sets and default settings
various other components of the layout sets like page, paragraph. You give all the administrative information for
when you create the layout set, while all default settings are specified when all the components are created. OR
to development (created by, development class, etc) and layout set information (which elements are used) are b
the header data. A start page must be entered here.
Paragraph Formats: A Paragraph contains all the information needed to format a paragraph of text and font. Ta
important for paragraphs. Specifying the list of tabs is the way to create columns for outputting line items of a do
Paragraph formats are required in layout sets - as in styles - in order to format texts. However, they are also use
processing in layout sets, for example, to format text elements.
Character Formats: is used to override paragraph settings for specific words in a paragraph. For example you
use Bold for a single word but not the entire paragraph. The only important thing that is defined with the charact
font. OR You can also use character formats to format texts or paragraphs. Unlike paragraph formats, however,
to format text within a paragraph.
Windows: A window mainly contains the SAP scripts text and the variable to be printed. There is one special w
which contains the output of the line item of a document and is created by the system. The window can be of typ
CONST except for the MAIN. But in the present version, SAP system does not distinguish between these two ty
content of variable window is regenerated on every page. The content of a constant window is generated once a

beginning and later printed on every page. OR Windows are names and window ABAP types,

Interview
Pages are are not defined physically to provide positioned the system until th

start allocated and Guide end to pages point in and text units formatting.
of Pran
measurement, are specified.
Page windows - Page windows are the combination of windows and pages, where the dimensions of a window
position on a page are specified.
Printing A Company LOGO There are two ways to print a company logo:
1. The logo can be included in the layout set.
2. It can be a macro on PCL – 5 printers.
Including a logo in the layout sets
• Create logo with a graphics program and save it as tiff file.
• From editor run the program RSTXLDMC.
Parameters to be passed are
• File name
• File type
• BMON – For a black and white image.
• BCOL – For a color image.
• Text name – The standard text in layout set This text can be included in a layout set by including. Using PCL
can also print the logo. In R3, the printer types are IIPLJIIID, IIPLJ4, LX4039 and SM120XXS.
Control Commands
All script control commands are entered in the SAP Script editor.
• All commands are indicated by /: in the tag column
• Only one control command is allowed per line
• Lines with control commands are not affected by the editor formatting
• If control command is unknown or incorrect, command line is treated as comment line
ADDRESS: This command formats and address according to the postal standards of the country.
Syntax: /: Address /: Title ‘Company’ /: Name ‘Intelligroup’ /: Street ‘115’ /: P.O. BOX ` ` /: Postcode /: City /: Re
Country /: End Address
BOTTOM-ENDBOTTOM: For the Main window you can determine lines, which are always output automatically

of that window. This is called footer text. Syntax: /: BOTTOM /: ENDBOTTOM ABAP BOX, Sy

POSITION, [Xpos] [Ypos] & SIZE: [Width] Interview These [Height] commands [Frame

[Intensive]

used for drawing Guide boxes and are used Pran


only during creating output.
X & Y – Upper left corner of the box. Width – Width of the box Ht – Height of the box Frame – Thickness of the b
full black)
Units used for Width, Height and Thickness are TW, PT, IN, CM, CH, LN. Ex., /: BOX WIDTH ‘20’ CM HEIGHT
10 TW INTENSIFY 15.
POSITION Syntax:
/: POSITION [X Origin] [Y Origin] [Window] [Page] X & Y - Sets the origin for x 7 y parameters for the box comm
- Sets the default values for the left and upper edges. Pages - Sets the values for the left and upper edges of th
page.
Basically used to set default setting for the box command.
/: Position x Origin ‘1.5’ cm y origin ‘1’ cm
SIZE Syntax:
/: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE] Sets width and height parameters for the box command.
CASE: It is similar to ABAP/4 editor command ‘CASE’ only symbol can be queried.
Syntax: /: CASE SYMBOL /: WHEN 1 /: WHEN 2 /: WHEN OTHERS /: ENDCASE
DEFINE: Values can be assigned to text symbol by DEFINE keyword. The assigned value may have a maximum
characters. It can also contain further symbols.
Syntax: /: DEFINE & SYMBOL & = ‘XXXX’
IF: With IF command you can define the lines that are output only under certain conditions.
Syntax: /: IF &var& = ‘char val’ /: ENDIF
INCLUDE: Contents of another text can be included in text by INCLUDE command. The contents are copied o
of the output formatting. You can also specify language and the paragraph irrespective of the language in which
is created. The language which is used in include test is used for output.
Syntax: /: INCLUDE MYTEXT
NEW–PAGE: SAP Script automatically carries out a page break if window MAIN of one page is filled with NEW
command. You can face page break at any point. The current page is completed and the text in the following lin

new page. If no name is defined, then, the next page attributes from page setup is taken. ABAP
/: NEW – PAGE [PAGE-NAME]

Interview Guide Pran NEW–WINDOW: You can have 9

windows on one page. If MAIN window is filled, then the next MAIN window is accessed automatically. With NEW
command, you can call next main window even if the current MAIN window is not yet completely filled.
PROTECT: You can determine that a paragraph must not be separated by a page break. The lines in this comm
printed together on one page. If the space is enough on current page, then all the lines are printed on current pa
however the space is not sufficient the PROTECT command works as a ‘NEW-PAGE’.
Syntax: /: PROTECT /: ENDPROTECT
SET COUNTRY: Some field types are formatted country – specifically. E.G. date. Normally the display types are
the user master record with the control command set country, an alternative to that in the user master record ca
Syntax: /: SET COUNTRY
SET DATE MASK: Standard display of date can be changed
Syntax: E.g. SET DATE MASK = ‘MM DDDD (Day in full) yyyy’
You can switch back to default display of date by /: SET DATE MASK = ‘ ‘
SET TIME MASK: Standard display of time can be changed
Syntax: /: SET TIME MASK = ‘HH:MM’.
TOP-ENDTOP: For main window, you can determine lines, which are always O/P automatically at the top of the
Main Window Main window is a window in which continuous text is printed. This is the window used by dialog u
program and form. For example, the body text of a letter would be entered in MAIN. The text in the main window
over several pages. If the text fills one page, output continues in the window of the next and subsequent pages,
MAIN has been defined for these pages.
Variable Window This is window with variable contents. The text can vary on each page in which the window is
Variable windows are formatted for each page. To every window you can assign text, which is printed in the cor
window when the form is formatted. To assign text, use text elements, which are stored in the form. To create a
text elements with the SAPScript Editor, choose Text elements. For more information, see Text Elements. Shou
selected for the window exceed the window size, then the text is cut off.
Constant Window
Window with constant contents that is formatted only once. Currently, constant windows are processed in the sa
VAR windows. You should only use windows of type VAR.
Using SAPScript Symbols
You can use SAPScript symbols to include program or system data or predefined texts in your document. To

ABAP You current If you use can do a value insert symbol, not know of a the symbol enter the

Interview
name anywhere name for of the a of symbol, in symbol the your symbol choo

in When in your Include your you text document.

print → enclosed Symbols Guide or display in to & find characters: your the document, symbo

Pran
available SAPScript and substitutes select one. the
In this case, you can also specify how to process and format the symbol (pushbutton OPTIONS).
You can use the DATE symbol to have the current date inserted in your document when the document is displa
You set symbols off from normal text by enclosing the symbol name in ampersands (&): For example, Walldorf,
displayed or printed as Walldorf, 08.08.1998. The exact date formatting depends on the option set in System ®
® Fixed values. If you choose Include → Symbol to insert a symbol into your text, the system automatically supp
characters.
Using the Four Types of Symbols
SAPScript offers four types of symbols that draw their values from different sources. These symbols are: 1. Sy
symbols, 2. Program symbols, 3. Standard SAPScript symbols, and 4. Local text symbols. You access each typ
by way of a different Include submenu.
System Variable Description
Contains a value indicating if they INCLUDE statement executed previously
&SAPSCRIPT-SUBRC&
was (found = 0) or (not found = 4).
&SAPSCRIPT- FORMPAGES&
Contains the total number of pages in a SAPScript layout set between the START_FORM and END_FORM stat
Contains the total number of pages in a SAPScript print run between the
&SAPSCRIPT-JOBPAGES&
OPEN_FORM and CLOSE_FORM functions.
&SAPSCRIPT- TELELAND&
Contains the country for the fax destination and output with field TDTELELAND for the function OPEN_FORM p
OPTIONS.
Contains the local fax number of the fax destination output with field ITCPO-
&SAPSCRIPT-TELENUM&
TDTELENUM for the function OPEN_FORM parameter OPTIONS.
&SAPSCRIPT- TELENUME&
Contains the complete fax number of the fax destination output with field ITCPO-TDTELENUME for the function
OPEN_FORM parameter OPTIONS.
Here is more information on each type of symbol:
• System symbols draw their values from global SAP System variables.
System symbol Contains
&DATE& current date
&DAY& day from current date
&DEVICE& output device: PRINTER, SCREEN, TELEX, FAX
&HOURS& hours from time of day
&MINUTES& minutes from time of day

&MONTH& month from current date ABAP &NAME_OF_MONTH& &NEXTPAGE& &P

Interview name page page of the month number of number of the a SAPScript Gu
from next current date
page
text

Pran
&SECONDS& seconds from time of day
&SPACE& blank
&TIME& time of day
&ULINE& underline
&VLINE& vertical line
&YEAR& year from current date
&SAPSCRIPT- FORMPAGES&
Page &PAGE& of &SAPSCRIPT-FORMPAGES&
• Program symbols draw data from tables in the program that you need to retrieve the data for the SAPScript
you want to print. In addition, you can include all globally defined data as program symbols. Therefore, the table
defined in the ABAP Dictionary. This type of symbol is used to make data from the SAP applications available in
SAPScript documents as checks and correspondence.
To access these symbols, choose Include → Symbols → Program.
PC Editor:
Total number of pages in currently formatted layout set
&SAPSCRIPT- JOBPAGES&
Total number of pages in currently formatted print request
To include program symbols in the PC editor, see Inserting Program Symbols.
• Standard symbols are maintained centrally in SAPScript (table TTDTG) and are available in all SAPScript d
They generally contain static texts. For example, symbol &SGDH& is defined with the text "Dear Ladies and Ge
Standard symbols are language-dependent. If a symbol has been translated, then it is inserted in your documen
language that you have chosen for the document.
To access these symbols, choose Include → Symbols → Standard.
• Text symbols are defined locally in your own document and are usable only in the document in which they a
You can, for example, define a standard term or text passage once in your document and then include it where
by way of its symbol name.
Define a text symbol with the DEFINE command: /: DEFINE <symbolname>='Symbol text'
PC Editor To enter the DEFINE command together with the desired symbol name, choose Edit ® Include comm
DEFINE &MYSYMBOL& = '100' Line Editor In the line editor, you must mark the command in the format tag co
SAPScript Function Modules The print program is used to print the actual form, the functions the print program
include retrieving of data from database tables, selecting a FORM and printing of TEXT ELEMENTS in a desire

The function modules or Parameters used in print program are: 1. OPEN_FORM ABAP 2. 3

START_FORM WRITE_FORM

Interview Guide Pran 4. CONTROL_FORM

5. END_FORM
6. CLOSE_FROM
To start printing a form we must use OPEN_FORM and in the end we should use CLOSE_FORM to complete t
request.
Function Modules in Detail.
1. OPEN_FORM Function Module
This function module should be called first before any printing can take place; here we specify the name of th
the print language.
CALL FUNCTION 'OPEN_FORM' EXPORTING
DIALOG = 'X' DEVICE = 'PRINTER' FORM = form name LANGUAGE = SY-LANGU * OPTIONS = EXCEPTION
CANCELLED = 1 DEVICE = 2 FORM = 3 OTHERS = 11 .
IF SY-SUBRC NE 0. MESSAGE... ENDIF.
In the above function module the parameter FORM = Name of form DEVICE = PRINTER (print using spool), TE
output) SCREEN (output to screen) OPTIONS = It is a structure of type ITCPO and it controls the various attribu
number of copies, print preview
etc.
2. START_FROM Function Module
This function module is called if we want to use different forms with similar characteristics in a single spool req
be closed by END_FORM function module.
CALL FUNCTION 'START_FORM' EXPORTING
FORM = LANGUAGE = STARTPAGE = EXCEPTIONS

FORM = 1 OTHERS = 7 . IF SY-SUBRC NE 0. MESSAGE... ABAP ENDIF. 3. WRITE_FORM

Interview module

Guide Pran This function module is used to write text in a window in the form

elements (/: E element). We can specify whether the text is to be appended, replaced or added and in which po
window it will be printed i.e. TOP, BOTTOM, BODY. In this function module actual printing takes place.
CALL FUNCTION 'WRITE_FORM' EXPORTING
ELEMENT = FUNCTION = TYPE = WINDOW =
ELEMENT = 1 OTHERS = 9 . IF SY-SUBRC NE 0. MESSAGE... ENDIF. Here in this function module the ELE

specifies which text element is printed. WINDOW specifies which window of the form to be print in. TYPE spe
output area of the window TOP, BOTTOM, BODY. FUNCTION specifies whether the text is to be appended, rep
added.
4. CLOSE_FORM function module
This function module should be called in the end and it has no exporting parameter.
CALL FUNCTION 'CLOSE_FROM' IMPORTING * RESULT =
EXCEPTIONS

UNOPENED = 1 OTHERS = 5 . IF SY-SUBRC

NE 0. MESSAGE... ENDIF.
Here the result parameter returns the status information and print/fax parameters after the form have been printed

5. CONTROL_FORM Function Module

This function module is used to insert SAPScript control commands like NEW-PAGE etc from within the ABAP
CALL FUNCTION 'CONTROL_FORM' EXPORTING
COMMAND = EXCEPTIONS

Guide
UNOPENED = 1 OTHERS = 3 . IF SY-SUBRC NE 0. MESSAGE...
TNAPR

ABAP ENDIF. NOTE: The print program

Pra
Interview and the form are stored in the table

n
What is the table name that will contain all the script form names and print program names? TNAPR.

What are the components/elements/layout sets in sap script? Components of scripts: Layout sets, ABAP print
Components of layout set: Header data, paragraph formats, character formats, windows, page windows, pages.

Can you create a script without a main window? No

How many main windows can be created for a script? 99

What is the use of PROTECT & ENDPROTECT? To give page protection

How to create standard text in SAPScripts? SO10

How to download/upload image SAPScripts from & to your PC? SE78 or RSTXLDMC

How can you copy forms from one client to other? SE71, Utilities -> Copy from client

How to debug a script? This can done in two ways: 1. In the form
Utilities->Activate debugger 2. Using Report - RSTXDBUG

How do you create boxes in SAPScript? BOX XPOS ‘1’ CM YPOS ‘1’ WIDHT ‘10’ CM HEIGHT ‘10’
CM FRAME 10 TW

SAPScript Important Programs


Here are some useful programs for SAPSCRIPT development
RSTXFCAT Program to find out SAPScript names (Search Program)
RSTXCDM1 SAPScript: Sample Program for Form Printing
RSTXCNVR Converting SAPScript standard text to RAW format (ASCII)
RSTXCPDF Routines for Converting OTF Format to PDF Format
RSTXDBUG Activate/Deactivate Form Debugger
RSTXFCAT Find Forms in a Package or by form name
RSTXFCPY Copy Forms between Clients
RSTXFCOM Comparison of Two Forms
RSTXFCON SAPScript: Conversion of Page Format for Forms
RSTXFINF Comprehensive Information about a Specific Form
RSTXHTML Conversion of SAPScript Texts (ITF) to HTML
RSTXICON List of SAP icons and their names and SAP numbers <xxxxx>
RSTXSYMB List of SAP symbols and their names as well as <xxxxx> SAP number
RSTXR3TR Transport Program For SAPScript Transport Objects
RSTXSCAT Find Styles

RSTXSF01 TrueType font installation for SAPScript/SmartForms ABAP RSTXTCAT Find

Interview Standard Texts

Guide Pran
Formatting
&SYMBOL& No formatting
&SYMBOL+4& Offset - Output begins here. Offset refers to formatted value
&SYMBOL(5)& Length - Output data in the specified length
&SYMBOL(I)& Suppress initial value - If the field has been initialized, nothing is
output.
&SYMBOL(Z)& Suppress leading zeros
&SYMBOL(C)& Compress blank spaces - Consecutive spaces are compressed into a
single space. Leading spaces are suppressed.
&SYMBOL(R)& Right align output
&SYMBOL(S)& Operators are suppressed
&SYMBOL(*)& Dictionary length - The data length is defined by the ABAP dictionary
&SYMBOL(8.2)& Decimal format. Length 8 decimals 2
&'text1'SYMBOL'text2'& Text can be inserted before and after the symbol
Multiple Page Format: in smartforms for each page, u can define whether to print it in portrait mode or landsca
can set that independently for each page. By default it is set to portrait mode. but u can change that by double-c
page name and selecting output options.
Dataset: The sequential files (processed on application server) are called datasets. They are used for file handl
OPEN DATASET is used only for Application server files. If you want to write or read data from application serv
dataset is mandatory. ABAP/4 provides three statements for handling files: The OPEN DATASET statement ope
CLOSE DATASET statement closes a file. The DELETE DATASET statement deletes a file. To open a file for r
use the FOR INPUT option of the OPEN DATASET statement To open a file for write access, use the FOR OUT
of the OPEN DATASET statement
To open a file for appending data to the file, use the FOR APPENDING option of the OPEN DATASET statemen
file in binary mode, use the IN BINARY MODE option of the OPEN DATASET statement To process a file in text
IN TEXT MODE option of the OPEN DATASET statement To open a file at a specific position, use the AT POSI
the OPEN DATASET statement
When you work with the operating systems UNIX or WINDOWS NT, you can send an operating system comma
statement OPEN DATASET. To do so, use the option FILTER To receive the operating system message after tr
a file, use the MESSAGE option of the OPEN DATASET statement To close a file on the application server, use
DATASET statement To delete a file on the application server, use the DELETE DATASET statement To write d
on the application server, use the TRANSFER statement To read data from a file on the application server, use

DATASET statement. How ABAP duplex SAP SCRIPT:

to 2 print sides

both sides inInterview sap script in the print attributes for Guide the

parameter Pran
give the value 'D' means
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZSCRIPT_NEW' EXCEPTIONS
CANCELED = 1 DEVICE = 2 FORM = 3 OPTIONS = 4 UNCLOSED = 5 MAIL_OPTIONS = 6 ARCHIVE_ERRO
INVALID_FAX_NUMBER = 8 MORE_PARAMS_NEEDED_IN_BATCH = 9 SPOOL_ERROR = 10 CODEPAGE
OTHERS = 12 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH
SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. loop at itab.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ELEMENT '
FUNCTION = 'SET' TYPE = 'BODY' WINDOW = 'MAIN' EXCEPTIONS
ELEMENT = 1 FUNCTION = 2 TYPE = 3 UNOPENED = 4 UNSTARTED = 5 WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7 SPOOL_ERROR = 8 CODEPAGE = 9 OTHERS = 10
. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY
MSGV3 SY-MSGV4. ENDIF. endloop.
CALL FUNCTION 'CLOSE_FORM' . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER

ABAP ENDIF. Smartforms

Interview
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Guide Pran CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING
FORMNAME = 'ZMED_CUSTOM_INVOICE' IMPORTING
FM_NAME = FM_NAME EXCEPTIONS
NO_FORM = 1 NO_FUNCTION_MODULE = 2 OTHERS = 3. IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
CALL FUNCTION FM_NAME
EXPORTING
WA_HEADER = WA_HEADER WA_KNA1 = WA_KNA1 WA_KNA2 = WA_KNA2 WA_KNA3 = WA_KNA3 TABL
IT_ITEM = IT_ITEM EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2 SEND_ERROR = 3 USER_CANCELED = 4 OTHERS = 5. IF SY-SUBRC <> 0. * MES
MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
================================BDC=========================================== BDC
Batch Data Communication and is also referred to as Batch Input. It is a technique for mass input of data by
user inputs in screens of existing transactions. Screens are not displayed; it can be run in the background. You
any of the standard SAP consistency checks, authorizations, etc.
BDC was a great way of uploading data into SAP in a pre-BAPI era, now SAP is making available BAPIs for mo
functionalities; someone should first look out for BAPI if it is not available then go for BDC. Other methods of up
direct update SAP programs and Idocs.
There are two main methods of BDC, these are:
• Call Transaction Using (CTU)
• Batch Input Session (BI session) Yes it is possible to write call transaction and session in one program.
Both must be programmed in an ABAP program. First do a recording of the transaction using SHDB transaction
Library - Transaction recorder. Then embed the recording into your program, and then trigger it by using either

ABAP CTU The TRANSACTION.

CTU or BI method session requires method.

Interview using CALL TRANSACTION statement, Guide seeing ABAP

Pran
documentation

- CALL
The BI session method requires calling BDC_OPEN_GROUP, BDC_INSERT and BDC_CLOSE_GROUP func
and end them with a COMMIT WORK, then start manually the BI session using SM35 transaction (see SAP Lib
Managing Batch Input Sessions, or start it automatically by calling either RSBDCSUB or RSBDCBTC program.
Display mode
• CTU: either CALL TRANSACTION ... USING ... MODE <dismode> ..., or ls_ctu_params-dismode = <dismod
TRANSACTION ... USING ... OPTIONS FROM ls_ctu_params ...
• BI session: you can choose it only by running the session interactively (SM35), a popup dialog is displayed w
options.
Upload is function used to write data from a file in the presentation server to internal table. here you get a dialog
the path of the file name.
Ws_upload also perfoms the same function, but without screen. Here you do not get a dialog-box, u have to ex
filename option in Function module.
GUI_UPLOAD The new function modules, GUI_UPLOAD and GUI_DOWNLOAD, have an interface that also a
write Unicode format to the local drive.
To read excel file into internal table: CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
If you give the I_LINE_HEADER = 'X' it will not read the first line in the excel sheet.
Session method: synchronous processing can transfer large amount of data, processing is slower, error log is
data is not updated until session is processed. It will be in Synchronous.
Call transaction: asynchronous processing can transfer small amount of data, processing is faster, errors need to
and data is updated automatically. In call Transaction method it depends upon the synchronous and asynchronous

In synchronous it will stop at 7 the record and 7,8,9 record is not updated and BDCMSGCOLL gives error MSG the

In asynchronous all the records are updated except 7 records.

Synchronous: Execute only one transaction at a time, it provides acknowledge.

Asynchronous: Execute multiple transactions at a time, it doesn’t provide acknowledge.

For each entry which is updated in the database table message is available in BDCMSGCOLL.

Table Control in BDC: Table control is used for entering multiple line items in BDC

For table control in BDC declare two variables as integer. set the variable value as 0.In the program before the line
statement set the counter value as 1. count=count+1.then u have to use the concatenate statement for the line item
concatenate '(lfa1-banks('count'))' into cval perform BDC using cval. During recording for the line items we have rec
also for the line item. Goto standard tool bar you have to press the next page button. If count=5. Perform BDC using
page endif

We can handle table control using line index. Line index indicates which line of table control is to be use for BDC tra
ca01, me23n.

IDX TYPE C.
BDC_FIELD 'LFBK-BANKS WHERE

MOVE 1 TO IDX. LOOP ABAP Interview USING LIFNR ('


PERFORM CONCATENATE AT IT_BANK
FNAM IDX = IT_XK01-LIFNR. ')' INTO FNAM.
FNAM.

Guide PERFORM BDC_FIELD USING FNAM

IT_BANK-BANKL.

Pran IDX = IDX +


1.

ENDLOO
IT_BANK-BANKS.
P.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO

BDC_OKC0DE: will store all the ok codes in the BDC program, When you pass the Fields to a screen after filling th
click any button to move other screens, so here the Button will be have a OK_CODE internally to know this we do th
Program, after that we will store this OK code in the BDC_OKCODE field to trigger the next operation.

Function modules that need to be called from BDC program to submit the transactions for processing?
• BDC_OPEN_GROUP
• BDC_INSERT
• BDC_CLOSE_GROUP

Creating a Session with BDC_OPEN_GROUP

Use the BDC_OPEN_GROUP function module to do the following creates a new session. Once you have created a
can insert batch input data into it with BDC_INSERT.

You cannot re-open a session that already exists and has been closed. If you call BDC_OPEN_GROUP with the na
session, then an additional session with the same name is created.
A batch input program may have only one session open at a time. Before opening a session, make sure that an
that the program closes any sessions that it previously had opened.
BDC_OPEN_GROUP takes the following EXPORTING parameters:
• CLIENT Client in which the session is to be processed. Default: If you don't provide a value for this paramete
is the client under which the batch input program runs when the session is created.
• GROUP Name of the session that is to be created. May be up to 12 characters long. Default: None. You mu
session name.
• HOLDDATE Lock date. The session is locked and may not be processed until after the date that you specify.
system administrator with the LOCK authorization for the authorization object Batch Input Authorizations can un
session before this date. Format: YYYYMMDD (8 digits). Default: No lock date, session can be processed imm
lock date is optional.
• KEEP Retain session after successful processing. Set this option to the value X to have a session kept after
successfully processed. A session that is kept remains in the input/output queue until an administrator deletes it
that contain errors in transactions are kept even if KEEP is not set. Default: If not set, then sessions that are su

processed are deleted. Only the batch input log is kept. ABAP • Authorizations session USER
Interview
is started user in background for background processing. processing. The Th

must the be user authorized Guide name that for is used all of for the checking transactions

Pran
authorizations and functions if a
that are to be executed in a session. Otherwise, transactions will be terminated with "no authorization" errors. Th
be of type dialog or background. Dialog users are normal interactive users in the SAP System. Background use
master records that are specially defined for providing authorizations for background processing jobs.
Adding Data to a Session: BDC_INSERT
Use the BDC_INSERT function module to add a transaction to a batch input session. You specify the transactio
started in the call to BDC_INSERT. You must provide a BDCDATA structure that contains all of the data require
the transaction completely.
BDC_INSERT takes the following parameters:

TCODE The ABAP For TCODE POST_LOCAL

help code is in of an finding the EXPORTING transaction the transaction Interview that

to code be in run.
of the a function, function see module.

Guide
Analyzing SAP Transactions.

Pran
Parameter to update data locally. If POST_LOCAL = ‘X’, data will be updated locally.
DYNPROTAB The BDCDATA structure that contains the data that is to be processed by the transaction. DYNP
table’s parameter in the function module.
Closing a Session: BDC_CLOSE_GROUP Use the BDC_CLOSE_GROUP function module to close a ses
have inserted all of your batch input data into it. Once a session is closed, it can be processed.
BDC_CLOSE_GROUP needs no parameters. It automatically closes the session that is currently open in your p
must close a session before you can open another session from the same program. You cannot re-open a sess
has been closed. A new call to BDC_OPEN_GROUP with the same session name creates a new session with t
name.
What is structure of the BDCDATA?
• Program - program name.
• Dynpro - screen number,
• Dynbegin - indicator of new screen,
• Fnam - name of the field from screen,
• Fval - a value to submit to field. Direct Input: To enhance the batch input procedure, the system offers the d
technique especially for transferring large amount of data. This technique doesn’t create sessions but stores the
The direct input programs must be executed in the back ground only. To maintain and start these programs, use
RBMVSHOW or the transaction BMVO.
What has to be done to the packed fields before submitting to a BDC session? Declare these fields in the
as characters and the length of the field should be same as the field length of the field's data element. This inter
used to hold the data fetched from the sequential file using WS-upload function module
Direct call of transactions, session handling: /nxxxx - This terminates the current transaction, and starts tran
/n - This terminates the transaction. This generally corresponds to pressing F15 to go back. /nend - This termin
separate sessions and logs off (corresponds to System - Logoff). /nex - This terminates all separate sessions a
immediately (without any warning!). /oxxxx - This opens a new session and starts transaction xxxx in this sessio

lists existing sessions and allows deletion or opening of a new session. ABAP /i /i1, - This /i2,.

This terminates the current Interview the session session with (corresponds the numbe

given.

Guide End

Pran
What are the available OK Codes that can be utilized during batch input processing?
/n – terminates current batch input transaction and marks as incorrect. /bdel – delete current batch input transa
session. /bend – terminate batch input processing and mark session as incorrect. /bda – change display mode
session on screen instead of displaying only errors. /bde – change display mode to display only errors instead o
the session on the screen.
Why you choose Call transaction and/or session method? Call transaction is mainly used when you want to
database using a single transaction , you can also update the database in asynchronous mode, where as sessio
perform huge database Updation using more than one transaction and which will last for a long time.
Difference between Session and Call transaction Method:
Session Method id generally used when the data volume is huge.
Session method is slow as compared to Call transaction.
SAP Database is updated when you process the sessions. You need to process the sessions separately via SM
Errors are automatically handled during the processing of the batch input session.
Call transaction method is when the data volume is low.
Call transaction method is relatively faster than session method.
SAP Database is updated during the execution of the batch input program.
Difference between BAPI and BDC
BAPI is a SAP supplied function module with a defined interface, which allows you to interact with various busin
BAPI is faster than BDC.
BAPI directly updates database.
No such processing options are available in BAPI.
BAPI would generally used for small data uploads.
For processing errors, the return parameters for BAPI should be used. This parameters returns exception mess
success message to the calling Program
Using BAPI we can access data from non sap also..
BAPI support version upgrades...so need to worry about our previous uploads.
BAPI directly update the database instead through the screen flow.
BDC is relatively slower than BAPI.
BDC goes through all the screens as a normal user would do and hence it is slower.
Background and foreground options are available for BDC
BDC would be preferred for large volumes of data upload since background processing options is available
Errors can be processed in SM35 for session method and in the batch input program for call transaction method
What is the use of program RSBDCSUB: There are two ways to process the BDC sessions: 1) Go to SM35 --

ABAP
session ---> hit process. 2) OPEN READ Use program DATASET DATASET RSBDCS

Read Interview RSBDCSUB the the file file

(dataset) schedules either in the read session /write Guide to mode.

be processed in background.

Pran
CLOSE DATASET → Close the dataset once the date has been read.
Difference between BAPI and BDC
BAPI is used only when it is available for the particular transaction like Delivery Sales order. but BDC can be us
transaction which have screen and fields.
BAPI is directly updated the database instead BDC run through the screen flow. So BAPI can't handle all the flo
checking and enhancement put by programmer to facilitate the user requirement.
BAPI stands for Business API (Application Program Interface).
A BAPI is remotely enabled function module
ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access.
Also they are part of Business Object Repository (BOR).
BAPI are RFC enabled function modules. The difference between RFC and BAPI are business objects.
You create business objects and those are then registered in your BOR (Business Object Repository)
which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JA
In this case u only specify the business object and its method from external system
in BAPI there is no direct system call. While RFC are direct system call.
Some BAPIs provide basic functions and can be used for most SAP business object types.
These BAPIs should be implemented the same for all business object types.
Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.
Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
Using CALL TRANSACTION USING for Data Transfer
Processing batch input data with CALL TRANSACTION USING is the faster of the two recommended data trans
In this method, legacy data is processed inline in your data transfer program.
Syntax: CALL TRANSACTION <tcode>
USING <bdc_tab> MODE <mode> UPDATE <update>
<tcode> : Transaction code
<bdc_tab>
: Internal table of structure.
<mode>
: Display mode:

A Display all ABAP Interview EN Display No display

errors only

Guide Pran <update>

: Update mode:
S Synchronous
A Asynchronous
L Local update
A program that uses
CALL TRANSACTION USING to process legacy data should execute the following steps:
1. Prepare a BDCDATA structure for the transaction that you wish to run.
2. With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure.
For example:
CALL TRANSACTION 'TFCA' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO MESSTAB.
IF SY-SUBRC <> 0.
<Error_handling>.
ENDIF.
MESSAGES Parameter
MESSAGES specification indicates that all system messages issued during a CALL TRANSACTION USING ar
the internal table <MESSTAB>. The internal table must have the structure BDCMSGCOLL.
You can record the messages issued by Transaction TFCA in table
MESSTAB with the following coding:
(This example uses a flight connection that does not exist to trigger an error in the transaction.)
DATA: BEGIN OF BDCDATA OCCURS 100.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF MESSTAB OCCURS 10.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSTAB.
BDCDATA-PROGRAM = 'SAPMTFCA'.
BDCDATA-DYNPRO = '0100'.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
CLEAR BDCDATA.

BDCDATA-FNAM = 'SFLIGHT-CARRID'. ABAP BDCDATA-FVAL APPEND BDCDATA-FNAM

= = 'XX'.

'SFLIGHT-CONNID'. Interview Guide Pran


BDCDATA-FVAL = '0400'.
APPEND BDCDATA.
CALL TRANSACTION 'TFCA' USING BDCDATA MODE 'N'
MESSAGES INTO MESSTAB.
LOOP AT MESSTAB.
WRITE: / MESSTAB-TCODE,
MESSTAB-DYNAME,
MESSTAB-DYNUMB,
MESSTAB-MSGTYP,
MESSTAB-MSGSPRA,
MESSTAB-MSGID,
MESSTAB-MSGNR.
ENDLOOP.
The following figures show the return codes from CALL TRANSACTION USING and the system fields that cont
information from the called transaction. As the return code chart shows, return codes above 1000 are reserved f
transfer. If you use the MESSAGES INTO <table> option, then you do not need to query the system fields show
contents are automatically written into the message table. You can loop over the message table to write out any
that were entered into it.
Return Codes:
Value Explanation
0 Successful
<=1000 Error in dialog program
> 1000 Batch input error
System Fields:
Name: Explanation:
SY-MSGID Message-ID
SY-MSGTY Message type (E,I,W,S,A,X)
SY-MSGNO Message number
SY-MSGV1 Message variable 1
SY-MSGV2 Message variable 2
SY-MSGV3 Message variable 3
SY-MSGV4 Message variable 4

Error ABAP Unlike handling failures.

Interview
Analysis batch for incorrect input and methods Restart transactions. using C

sessions, There is CALL no restart TRANSACTION capability Guide for transactions USING p

contain Pran
does errors not provide or produce any special update
You can handle incorrect transactions by using update mode S (synchronous updating) and checking the return
CALL TRANSACTION USING. If the return code is anything other than 0, then you should do the following:
• Write out or save the message table
• Use the BDCDATA table that you generated for the CALL TRANSACTION USING to generate a batch input
the faulty transaction. You can then analyze the faulty transaction and correct the error using the tools provided
input management facility.
Overview
Dismode Meaning
N Screens are not displayed. You must choose this mode when you run the BDC in a background job.
A All screens are displayed. On each screen, a little popup is displayed with the next recorded
function; the user has to press Enter to execute it.
E By default, screens are not displayed, except if an error occurs, or if the end of BDC data is
reached although the recorded transaction was not exited
P Same as N. The difference is that if a breakpoint is reached and the classic debugger is used, then P
will avoid the error 00344 concerning screen SAPMSSY3 0131 (or other SAPMSSY3 screen). For more informa
the new debugger has been introduced, mode P is more or less obsolete
Others Like A
Since SAP WAS 6.10, there are four additional execution modes, for more information.
Dismode Meaning
Q Same as N + the execution is run with SY-BATCH = 'X'
D Same as A + the execution is run with SY-BATCH = 'X'
H Same as E + the execution is run with SY-BATCH = 'X'
S Same as P + the execution is run with SY-BATCH = 'X'
Update mode
It indicates how the function modules in the update task will be run.
• CTU: either CALL TRANSACTION ... USING ... UPDATE <updmode> ..., or ls_ctu_params-updmode = <upd
TRANSACTION ... USING ... OPTIONS FROM ls_ctu_params ...
• BI Session: you can choose it only by running the session interactively (SM35), a popup dialog is displayed
options.
Updmode Meaning
A Asynchronous. Update function modules are executed in UPD work process. A is the
default mode.
S Synchronous. Update function modules are executed in UPD work process BUT all
COMMIT WORK are processed as if they were COMMIT WORK AND WAIT.

L Local update task. Update function modules are executed as if SET UPDATE TASK ABAP L

Interview process has been as the executed main program.

Guide
at the start of each LUW, i.e. they are Pran
executed in the same
UPDATE Parameter in Call Transaction
You use the UPDATE parameter to specify how updates produced by a transaction should be processed. You c
between these modes:
A → Asynchronous Ppdating. In this mode, the called transaction does not wait for any updates it produces to b
It simply passes the updates to the SAP update service. Asynchronous processing therefore usually results in fa
execution of your data transfer program.
Asynchronous processing is NOT recommended for processing any larger amount of data. This is because the
transaction receives no completion message from the update module in asynchronous updating. The calling dat
program, in turn, cannot determine whether a called transaction ended with a successful update of the database
If you use asynchronous updating, then you will need to use the update management facility (Transaction SM12
whether updates have been terminated abnormally during session processing. Error analysis and recovery is le
than with synchronous updating.
S→ Synchronous Updating. In this mode, the called transaction waits for any updates that it produces to be com
Execution is slower than with asynchronous updating because called transactions wait for updating to be compl
However, the called transaction is able to return any update error message that occurs to your program. It is mu
you to analyze and recover from errors.
L→ Local Updating. If you update data locally, the update of the database will not be processed in a separate pr
the process of the calling program.
BAPIs for BDCs
Here is a list of the BAPIs which can be used instead of BDC for a transaction.
Transaction BAPI
AS02 BAPI_FIXEDASSET_CHANGE
AS01 BAPI_FIXEDASSET_CREATE1
MM01 BAPI_MATERIAL_SAVEDATA
MM02 BAPI_MATERIAL_SAVEDATA
ME22/ME22n BAPI_PO_CHANGE
ME21/ME21n BAPI_PO_CREATE1
ME51 BAPI_REQUISITION_CREATE
VA02 BAPI_SALESORDER_CHANGE
VA01 BAPI_SALESORDER_CREATEFROMDA
T2
ECC standard Batch Input programs
Are also given some BAPIs (or Idocs) that you can use to update data instead of using BDC, and the correspon
transactions and tables.
This list is far from being exhaustive!
Object Description
Batch Input program name
Dialog Transact ion
IDOC message type

BAPI or similar Tables ABAP Characteristic

RCCLBI01-

Interview CL01 to

Guide
CLSMAS • BAPI_CLASS_GETDETAIL

Pran
class
LSMW 140/0
CL03
• BAPI_CLASS_CREATE
• BAPI_CLASS_CHANGE
• BAPI_CLASS_DELETE
• Note 1083986 - BAPIs for classification - overview
TCLA
Classification (Characteristic class assignment to object (material, etc.))
CLFMAS • BAPI_OBJCL_CREATE
• BAPI_OBJCL_CHANGE
• BAPI_OBJCL_CONCATENA
TEKEY
• BAPI_OBJCL_SPLITKEY
• Note 1083986 - BAPIs for classification - overview
• KSSK (assignmen t)
• AUSP (characteris tic values)
Characteristic (and values)
RCCLBI02 - LSMW 130/1
CT04 CHRMAS • BAPI_CHARACT_GETDETAI
L
• BAPI_CHARACT_CHANGE
• BAPI_CHARACT_CREATE
• BAPI_CHARACT_DELETE
• Note 1083986 - BAPIs for classification - overvie
•CABN LSMW 150/0
(characterist ics)
•CAWN (characterist ic possible values)
Bill of material •RCSBI010 - LSMW 30/1 creation.
•RCSBI020 - LSMW 30/2
•RCSBI030 - LSMW 30/3
•RCSBI040 - LSMW 30/4
CS01 (IB01 for equipmen t)
BOMMAT BAPI_MATERIAL_BOM_GROU
P_CREATE
Equipment (note: object link and task list are handled as separate objects)
• EQUI
• EQKT
Measurement document
RIIBIP00
•EQUIPMEN (general PM
T_CHANGE direct input &
•EQUIPMEN batch input) -
T_CREATE LSMW 400/1 to 2
IE01 to IE03
None. For info: EQUIPMENT_SUCCESSORS (read)
IK11 IMRG
Functional location

RIIBIP00 (general PM direct input & batch input) - LSMW 430/2 ABAP Interv
Guide P
• • IFLOT
IFLOTX
Functional location object link
RIIBIP00
IL01 to
• FUNC_LOC
BAPI_FUNCLOC_CHANGE (general PM
IL03
_CHANGE
• BAPI_FUNCLOC_CREATE direct input &
• FUNC_LOC
• BAPI_FUNCLOC_GETDETAIL batch input) -
_CREATE LSMW 440/1 and 2
IN04
Equipment object link
RIIBIP00 (general PM direct input & batch input) - LSMW 450/1 and 2
RIIBIP00
IN07 • INET (general PM
• INETX direct input & batch input) - LSMW 450/3 (creation) and 4 (change)
Object Description
Batch Input program name
Dialog Transact ion
IDOC message type
BAPI or similar Tables
MPLA Maintenance plan
Equipment task list
RIIBIP00 (general PM direct input & batch input) - LSMW 460/1 to 4
IP01 to IP03 (and IP10 or IP30 for schedulin g parameter s, IP42 as a special IP01, etc.)
None No BAPI but we can officially (see RIIBIP00 program documentation) use functions IBIP_BATCH_INPUT_
IBIP_BATCH_INPUT. Note that the last is called by RIIBIP00
IA01 EAPL
Functional location task list
RIIBIP00 (general PM direct input & batch input) - LSMW 470/0
IA11
Goods movements

RIIBIP00 (general PM direct input & batch input) - ABAP LSMW Interview
MBGMCR

Guide Pran
PM general task list
For MM:
MB1A to RM07MMBL
MB1C, MB01 to MB03, MB11 to MB13
IA05
PM Goods Movement
RIIBIP00 (general PM direct input & batch input) - LSMW 490/0
MB11
PM Notification
RIIBIP00 (general PM direct input & batch input) - No LSMW
RIIBIP00
IW21 BAPI_ALM_NOTIF_CREATE (general PM direct input & batch input) - No LSMW
Object Description
Batch Input program name
Dialog Transact ion
IDOC message type
BAPI or similar Tables
Object Description
Batch Input program name
Dialog Transact ion
IDOC message type
BAPI or similar Tables
Measuring
RIIBIP00
IK01 Not official:
IMPTT point
(general PM
MEASUREM_POINT_READ direct input) -
MEASUREM_DOCUM_DIALOG LSMW 425/0
_SINGLE GET_MEASURING_DOCUMEN TS
Purchase
• EBAN requisition
• EBKN (purchase request)
Purchasing info record
RAALTD11 Direct Data Import - Asset Accounting (Fixed Assets)
RCCLBI01 Batch Input: Create Classes
RCCLBI02 Batch Input: Create Classification Data
RCCTBI01 Batch Input: Create Characteristics
RCPTRA02 Data Transfer of Routings via Direct Input
RCRAPDX2 Data Transfer of Work Centers
RCSBI010 Create BOMs using Batch Input
RCSBI020 Change BOMs using Batch Input
RCSBI030 Create Variant BOMs using Batch Input
RCSBI040 Create BOMs with all long texts using Batch Input
RFBIBL00 Batch Input Accounting Documents
RFBIDE00 Batch Input Interface for Customers
RM06BBI0 -
ME51N • PREQCR
• BAPI_PR_CREATE LSMW 80/0
• PREQCR1
• BAPI_PR_CHANGE (enjoy)
• BAPI_PR_GETDETAIL
ME11 INFREC BAPI_INFORECORD_GETLIST • EINA
• EINE
• EIPA
Price Conditions
RM06IBI0 - LSMW 60/0
RV14BTCI -
VK11,
COND_A KONH LSMW 70/0
MEK1, XK15, etc.
Vendor • Standard
• LFA1 RFBIKR00
• LFB1
• Shared RFBIKR00
• Extended PSM RFBIKRK0
XK01,
CREMAS NONE except VK01,

ABAP Interview
BAPI_VENDOR_GETDETAIL FK01

Guide Pran
Various Standard Direct Input and BDC programs
List of various standard SAP Direct Input and BDC programs:
RFBIKR00 Batch Input Interface for Vendors

RFBISA00 Interface for General Ledger Account Master Data

RHALTD00 Legacy Data Transfer - Personnel Planning data

RM06BBI0 Batch Input For Purchase Requisitions From Another System

RM06EEI0 Transfer of Purchase Orders

RM06EEI1 Transfer of Purchase Order History

RM06IBI0 Batch Input for Purchasing Info Records

RM07MMBL Batch Input: Post Material Document

RM07RRES Batch Input: Create Reservation

RMDATIND Transfer Material Master Data by Direct Input

RMLIFO34 Transfer External Data for LIFO/FIFO Valuation

RPULKT00 Transfer Old Payroll Account from Sequential File to Table T558A

RPUSTD00 Transfer HR Master Data

RSTXLITF Load texts - Report For Uploading ITF Format From a Dataset

RV14BTCI Batch Input Interface for Conditions (Pricing) Sales and Purchasing

RVINVB00 Transfer sales documents to SD (Open sales orders)

RVINVB10 Transfer sales documents to SD (Copy sales documents)

ABAP Interview Guide Pran


==========================BADI & Enhancements====================
BADI is used adding some additional functionality to standard functionality without disturbing to standard functional
functionality. It is object oriented programming. It Provides classifieds (means field exit, menu exit function exit....) R
Can be used number of times.

Business Add INS: (BADI):

Business Add-Ins is a new SAP enhancement technique based on ABAP Objects. They can be inserted into the Sta
accommodate user requirements .Since specific industries often require special functions that can be achieved via B
Business Addins.

In order to enhance a program, a Business Add-In must first be defined. Application developers create an interface
Enhancement management takes this interface and generates an adapter class for implementing it, thus opening a
implementations created by partners or customers. AS a developer you need to create an instance of the adapter c
program and calls the corresponding method at the appropriate time.

Customers can find the enhancements present in their system in the IMG and in the component hierarchy. Whenev
a Business Add-In, they must create their own implementation of the add-in. Customers must first implement metho
interface enhancements, and then activate their implementations of the enhancement. The enhancement’s active c
called at runtime. Normally, a Business Add-In contains an interface and other additional components such as funct
enhancements. In some cases, Business Add-Ins also includes enhancements for screens. The enhancement, inte
associated classes generated all lie in the appropriate application development namespace. Business Add-In imple
respective namespaces of the people who created them.

These steps should enable you to find any BADI related to any transaction:
1. Go to the transaction SE37 to find your function module.
2. Locate the function SXV_GET_CLIF_BY_NAME. 3. Put a breakpoint there. 4. Now open a new session. 5. G
transaction. 6. At that time, it will stop this function. 7. Double click on the function field EXIT_NAME. 8. That wil
name of the BADI that is provided in your transaction.
Find a BADI for a Transaction code
1. Goto SE24 (Display class cl_exithandler) 2. Double click on the method GET_INSTANCE. 3. Put a break po
no.25 (CASE sy-subrc). Or at line "CALL METHOD
cl_exithandler=>get_class_name_by_interface" 4. Execute SAP standard transactions. 5. Presses the required
which you need to write exit logic, the execution will stop at the break point. 6. Check the values of variable 'exit
give you the BADI name called at that time. 7. This way you will find all the BADIs called on click of any button in
transaction
Code to Find BADI for Any Tcode The following program asks for a transaction code or a program name. If a
code is entered, it’s called program is used as the program name. With the program name, its package is retriev
the Enhancements (Customer Exits) and classic BAdIs of this package are displayed. It means this program is a

some Enhancements (customer exits) and BAdIs in the same package, but ABAP maybe Enha

using Buffer they are trace (customer not - related Transaction exits) Interview to this a

Gui
transaction BAdIs (Screenshots) which or program, will or not Find and be a listed moreover, BADI

through this this program. transaction SPRO.

Instead, Pran
or program prefer Finding may call a many BADI
REPORT ZBADI_FIND1. TABLES : TSTC, TADIR, MODSAPT, MODACT, TRDIR, TFDIR, ENLFDIR, SXS_AT
T. DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE. DATA : FIELD1(30). DATA : V_DEVCLAS
TADIR-DEVCLASS. DATA WA_TADIR TYPE TADIR.
PARAMETERS : P_TCODE LIKE TSTC-TCODE, P_PGMNA LIKE TSTC-PGMNA .
START-OF-SELECTION. IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE. ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA. ENDIF. IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG' AND OBJ_NAME = TSTC-PGMNA. MOVE : TADIR-DEVCLASS TO V_DEVCLASS.

ABAP
SUBRC NE 0. SELECT IF SELECT TRDIR-SUBC WHERE SINGLE SINGLE NAME

Interview * EQ FROM * = 'F'.

FROM TSTC-PGMNA. TRDIR


TFDIR

Guide Pran
WHERE PNAME = TSTC-PGMNA. SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME. SELECT SINGLE * FROM TADIR WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR' AND OBJ_NAME EQ ENLFDIR-AREA. MOVE : TADIR-DEVCLASS TO V_DEVCLA
ENDIF. SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT IN ('SMOD', 'SXSD') AND DEVCLASS = V_DEVCLASS. SELECT SINGLE *
WHERE SPRSL EQ SY-LANGU AND TCODE EQ P_TCODE. FORMAT COLOR COL_POSITIVE INTENS
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE, 45(50) TSTCT-TTEXT. SKIP. IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE. FORMAT COLOR COL_HEADING INTENSIFIED ON.

Output
ABAP Interview Guide Pran

Multiple use for BADI definitions means that there can be several active BADI implementations. When there is a c
called up - however, in an unpredictable sequence. Methods of a multiple use BADI can only have importing and ch
parameters
If you have multiple-use BADI definitions, the sequence must not play any role therefore. A typical example is th
checks before a save. Which is much better for software deployment as several developers can implement the s
independently.
How to set sequence for multiple BADI implementations
Create the new implementation BADI_SORTER.
Enter the name of the BADI whose object plug-ins you want to call in a sorted sequence as the filter condition fo
BADI_NAME filter.
Create a screen enhancement to query any kind of sort criterion. The Enhancement Builder then displays this su
each implementation of the BADI to be sorted. Implement the methods of the BADI interface IF_BADI_SORTER
your sort criteria in the BADI implementation class. Without this procedure, the sequence is undefined.
Sorting BAdI Implementations
The sequence for execution of BAdI implementations can be controlled for BAdIs used on a multiple basis by a
mechanism.
Procedure
In the BAdI Builder (SE18), choose Utilities → Sort.
Choose Standard Sort if sorting is to take place using numeric sort values. The numeric values are entered in
displayed field Layer Value when you create the implementations and stored in a table. The implementations ar
accordance with the specified sequence.
Choose Special Sort if sorting is to take place using non-numeric sort values. In this case, you need to enter
ABAP name Proceed of as the follows implementation if you Interview
will special be created sorting:

Guide
in the following step.

Pran 1. Create an implementation for the BAdI definition BADI_LAYER contained in the delivered

Enter a BAdI definition as filter value in the Properties tab (the name will be used as a dummy value to begin wit
a screen (in a function group or a module pool). The screen contains, for example, a text field with the
name Sort Value and an input field. 3. Choose the Subscreens tab of the BAdI implementation and enter the ca
and the screen number. (For
screen shots refer Goto the link on the last page)
Switching Off Sort Function
To switch off the sort for the execution of BAdI implementations, choose Utilities → Sort and finally No Sort. The
implementations will now run in an arbitrary sequence in this case. The edit field that was displayed using a sub
the execution of a BAdI implementation now disappears. Sorting of BAdI implementations can be switched on a
time. This does not count as a modification to the standard version. The BAdI definition is not changed. Switchin
making a change, on the other hand, counts as a modification.
Difference between Enhancements and BADI
1. Enhancements are Client Dependent BADI is client in-dependent. 2. Classic enhancements can have only on
Implementation. Whereas BADI can have Multiple Implementations
Filter dependent BADI
Business Add-Ins may be implemented on the basis of a filter value. If an enhancement for country-specific vers
provided for in the standard version, it is likely that different partners will want to implement this enhancement. T
countries can create and activate their own implementation.
Enter a filter type when defining your enhancement (a country or industry sector, for example). All methods crea
enhancement's interface have filter value FLT_VAL as their importing parameter. The application program provi
value for the enhancement method. The method then selects the active implementation for that value.
Defining a Filter-Dependent Business Add-In
To define a filter-dependent Business Add-In, first create the definition of the Business Add-In and select the Fil
dependent checkbox. Enter the data element you want as a filter type or select a filter type using the input help
can be a data element or a structure. A data element must fulfill the following criteria:
• The data element's domain may contain a maximum of 30 characters and must be of type Character.
• Either the data element has a search help with a search help parameter of the same type as the data elemen
parameter must serve as both the import and export parameter, or the domain has fixed domain values or a valu
containing a column with the same type as the data element.
If necessary, you can create such a data element yourself.
If you want to call the implementation of a Business Add-In to depend not only on a filter value but on various va
enter the name of a structure in theFilterType field. The structure can consist of several data elements that fulfill
conditions for data elements. The structure must not be longer than 80 characters. You can use different eleme
types, for example: a country, a material, an object type, an internal parameter, and so on. This also applies to s
Now create an interface with methods. Remember that for each method you create in the interface of a filter- de
enhancement, the filter value must be defined as the importing parameter so that the application program can

ABAP Interview
value. The provide filter value the filter is always value

the enhancement using the parameter method. FLT_VAL The method Guide and then is prede

the in active the Pran


list implementation of parameters.
for that
Types of Enhancement Technologies
There are different kinds of technologies that provide enhancement options: 1. Source Code Enhancements
Enhancement points are positions in the source code where you can attach source code plug-ins which enhan
code at these positions. While a source code plug-in at an enhancement point is processed in addition to the ori
code of an enhancement section is substituted by the respective source code plug-in.
The following enhancement option types are available in a source code:
a) Enhancement-Point – SAP has some standard functionality defined for a report, but it may be required
that you'll need to add your own code. In this case the code that you'll add will be executed along with the stand
either be static (for example, additional data declaration) or dynamic (for example, additional coding).
b) Enhancement-Section – SAP has its standard functionality defines but it may not suit your requirement, in th
may need to add your code and you'll need that code to be executed only. By this method the existing code is a
commented and a copy of the same code is available to edit. After executing the report only your code will be ex
the standard code will be bypassed. Can either be static (for example, replace an existing data declaration) or d
example, replace coding).
c) Overlay enhancement – overwrites an existing enhancement instead of modifying it.
Enhancement options and sections are hooks to which you can assign an enhancement. That is, you can enhan
with an enhancement.
Source Code Enhancements versus Modifications Advantages of source code enhancements:
• No modifications
• No object key is needed
• They can be switched on and off by means of the Switch Framework
• Less upgrade effort is required.
Disadvantages of source code enhancements:
• They exist only at special source code lines (implicit, explicit).
Note Program-bound enhancement implementations in a multiple-use include can only be displayed when the r
programs are generated. The programs, function groups, classes, and so on can be generated within the respe
ABAP 2. Function using Alternatively, function Group group Enhancements transaction enh

Interview SGEN – you can can be enhance used to perform the interface Gui
mass of generation a function module in a Pran
system.
by additional parameters
The function module enhancements can be separated into:
a) Source Code Enhancements – Enhancements to the source code are carried out by means of ABAP sourc
code enhancements. b) Parameter Interface Enhancements – You can enhance the parameter interface of a
module with
new, optional formal parameters as enhancement implementation elements. More information: Enhancing Param
Interfaces.
3. Class Enhancements – you can add additional methods, optional parameters, pre- and post-methods to exis
methods. 4. BAdIs – object-oriented enhancement options. The BAdI defines an interface that can be implemen
classes
that are transport objects of their own. The new BAdI is fully integrated into the Enhancement Framework. Withi
Enhancement Framework, a BAdI is an enhancement option or an anchor point for an object plug-in. 5. Web Dy
Enhancements. 6. Enhancements in the Switch Framework.
Implicit Enhancements and Explicit Enhancements There is one major distinction between the enhancemen
technologies: the separation into implicit and explicit enhancements. Implicit Enhancement
Implicit enhancement options always exist and no enhancement spot is assigned to them. The implicit enhancem
are provided by the framework without any effort on the developer's part. That is, the enhancement definition is
implementation has to be inserted. Implicit enhancements comprise class enhancements, function group enh
and predefined enhancement options at particular predefined positions (such as the end of a report, a functio
include or a structure and the beginning and the end of a method.)
Explicit Enhancement
An explicit enhancement option is part of the ABAP program. It is assigned to the package of the program and n
package of the enhancement spot to which it belongs. If there is a need for more or other enhancement options
provided by the framework, you can use explicit enhancement options: They have to be inserted explicitly by the
There are two types of explicit enhancement options: BAdIs and explicit enhancement options or sections, w
insert source code plug-ins.
BADI Customer-exit
Business Add-Ins is a new SAP enhancement technique based on ABAP Objects.
CUSTOMER EXITS (enhancements) are FUNCTIONS so they are called using CALL FUNCTION (or more exa
CUSTOMER FUNCTION
BADI’s allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versio
solutions, and the like). Business Add-Ins can be created at each level within such a system infrastructure
Customer exits assumes a two-level infrastructure (SAP and customer solutions)
Some BADI can have multiple independent implementations, which is much better for software deployment as s
developers can implement the same BADI independently.
Customer-exit implemented in one project cannot be implemented in other.

ABAP Interview Guide User Exit Customer Pr


Exit
User exit is implemented in the form of a Subroutine i.e. PERFORM xxx. Example: INCLUDE MVF5AFZZ à PER
userexit_save_document_prepare.
A customer exit can be implemented as:
· Function exit
· Screen Exit
· Menu Exit
· Field Exit Example: CALL Customer function ‘xxx’ INCLUDE xxx. You modify this include.
In case of a PERFORM, you have access to almost all the data. So you have better control, but more risk of ma
system unstable.
You have access only to the importing, exporting, changing and tables parameter of the Function Module. So yo
limited access to data.
User exit is considered a modification and not an enhancement.
A customer exit is considered an enhancement.
You need Access Key for User Exit. You do not need access key.
Changes are lost in case of an upgrade. Changes are upgrade compatible.
User exit is the earliest form of change option offered by SAP.
Customer exits came later and they overcome the shortcomings of User Exit.
No such thing is required here. To activate a function exit, you need to create a project
in SMOD and activate the project.
User exits are basically designed For SD module. Customer exits Are available for MM, SD, FI, HR.
Basically designed for all modules.
Client independent Client dependent.
Application-Specific User Exits
Type (Behavior at Upgrade, Transport) Modification
Description of Function User exits allow you to add additional functions to the SAP standard. Programs with u
contain subroutine calls at certain points in their syntax that are identified by the prefix USEREXIT. The actual u
located in an include that has been assigned to a module pool. This is where customers can include any change
(enhancements) that they want to make to the system. These includes are always processed during program flo

Advantage: In principle, customers can modify anything they ABAP Intervie


Disadvantage: themselves process.

that is Guide which found SAP often in cannot the leads include check to errors (tables, Pr
the individual in structures, the enhancement
enhancements
and so forth).
Range (Validity) Throughout the entire system
Access in the System SAP Reference IMG
Further Information User exits are primarily used in the sales and distribution
component. You can find an overview of user exits as well as a description of those user exits that exist in SD in
Reference IMG under Sales and Distribution ® System Modification ® User exits.
How to Find User Exits for Tcode
Go to transaction code: ME29N
System---->Status, here copy the program name (SAPLMEGUI),
Go to ABAP editor and specify the program name SAPLMEGUI and find the package "ME".
Transaction code: CMOD, Utilities--->Sap Enhancement,
Specify the package name: ME
And execute, displays a list of exits,
And find out our suitable exit based on requirement.
Check these: EXIT_SAPMM06E_021
How to Find Associated User Exits for a T-Code

Requirement

For every ABAP developer, there is always a situation to make some custom changes on Standard Process by
Exits of a Tcode and attach some validations to it. Many times we are depending on Functional Consultants and/or
research and/or Google to find it out. Here is a method to find out all associated user exits for a given Tcode.
In this document I use MB1B as a Tcode and trying to find all possible user exits for this Tcode.

Steps 1. First, find the Development Class of a Tcode MB1B Execute the
Tcode
• Go to Menu bar -- Select Status
• A Popup will open
• Double Click on the Tcode --> in the Label Transaction
• Here you will get the development Class name as Package

ABAP Interview Guide Pran Name - in ou


is MB

2. Second, Execute the Tcode SMOD


• Go to menu bar and select Utilities
• Click on Find
• Give the value as MB (as you find package name in above step)

3. Now, Execute
F8
• This will display all associated User ABAP Now you are ready with list
Exits,

Interview of User exits for the

given Tcode.

Guide
Pran
Field exit It is mostly used to put validation checks on input field. Suppose you want to put the validation on compa
location number. You might want to set up your R/ 3 System so that all international location numbers are larger tha
concept lets you create a special function module that contains the validation logic. You assign this special function
element BBBNR (data element for the international location number). You then assign this module to the programs
users can add new international location numbers. When you activate your field exit, the system automatically trigge
routine whenever a user enters a company location number. Note: You can’t use call screen or any popup in field e
so you need to satisfy with very limited options like error message.

Customer Exit: Meet our two heroes SMOD and CMOD for customer EXIT. In simple word SMOD transaction cod
what EXITs are available in a particular package. And CMOD transaction code is used to implement these EXITs. E
in components. To use these components you need to create a new project in CMOD transaction. There are three t
EXITs.
1. Function module EXIT 2. Screen EXIT 3. Menu
EXIT

How to Find the Enhancement:


Go to SMOD. Press F4 in the Enhancement field. In the next popup window, click pushbutton ‘SAP Applications
appear that contains information on all the enhancements, categorized under functional areas. Developer must
enhancements relevant to his functional area of interest – for e.g., Purchasing, Asset Accounting, etc. Note dow
enhancements. Then, come to the initial screen of SMOD and view the documentation of each enhancement to
one is required for your development. As an example take BATCHCHK and open it in SMOD transaction .you ca
can be used for the Batch validation.
Function EXIT: Function module exits add functions to R/3 applications. Adding functionality to R/3 applications
module exits play a role in both menu and screen exits. Function module exits play a role in both menu and scre
When you add a new menu item to a standard pull down menu, you use a function module exit to define the act
should take place once your menu is activated. Function module exits also control the data flow between standa
and screen exit fields. SAP application developers create function module exits by writing calls to customer func
source code of standard R/3 programs. These calls have the following syntax: CALL CUSTOMER-FUNCTION ‘
Screen EXIT: When it comes to the standard screen modification you can use screen EXIT. Screen exits add fi
screens in R/3 applications. SAP creates screen exits by placing special sub screen areas on a standard R/3 sc
calling a customer sub screen from the standard screen’s flow logic..
Menu EXIT: Menu exits add items to the pull down menus in standard SAP applications. You can use these me
call up your own screens or to trigger entire add-on applications.

ABAP
User Exit: If everything After you reading search which into so many is Google used art

Interview you enhance will i ended end the up up SAP with with standard the thousand

user definition definition:

EXIT!!!!!!. Guide of user exit. Even according Pran


to the name
User Exits allow us to add our own functionality to SAP standard program without modifying it. These are imple
form of subroutines and hence are also known as FORM EXITs. The user exits are generally collected in includ
attached to the standard program by the SAP.
Keyword exit: Add documentation to the data elements of key words defined in the ABAP/4 Dictionary. The sys
this documentation whenever a user presses F1 to get online help for a screen field.
How To Search A Classic BADI. As per the above diagram Adapter class calls the appropriate BADI implemen
you have created. To get the instance of adapter class, CL_EXITHANDLER class’s static method GET_INSTAN
To find the Classic BADI put the break point into GET_INSTANCE method of class CL_EXITHANDLER. Check
EXIT_NAME variable while executing your current application (Suppose you want to find BADI while creating ba
Tcode MSC1N). Collect all those exit_name. Go to SE18 and try to find the proper BADI which can help to solve
problem.
====================Dialog Module/ Dialog Programming=======================
Events in Dialog Programming
There are four events in Dialog Programming: 1. PBO (Process before Output) – Before the screen is display
event is processed. 2. PAI (Process after Input) – When the user interacts with the screen, the PAI event is pro
3. POV (Process on Value) – are triggered when the user requests possible values help (F4).
4. POH (Process on Help) – are triggered when the user requests field helps (F1).
List Of Screen Elements - Input / output fields, Text fields, Checkbox, Radio button, Push Button, Drop down li
Subscreen, Table control, Tabstrip control, Custom control, Box, Status icons, OK_CODE fields
Logical Unit of work is a block of memory area where database contents are stored and manipulated.
Chain & endchain – this is used to validate screen elements in screens.
Module pool – a collection of screens, flow logic, menu bar & ABAP code a module pool is a program this is sta
Tcode.
Leave Screen –statement ends the current screen and calls the next screen. The next screen will be static scre
dynamic screen.
Leave to screen – this statement exits the current screen and calls the dynamic next screen that is specified as
statement.
Call screen: if we write this statement in screen 100 and it will go to screen 200 and it will retain screen 100(u c
and moreover u have options call screen 200 starting at x1y1 ending at x2y2.
Set screen: it will go to screen 200 and screen 100 no more remains.
Leave Program - Leaves the current program and continues processing after CALL TRANSACTION, CALL DIA
SUBMIT program AND RETURN.
Model dialog box: It is pop-up screen that would be displayed over another screen with out releasing the other
executing the section in it may come back to the exiting screen or call another screen.
Set Parameter

ABAP
Syntax This PID, statement a SET flat character-type PARAMETER sets the content fie

Interview ID PID is of expected the FIELD SPA/GPA dobj.


that can parameter contain specified a maximum Guide in PID of 20 to the characters, conte

Pran
of which the data cannot object be
dobj. For
exclusively blank characters. PID is case-sensitive. For dobj, a flat character-type field is expected, whose binar
transferred in an unconverted format.
The SET PARAMETER statement does not access the SAP Memory directly. Instead, it accesses the SPA/GPA
mapped locally in the roll area, which are loaded when rolled in and saved in the SAP Memory when rolled out (
parameters and ABAP programs). If the SPA/GPA parameter specified in PID for the current user does not yet e
SAP Memory when rolled in, it is created. If the SPA/GPA parameter has already been created for the current u
is overwritten.
In a program, SPA/GPA parameters can be created or assigned values only if a name exists for them in the tab
can be determined statically that an identification specified in pid is not contained in the TPARA database table
package check of the ABAP runtime environment is activated by the profile parameter ABAP/ package_check, a
occurs. Otherwise the extended program check reports an error.
Note
To ensure that a SPA/GPA parameter specified in PID matches a name in the database table TPARA, it must b
upper case.
Since the SET PARAMETER and GET PARAMETER statements do not work directly with the SPA/GPA param
SAP Memory, they can only be used to pass data within a main session, not between parallel main sessions, sin
that run in parallel can affect the status of the parameters in a way that cannot be controlled.
Get Parameter
Syntax GET PARAMETER ID PID FIELD dobj.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy