ABAP Complete Interview Guide
ABAP Complete Interview Guide
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 single is stored table with called other table pooled pool Guide in tables the
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
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
Interview
elements types in described the ABAP below, Dictionary and
Guide
are describe used to specify individual the fields. types of They columns
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
data Interview you tables. type can in use When a program the you
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,
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
Interview
short text directly in the table maintenance.
(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
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
available in each dialog step. There ABAP 1. 2. Dialog Update are five Work
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.
Integer Numerical - 4.
Interview
character string of arbitrary length - 1.
ABAP The converted Data Convert Class: into The to transparent transparent
Data class Interview tables table determines earlier flag (transparent
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.
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.
that satisfy the WHERE ABAP Order Binary By: Search condition. The
Interview
means results If you that are use sorted you DISTINCT, can
Guide order
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
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
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
Interview
always can uses be a binary accessed search.
through both INDEX and with Guide Pran KEY (Condition). Sorted
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
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
Interview
physically table pool stored of the in matchcode a separate object table is in
this with option, status the S in Debugger Interview their program is also attributes). ac
Pran
breakpoints, the System
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
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
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
I page insert break symbols in Interview sap in Smart scripts: Forms with CALL : S
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
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
Interview Guide
E SSFCRESCL printed After which form actions form
Pran
produced you can which use
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.
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(*)&
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
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
Guide
n decimals
ABAP
To such. SAP debug provides User – just SE71 a modifies standard → utilities the layo
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
Guide
Forms have or alignment, Smart used Styles, local or syntax logic.
Pran
you should errors.
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]
new page. If no name is defined, then, the next page attributes from page setup is taken. ABAP
/: NEW – PAGE [PAGE-NAME]
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
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
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
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
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
NE 0. MESSAGE... ENDIF.
Here the result parameter returns the status information and print/fax parameters after the form have been printed
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
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.
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
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
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
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
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
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
IT_BANK-BANKL.
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
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:
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
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:
errors only
: 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.
= = 'XX'.
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
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
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
RPULKT00 Transfer Old Payroll Account from Sequential File to Table T558A
RSTXLITF Load texts - Report For Uploading ITF Format From a Dataset
RV14BTCI Batch Input Interface for Conditions (Pricing) Sales and Purchasing
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
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
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
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.
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
3. Now, Execute
F8
• This will display all associated User ABAP Now you are ready with list
Exits,
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
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
ABAP
Syntax This PID, statement a SET flat character-type PARAMETER sets the content fie
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.