Sap QB

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 64

Q1) what is ASAP methodology?

Answer. ASAP stands for Accelerated SAP (ASAP). ASAP is a software tool used for project management in
SAP implementations. Normally, any SAP implementation involves various phases. ASAP helps in guiding a
SAP implementation project. Thus from the initial stages to the "Go Live" stage, ASAP helps in streamlining the
entire SAP implementation process.

Q2) in SAP, is it possible to have a self-defined transaction code?


Answer:To start with, yes, self-defined reports, transactions or functions are possible within SAP. There might be
numerous reasons why a company might go in for customized transaction codes or for that matter reports. To
cater to this demand, SAP allows creation of user-defined transaction codes.
Creating a transaction code allows the user to speed up access to specific reports/programs as the user no
longer needs to use transaction code [SE38]. Thus, instead of using T-Code SE38, then entering the program
name or report name and pressing execute, the same can be done directly through a pre-defined T-Code.
The user can then simply use a transaction code, which will automatically open the program. In SAP
customized T-codes can be created through transaction code [SE93].

Q3) what is ABAP data dictionary?


A data dictionary is central source information for data in a data management system. Its function is creation
and management of data definitions. The data dictionary objects are automatically created in the database.
Q4) how many types of tables are there in SAP?
Answer. There are three types of tables
1) Transparent tables
2) Pooled tables
3) Cluster tables
Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data from
several different tables can be stored together in a table pool or table cluster. Tables assigned to a table pool
or table cluster are referred to as pooled tables or cluster tables. 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.

Transparent Table: Exists with the same structure both in dictionary as well as in database exactly with the
same data and fields. A transparent table is a table that stores data directly. You can read these tables directly on
the database from outside SAP with for instance an SQL statement. I.E you can use Native SQL also to read the
tables along with Open SQL. Transparent table is a one to one relation table i.e. When you create one transparent
table then exactly same table will create in data base and if is basically used to store transaction data.

Pooled Table: Pooled tables are logical tables that must be assigned to a table pool when they are defined.
Pooled tables are used to store control data. Several pooled tables can be combined in a table pool. The
data of these pooled tables are then sorted in a common table in the database.
Cluster Table: Cluster tables are logical tables that must be assigned to a table cluster when they are
defined. Cluster tables can be used to store control data. They can also be used to store temporary data or
texts, such as documentation.
A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and
pooled in one field. I.E they must be read using OPEN SQL only. You can not read them using native SQL.
You can create secondary indexes on transparent tables where as secondary indexes can’t be created on
pooled and cluster tables.
Q5) what is a table? What is the difference between structure and table?
Table consists of rows and columns where we store the real world data. Main difference between structure
and Table –
When we create table and activate it, it will be created both in ABAP dictionary and under lying physical
database. Table can hold data.
Where as structure can not hold data. It is created only in the ABAP dictionary. We can declare objects that are
of structure type and make use of them to hold data in run time.

Q6) Have you ever created custom database tables (Z tables) in any project?
This is the most common question being asked in any interview. For this you can say YES. I will give you a
real time example.
There is a report program. You want to maintain the log of execution for that report. That means you want to
maintain user details who has executed the report. When they have executed and what time.
For that you will create a custom table with fields like user id, date, time etc. When ever a particular report is
executed, the custom table is updated with the details mentioned above. This is the simple scenario.
Like this, we can create custom tables to suit our requirements.

Q7) what is a logical database?


Answer: This is one of the most commonly asked questions in a SAP technical interview. A logical database is
simply an ABAP program that combines the contents of database tables. A logical database is linked to an ABAP
report program as one of the program attributes. It supplies the ABAP report program with a set of
hierarchically structured table entries derived from different database tables. This saves the developer from
having to program the data retrieval. The logical database term covers both the program and the dataset.

Q8). In SAP how can a user view a list of all changed entries in customizing tables?
Answer: For viewing changed entries in a user has to turn on table logging, once this is done, one can view each
changed entry to the customizing table. SAP shows information by system, date, time, user, the old entry, and
the new entry; a list of all prior modified data is also shown by the system.

Q9) what is a data dictionary?


A data dictionary is a centralized storage location for information about the data that is stored in a database.
This information is often called “metadata” (data about data).
A data dictionary provides answers to questions such as:
* What data is contained in the database?
* What are the attributes of this data: name, length, format, etc.?
* What relationships exist among different data objects?

Q10) what is SAP’s data dictionary?


SAP’s data dictionary is called the ABAP Dictionary.
The ABAP Dictionary:
– Enforces data integrity
– Manages data definitions without redundancy
– Is tightly integrated with the rest of the ABAP Workbench

Q11) what is database utility?


The database utility provides the interface between the ABAP Dictionary and the underlying database
management system (DBMS). It supports the creation of tables and secondary indices in the database both
online and in the background.
Whenever you make a change to a dictionary object that affects the underlying database, the database utility
is activated. Usually it works silently behind the scenes, but occasionally the database utility will prompt you
for information. This occurs when an error is encountered or when existing data must be converted.
The database utility provides the interface to the DBMS by automatically generating the Data Definition
Language (DDL) that the DBMS understands.
• The Database (DB) Utility is a tool used in SAP to serve as a interface between the database management
software (i.e., ORACLE, INFORMIX, DB2, INGRES, etc.) and the ABAP Dictionary. It is used to:
– Convert data (i.e., change field lengths and data types, etc.)
– Activate objects in the ABAP Dictionary
– Create tables and indices
– Perform all standard table operations in the database that were entered in the ABAP Dictionary
• The DB Utility automatically writes the SQL commands necessary to create, change and delete tables and
indexes in the physical database, and records the tables in the ABAP Dictionary.
• As the DB Utility is operating, a log file gets created which contains information on whether or not the
conversion was successful and the point of failure during the conversion if it was not successful.
• The DB Utility can be run either online or in the background.
• You can also manually run the DB Utility from any ABAP Dictionary screen under the UTILITIES menu or
transaction SE14.
Q12) what is a data element?
A data element provides a meaningful description for a field. You will hear it called a semantic domain. The
data element description appears beside a field in a table definition. These descriptions are language-
dependent.
Q13) what is a domain?
A domain specifies the technical characteristics and the allowed values of a field. Domains are linked to fields via
data elements. In other words, fields are assigned to data elements, and data elements are assigned to domains.
You cannot directly assign fields to domains.The technical characteristics of a field are the field’s type and length.
These are also referred to as the field’s format. The allowed values of a field define what acceptable input for that
field is. These may be listed explicitly or may be specified by reference to a value table.Domains can exist
independently in the ABAP Dictionary.Just as multiple fields may be assigned to the same data element, multiple
data elements may be assigned to the same domain.As with data elements, pre-defined domains exist in the
system and are available for your use. If an SAP R/3-supplied domain matches the characteristics you require, use
the pre-defined domain. If you wish to change the domain’s allowed values, however, you must create your own
domain.
In addition to the characteristics listed previously, domains can also specify a fields output characteristics, such as
output length and whether or not lowercase letters are permitted for that domain.
By defining valid values for a domain, automatic validation is provided for any fields that point to that domain.
This includes validation at the ABAP Dictionary level (if a program tries to insert invalid data, an error will
occur) as well as at the screen level (users will not be permitted to enter invalid data).
Additionally, users can obtain a list of possible entries (for fields pointing to domains with allowed values) by
pressing function key F4.
Q14) what is a foreign key?
A foreign key is a field (or combination of fields) that represents the primary key of another table.
Foreign keys are used for:
– Maintaining data integrity
– Providing additional texts in the online help system
– Creating other dictionary objects(such as views) that are defined over multiple tables
Q15) what is a value table?
The table containing the set of allowed values attached to a domain.
Q16) what is a check table?
The table that is referenced by a foreign key. A check table is either identical to a value table, or is another table
containing a subset of the records in a value table.
Q17) what is a foreign key table?
The table containing fields that are the primary key of the other table. The foreign key table is also known as the
“dependent” or “child” table.When creating foreign key relationships, you should always specify the cardinality
of that relationship. Here is a reminder of the possible values for each side of the n : m notation that SAP uses to
specify cardinality.
Q18) how many table types are there in SAP ABAP dictionary?
There are 5 different table types in the SAP ABAP Dictionary:
* Transparent tables
* Structures
* Pool tables
* Cluster tables
* Views
Q19) How many types of table buffering are there?
• Buffering types:
– Single record: Only records actually being processed are moved into the buffer. This type of buffering preserves
buffer space but requires more database hits in order to load the table. Recommended for large
tables
when only a few records need to be accessed.
– Generic: A subset of the table records is loaded based on part of the primary key. Recommended if only certain
“generic” areas of the tablewill be needed.
– Full: Results in either all of the table or none of it being loaded into the buffer.
Recommended for a) tables up to 30 K in size,
b) larger tables where access is needed to many records, and
c) tables against which attempts to access data will frequently yield a “no record found”
result.
Q20) What is an index? What is the use of an index?
An index serves as a sorted copy of the table reduced to specific fields, with a pointer to the remaining fields.
Indexes accelerate the reading of tables when the system looks for records satisfying specific search criteria.
The system determines the most efficient index by which to select data for the specific request.
Q21) In how many ways we can modify SAP tables?
• Groups of fields or individual fields can be added to SAP delivered tables using append structures, or
customizing includes:
Ø Customizing includes are provided in SAP tables and structures to allow you to add fields to these
structures/tables without modifying the tables themselves.
Ø Append structures allow you to add fields to SAP-provided structures and transparent tables that were not
provided for in the standard version.
Customizing includes are supplied empty by SAP and are filled in by the customer with the help of special
customizing transactions. These includes make it possible to extend (add fields to) tables without modifying
the tables themselves and without the risk of additions being overwritten during a Release Upgrade.
· Names of customizing include start with ‘CI_’. If a table does not contain a customizing include, you can
still make additions by creating an Append structure. You cannot add your own ‘.INCLUDE CI_’ to an SAP
table. Append structures are intended for additions not provided for in the standard version of SAP tables via
customizing includes. They are to be used with SAP transparent tables or structures, not with customer
tables. An Append structure is a structure assigned to exactly one table. However, a single table can have a
number of append structures. It is recommended to use only one append structure in a table.
When an append structure is activated, its assigned table is also activated with all of the append structure
fields. When a table including an append structure is activated, the append structure fields are found and
added to the table. Append structures cannot be deleted. Append structures cannot be used with tables containing
fields of data type VARC, LCHR, or LRAW because these data types must be the last field in a table.
Use the Append structures … push-button in the table display screen to add fields to SAP tables.
Fields contained in an Append structure are added to the SAP tables when an upgrade is performed and the
appropriate tables are activated.
Q22) what are Reports and how do you setup Reports?
A report program reads and analyzes data from one or more database tables without modifying database.
Usually, the result of such a program is in the form of list which is output to the screen or sent to a printer.
Q23) what are the different types of programs?
I Include Program.
M Module Pool.
F Function Modules.
S External Subroutines.
1 On line program.
J Interface
K Class
Q24) What are the events in report programming? Explain?
The following events occur at runtime of a typical report program which uses logical databases.
INITIALIZATION Point before the selection screen is displayed. When you start a program in which a
selection screen is defined (either in the program itself or logical database program), the system normally
processes the selection screen first. If you want to execute a processing block before the selection screen is
processed, you can assign it to the keyword INITIALIZATION.
AT SELECTION-SCREEN Point after processing user input on the selection screen while the selection
screen is still active. The event keyword AT SELECTION-SCREEN provides you with several possibilities to
carry out processing blocks while the system is processing the selection screen.
START-OF-SELECTION: point after processing the selection screen.
The event START-OF-SELECTION gives you the possibility of creating a processing block after processing
the selection screen and before accessing database tables using a logical database. You can use the
processing block, for example, to set the values of internal fields or to write informational statements onto the
output screen. At the START-OF-SELECTION event, also all statements are processed that are not attached to an
event keyword except those that are written behind a FORM-ENDFORM block.
GET <table> point at which the logical database offers a line of the database table <table>.
The most important event for report programs with an attached logical database is the moment at which the
logical database program has read a line from a database table. To start a processing block at this event,
use the GET statement as follows.
syntax
GET <table> [fields <List>]
after this statement, you can work with the current line of the database table <table>. The data is provided in
the table work area <table>.
GET <table> LATE point after processing all tables which are hierarchically inferior to a specific data base
table, use the event keyword GET as follows
GET <table> LATE [FIELDS <list>]
In analogy to report programs that use only SELECT statements, the processing block of a GET <table> LATE
statement would appear directly before the ENDSELECT statement in the SELECT loop for the database
table <table>.
END-OF-SELECTION: point after processing all the lines offered by a logical database.
To define a processing block after the system has read and processed all database tables of a logical
database, use the keyword END-OF-SELECTION
The following events occur during the processing of the output list of a report program:
Event keyword Event
TOP-OF-PAGE Point during list Processing when a new page is started
END-OF-PAGE Point during list Processing when a Page Is ended
The following events occur during the display of the output list of a report program:
Event keyword Event
AT LINE-SELECTION Point at which the user Selects a Line
AT USER-COMMAND Point at which the user Presses a Function key or enters a command in the
command Field.
AT PF<nn> Point at which the User presses the Function key with the function code PF<n>
With the selection screen, ABAP/4 offers an interactive element also for report programs. You can define a
selection screen without having to bother about all the details required in dialog programming. The selection
screen is always processed directly after a report program is started. The user can enter field values and
selection criteria on this screen.
The main purpose of the selection screen is to enable the user to control the database selections of the
report program. If a report program is started from another ABAP/4 program with the SUBMIT statement (see
Calling Reports), the selection screen objects also serve as a data interface, With a selection screen defined in the
report program, you can enable the user to Assign values to variables with the PARAMETERS statement
Determine selection criteria with the SELECT-OPTIONS statement

Q25)How do you read selected lines of database table into an internal table in packages of predefined size.

SELECT * FROM <SPFLI> INTO TABLE <ITAB> PACKAGE SIZE <N>.


Where ‘n’ is variable.

Q26) Name the WILDCARD characters which are used for comparison with character strings & numeric
strings. ‘%’ and ‘-‘.
Q27)How to specify a client for database table processing.
TABLES SPFLI .
SELECT * FROM SPFLI CLIENT SPECIFIED
WHERE MANDT BETWEEN ‘001’ AND ‘003’ .
. . .
ENDSELECT.

Q28) Activation – During activation, the runtime object of aggregate object or tables is created. The runtime
object is buffered so that the application program can access it quickly. Runtime object has information
about the following objects of table
- domain – data elements – field definition – table definition

Q29) Lock Mechanism – prevents a new database operation being started an existing one has been correctly
completed. When conversion is done, lock is created automatically and released only when conversion is
successful. Clearing of locks –
Restart adjustment – attempt is made to continue conversion at the point of termination
cancel adjustment - lock entry is simply deleted from table.
Q)Revised version - produced when we edit an existing object
- active version - produced when we activate an object
- temporary version - produced when we copy the active version temporarily to the database with store
version functions
- Historical versions - created when 1. Correctuib us created 2 cirrectuib us Released

Q) Version Management functions –


- Canceling changes - reset revised version to active version
- Storing changes - active version will be temporarily stored in version

Q)Switching changes - switch between active and revised versions


Version catalog - list of all existing versions of an object

Q19)Table Buffering : Possible buffering types


- full buffering - either, whole table or none of the table is located in the buffer (Tables up to 30 kb done
in client dependent fully buffered tables)
- Generic buffering - generic areas of the table are fully buffered.
- Generic key - left justified section of primary key of a table.
- Generic area - all records for which fields of generic key correspond
Single record buffering - records actually being accessed are loaded to buffers, large records where few
records are accessed.
Q30)Types of internal tables?
STANDARD table Key access to a standard table uses a linear search. This means that the time required for a
search is in linear relation to the number of table entries.You should use index operations to access standard
tables.
********Internal linear index.
********The key is always non-unique.
******** key or index access of the table.
********Quick insertion into the table as system doesn’t verify whether there are already existing record.
SORTED table defines the table as one that is always saved correctly sorted. Key access to a sorted table uses a
binary key. If the key is not unique, the system takes the entry with the lowest index. The runtime required for
key access is logarithmically related to the number of table entries.
********Internal linear index.
********The key can be unique or non-unique.
******** key or index access of the table.
HASHED table defines the table as one that is managed with an internal hash procedure. You can only access a
hashed table using the generic key operations or other generic operations (SORT, LOOP, AND SO ON). Explicit
or implicit index operations (such as LOOP . . . FROM oe INSERT itab within a LOOP) are not allowed.
********No linear index.
********The key must be unique .
******** only key access as the system access the table entries using a hash algorithm.
INDEX tables A table that can be accessed using an index. Index table is only used to specify the type of generic
parameters in a FORM or FUNCTION. That means that you can’t create a table of type INDEX.
Standar tables and sorted tables are index tables.
Syntax :
DATA itab TYPE table type of line type [WITH UNIQUE/NON-UNIQUE KEY <key>] [Initial size n] [WITH
HEADER LINE.
Q31) What are DATA CLUSTERS ?
You can group any complex internal data objects of an ABAP/4 program together in data clusters and store
them temporarily in ABAP/4 memory or for longer periods in databases. You can store data clusters in
special databases of the ABAP/4 Dictionary. These databases are known as ABAP/4 cluster databases and
have a predefined structure. Although you can also access cluster databases using SQL statements, only
ABAP/4 statements are able to decode the structure of the stored data cluster.

Q32)Describe the functions of the debugger screen.


- Single step(F5) - Use this option to step through the program statement by statement. This allows you
to branch into subroutines and function modules, and to execute these routines step by step as well. Once a
subroutine or function module has been processed, control returns to the statement following the CALL
FUNCTION or PERFORM statement.
- Execute(F6) – Use this option to process a program line by line. All of the statements on the current line
are processed in a single step. If you are positioned on a line that calls a subroutine and you choose
Execute, the Debugger processes the whole subroutine and then moves on to the line following the
subroutine call. This allows you to jump through the statements within the subroutine.
- Return (F7) - The Debugger returns from a routine to the point at which control returns to the main
program. Use this option to return from a subroutine function module, or called program to the calling
program.
- Continue (F8) – Use this option to process the program up to the next dynamic or static breakpoint or up
to the cursor position. If there are no more breakpoints in the program and no cursor has been set, the
system exits debugging mode and executes the rest of the program normally.
- Tables – Display the contents of internal tables.

Q33)Problem : How to run a program in background?


Solution : Execute the Report a
In the selection screen: After filling the screen fields press F9
A screen appears requesting U to print the Background Parameters
*Enter the output device(Eg HPLJ / SAP2 etc)
*In the spool options uncheck Print immediately, uncheck delete after output, and new spool request.
Press enter.
Another screen appears with heading start time. You can press start immediately, then save
Now the Background job is scheduled for the given program.

Q34)To View the status of background Job, The transaction code is SM37.
Execute from the resulting screen. A Job overview --> From the Job list select U’r program and select spool
from the application tool bar a output Controller
:List of Spool Requests a Select U’ r Spool request and click display icon from the overview screen.
You can see the List.
Caution : See to that the list with does not exceed 255 columns. It it exceeds the extra columns will be
truncated in Background.

Q35)What are presentation and application servers in SAP?


A presentation server is actually a program named SAP GUI. Ex. It is usually installed on a user’s workstation.
Application server is a set of executables that collectively interpret the ABAP/4 programs and manage the
input & output for them.
Q36)In an ABAP/4 program how do you access data that exists on a presentation server v/s on an
application server?
For presentation server use UPLOAD or WS_UPLOAD function modules.
For application server use OPEN DATASET, READ DATASET and CLOSE DATASET commands.

Q37)Describe the syntax and function of the AUTHORITY CHECK command?


Ans: - AUTHORITY-CHECK OBJECT
ID<name1> FIELD <fl>
ID <name2> FIELD <f2>
IF SY – SUBRC NE O .
The AUTHORITY – CHECK checks whether a user has the appropriate authorization
to execute a particular activity.
Q38) Explain the EXPORT and IMPORT commands? How can you pass more than one group of data by
using IMPORT commands?

EXPORT :-
To read data objects from an ABAP program into ABAP memory, use the following statement :
Syntax
EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] . . . TO MEMORY ID <key>.

This statement stores the data objects specified in the list as a cluster in memory. If you do not use the
option FROM <f i>, the data object <f i> is saved under its own name. if you use the FROM <g i> option, the
data object <g i> is saved under the name <f i>. the name <key> identifies the cluster in memory. It ma be up
to 32 characters longg.The EXPORT statement always completely overwrites the contents of any existing data
cluster with the same name <key>.
IMPORT :-
To read data objects from ABAP memory into an ABAP program, use the following statement :
Syntax
IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] . . . FROM MEMORY ID <key>.

This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO
<g i> option, the data object <f i> in memory is assigned to the data object in the program with the same
name. if you do use the option, the data object <f i> is read from memory into the field <g i>. the name <key>
identifies the cluster in memory. It may be up to 32 characters king.
You do not have to read all of the objects stored under a particular name <key>. You can restrict the number
of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-
SUBRC is set to 4. if, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC
is always 0, regardless of whether it contained the data object <f i>. if the cluster does not contain the data
object <f i>, the target field remains unchanged.

Q39)Explain the READ LINE and MODIFY LINE commands.


READ LINE :- use the statements READ LINE and READ CURRENT LINE to read data from the lines of
existing list levels. These statements are closely connected to the HIDE technique.
MODIFY LINE :- To modify the lines of a completed list from within the program, use the MODIFY LINE
statement.

Q40)What are the differences between calling a program, transaction ‘with return’ and ‘without return’
and how can each be accomplished?
Program
-SUBMIT <rep> | {field>) [AND RETURN] [<options>]
if you use AND RETURN, the system stores the data of the calling executable program and returns to the
calling after processing the called program. The system resumes executing the calling program at the
statement following the call.
If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal
session) are deleted. After the called executable program has finished, control returns to the level from which
you started the calling program.

Transaction
-CALL TRANSACTION <tcod> [AND SKIP FIRST SCREEN]
[USING <itab>].
This statement saves the data of the calling program, and starts transaction <tcod>. At the end of the
transaction, the system returns to the statement following the call in the calling report.
-LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].
This statement ends the calling program and starts transaction <tcod>. This deletes the call stack (internal
sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from
which the original program in the call stack was started.
Q41) What are the differences between the parameter SET and GET?

SET PARAMETER ID <pid> FIELD <F>.


This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code
<pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement
overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter
object.
GET PARAMETER ID <pid> FIELD <f>.
This stament fills the value stored under the ID <pid> into the variable <f>. if the system does not find a value
for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.

Q42)WHAT are the commands that allow you to process sequential file? And what is their syntax?
. READ DATASET (reading) and TRANSFER (writing)
. OPEN DATASET <dataset name> for <input output appending > in <binary text> mode at
POSITION <position> MESSAGE <field>
. READ DATASET <dataset name > INTO <field>
. CLOSE DATASET <dataset name>
. DELETE DATASET <dataset name>
TRANSFER <field> to <dataset name>

Q43)What is the difference between opening a dataset for input, output, appending?

. FOR OUTPUT
Opens the file for writing if exists it is overwritten if not then it is created.
. FOR INPUT
Opens an existing file for reading.
. FOR APPENDING
Opens the file for writing at the end of the file. If it does not exist, it is
Created, if opened, you return to the end.
Q44)When an internal table is created, the settings criteria for the value of occurs?

The objective of setting the value of an occurs for an internal table is a question of optimization. The following
facts should be taken into account when making such decision.
1) The complete data area of a program is 64000 bytes.
2) The initial size declared is kept in roll area (quicker access to program)
3) Data entered that exceeds the initial size stores in the roll file (Slower access to program)
4) You should also analyze the expected volume and access rates before making the decision.

Q45) Define "check" statements how it works?

To terminate a single loop pass conditionally, use the CHECK <condition> statement in the
statement block of the loop.
If the condition is not true, any remaining statements in the current statement block after the
CHECK statement are ignored, and the next loop pass starts.
<condition> can be any logical _ expression.

Q46) Explain Field Group (extract dataset)?

An extract dataset consists of a sequence of records. These records may have different
structures. All records with the same structure form a record type. You must define each
record type of an extract dataset as a field group, using the FIELD-GROUPS statement.
FIELD - GROUPS <fg>.
This statement defines a field group <fg>. A field group combines several fields under one
name. For clarity, you should declare your field groups at the end of the declaration part of
your program.
A field group does not reserve storage space for the fields, but contains pointers to existing
fields. When filling the extract dataset with records, these pointers determine the contents of
the stored records.

Q42)What is the difference between Move & assign statement?

Move :- To assign the value of a data object <fl> to a variable < f2 >, use the following
statement:
MOVE < f1 > TO < f2 >.
or the equivalent statement
< f2 > = < f1 >.
The contents of < f1 > remain unchanged. < f1 > does not have to be a variable - it can also
be a literal, a text symbol, or a constant. You must always specify decimal points with a period
(.), regardless of the user's personal settings.
Multiple value assignments in the form
< f4 > = < f3 > = <f2 > = < f1 > .

Assign :- ASSIGN < f > TO < FS >.


When you assign the data object, the system checks whether the technical attributes of the
data object < f > correspond to any type specifications for the field symbol < FS >. The field
symbol adopts any generic attributes of < f > that are not contained in its own type
specification. Following the assignment, it points to < f > in memory.

Q43)How do you run a report for a row in table ?


Using Graphics Multiplexer. There is an option some thing similar to screen capture which
captures data only. Using that data you can draw graphs (3D and 2D). This option is
available all the time from Menu ! -> Generate Graphics which captures the data then you
need to drag and select the data you want to draw a graph on. Once you select you can click
on Graphics, which launches graphics multiplexer .

Q44) Describe Memory Management?


SAP memory (Global Memory) :- is available to a user during the entire duration of a terminal
session. Its contents are retained across transaction boundaries as well as external and
internal sessions.

External session :- When user logs on to R/3 system, the system creates a new terminal
session called external session. E.g. System a Create Session.
Internal session :- created by calling a transaction (with CALL TRANSACTION), a dialog
module (with CALL DIALOG) or a report (with SUBMIT or RETURN).
For external session :- internal sessions are allowed
Roll area :- Data areas of used programs are created in roll areas for each internal session.
Posting data between internal sessions: -
EXPORT TO MEMORY and IMPORT FROM MEMORY.
Main program group :- Created when exporting an internal session.
Additional program group :- If a function module belonging to a function group not so far
loaded, additional program group is created.
Subroutine call:- When external subroutine is called system loads the relevant program and
adds it to the program group of calling program.
Work areas :- Both table & common work areas with the same name are created once for each
program group and then shared by all programs in the group.
List system :- Consists of basic list and all details list belonging to basic list assigned to exactly
one screen level.
User interface :- Only program has its own user interface. Internal sessions interface is initially
empty. Special user interface has to be activated using SET PF-STATUS statement.
ABAP/4 memory :- Retained only during the lifetime of an external session.
Data cluster :- Group of several data objects.
Data objects :- Units of data, which a program processes at runtime.

Q45)How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the
same from memory to program.
EXPORT <f1> [FROM <g1>] <f2> [FROM <g2>] . . . TO MEMORY ID <key>].
The ID <key>, which can be up to 32 characters long, identifies the data in memory.

Statement used to delete data objects in ABAP/4 memory.


FREE MEMORY [ID <key>].

Q46) How will you create a file on application server


Open dataset <dsn> for output.
ABAP/4 statement for opening a file on application server for reading?
Open dataset <dsn> for input.

Q47)How will you transfer data into a file in application server ?


Data fname (60) value 'myfile'.
Data num type i.
Open dataset fname for output.
Do 10 times.
Num = Num + 1.
Transfer num to fname.
Enddo.

Q48)Name the function modules to write data from an internal table to the Presentation Server.
DOWNLOAD and WS_DOWNLOAD.

Q49)Name the function modules to read data from Presentation Server into an Internal Table.
UPLOAD and WS_UPLOAD.

Q50)Name the function module that can be used to give information about files on Presentation
Server and about it's Operating System.
WS_QUERY.

Q51)Name the ABAP/4 key work searching a string in an Internal Table.


SEARCH <ITAB > for < str > < options >.

Q52) How would you find the attributes of a data type or data object ?
DESCRIBE FIELD <f> [LENGTH <1>] [TYPE <t> [COMPONENTS <n>]]
[OUTPUT - LENGTH <o>] [DECIMALS <d>]
[EDIT MASK <m>].

Q53)Which function module would you use to check the user's authorization to access files
before opening a file ?
AUTHORITY_CHECK_DATASET

Q54)Name the function module used to convert logical file names to physical file names in
ABAP/4 programs.
FILE_GET_NAME.

Q55)What does CHAIN. . . . . END CHAIN do?


Sometimes you want to check several fields as a group. To do this, include the fields in a
FIELD statement, and enclose everything in a CHAIN_ENDCHAIN block.

Example
* * * * Screen flow logic: * * * *
CHAIN.
FIELD : SPFLI - CARRID, SPFLI-CONNID.
MODULE CHECK_FLIGHT.
ENDCHAIN.
Q56)Have you used SAP supplied programs to load master data?
- SAP supplied BDC programs - RMO6BBI0 (Purchase requisitions)
- RMDATIND (Material master) RFBIKR00 (Vendor Masters)
- RFBIDE00 (Customer Master) RVINVB00 (Sales Order)

Q57)What are the Techniques involved in using SAP supplied programs ? Do you prefer to write
your own programs to load master data? Why?
- Identify relevant fields
- Maintain transfer structure (Predefined - first one is always session record)
- Session record structure, Header Data, Item (STPE - record type)
- Fields in session structure - STYPE, GROUP, MANDT, USERNAME, NO DATA
- Fields in header structure - consists of transaction code also - STYPE, BMM00,
TCODE, MATNR and Fields in Item
ITEMS
- Maintain transfer file - sample data set creation.
Q58)How do you set up background jobs in SAP? What are the steps? What are events driven
batch jobs?
- Create a job using function module JOB-OPEN
- Collect the job specifications.
- Add a job step to the job with the function module JOB-SUBMIT.
- Close the job and pass it to Background processing system for execution with the
function module JOB-CLOSE
- EVENT DRIVEN BATCH JOBS : -
- Types = System events - triggered when activation of new operation mode takes place
- User events - Triggered from ABAP/4 or external program.
- Triggering an event notifies the background processing that named condition has
been reached. The Background system reacts by starting any jobs that were waiting for the
event.
When an error is found inside a chain, the screen is re-displayed, and all fields found
anywhere in the chain are input-enabled. All non-chain fields remain disabled.

Q59)What does an extract statement do in the ABAP program?


Fills the fields groups with values.

Q60)What happens when a table is activated in DD?


- A table definition is generated
- Map to the database system
- For each table, a table of the same name with the same fields and corresponding data type
is created in database.
-Primary index is generated automatically

Q61)What is a check table and what is a value table?


- When we define a foreign key in a table (A). If this key refers to primary key of another table
(B). Table B is check table.
Fields referring to a domain may assume values contained in the corresponding fields of the
value table. Field referring to the domain should have a foreign key.

Q62) What is CTS and What do you know about it? [CTS is Correction and Transport Systems]
- Correction system manages the internal system components like objects like only
original version of the object exists. It stores all changes made to the object.
- Transport system allows to transports the object from on SAP system to another
(Development system to Production system). It allows to over write or delete existing object in
target system and import new objects to target systems.
During development work we start by opening a task (correction) to which we can assign new
and changed objects. Once changes have been made, transport new or changed objects to
other SAP system by means of transport (Change) request.

Q63) How To read an SPA/GPA parameter into an ABAP program?


Use: Syntax
GET PARAMETER ID <pid> FIELD <f>.

Q64)What is the difference between Commit-Work and Rollback-Work tasks ?


- Commit-Work statement "performs" many functions relevant to synchronized execution
of tasks.
- Rollback-Work statement "cancels" all requests relevant to synchronized execution of
tasks.
Q65) What are the different database integrities?
- Semantic integrity
- Relational integrity
- Primary key integrity
- Value set integrity
- Foreign key integrity and
- Operational integrity.

Q66)What is SAP locking ?


- It is a mechanism for defining and applying logical locks to database objects.
Q67)What does a lock object involve ?
- The tables
- The lock argument.
Q68)What are the different kinds of lock modes ?
- Shared lock
- Exclusive lock
- Extended exclusive list.
Q69)How can a lock object be called in the transaction ?
- By calling Enqueue < lock object > and Dequeue < lock object > in the transaction.

Q)What are the events by which we can program "help texts" and display "possible values
lists" ?
- PROCESS ON HELP-REQUEST (POH)
- PROCESS ON VALUE - REQUEST (POV).

Q70)what are function modules ? Types of parameters?


Transaction codes related to background jobs creation and processing are :-
SM36 (Job creation)
SM37 (Job selection and execution).
Q71)What are presentation and application servers in SAP?
- A presentation server is actually a program named Sapgui.exe. It is usually installed on
a user's workstation.
- Application server is a set of executable programs that collectively interpret the ABAP/4
programs and manage the input & output for them.

Q72)In an ABAP/4 program how do you access data that exists on a presentation server v/s on
an application server ?
- For presentation server use UPLOAD or WS_UPLOAD function modules.
- For application server use OPEN DATASET, READ DATASET and CLOSE DATASET
commands.

Q73)What is the difference between Synchronous and Asynchronous updates ?


- A program asks the system to perform a certain task, and then either waits or doesn't
wait for the task to finish. In synchronous processing, the program waits : control returns to
the program only when the task has been completed. In asynchronous processing, the
program does not wait : the system returns control after merely logging the request for
execution.

Q74)What is the difference between a pool table and a transparent table ?


Transparent Table :
A transparent table has a one to one relationship in the database. The table in the dictionary
has the same name, same no of fields, and the fields have the name as in the R3 table defn.
A transparent table has application data (Master and Transaction).

Pooled Table :
A pool table has many to one relation with the table in the database. For one table in the
database there are many tables in the dictionary. The table in the database has a different
name than in the table in the data dictionary, it has different no of fields and field names are
different. A pooled table is stored in the pool at the database level. A table pool is a
database table with a special structure that enables the data of many R3 tables to be stored in
it. It can hold only pooled tables.

Q75)What are field symbols and field groups? Have you used component idx of structure with
field groups ?
A field symbol does not physically reserve space for a field, but points to a field which is not
known until runtime of the program. Field symbols are comparable to the concept of pointers
as used in programming language C.
An extract dataset consists of a sequence of records. These records may have different
structures. All records with the same structure form a record type. You must define each
record type of an extract dataset as afield group, using the FIELD-GROUPS statement.

Q76)What is the step by step process to create a table in data dictionary?


1. Selecting the table fields
2. Maintaining foreign keys
3. Creating secondary indexes (optional)
4. Maintaining technical settings
5. Activating a table
Q77)What is the advantage of structures and how you use them in ABAP/4 programs?
A structure is defined in the ABAP/4 Dictionary like a table and can be accessed from ABAP/4
programs. Any change to the definition of the structure in the ABAP/4 Dictionary is
automatically implemented in all programs.
While data in tables is stored permanently in the database, structures contain data only during
the runtime of a program.

Structures are used in ABAP/4 programs to transfer data between programs as it is globally
defined. Structures are used in particular for defining data at the interface between module
pools and screens and for standardizing parameters for function modules.

Q78)What does an extract statement do in the ABAP/4 program ?


With the first EXTRACT statement of a report, the system creates the extract dataset and adds
the first extract record. With each subsequent EXTRACT statement, the system adds another
extract record to the extract dataset.

Q79)What is collect statement and how is it different from the append statement?
To fill an internal table with lines which have unique standard keys, we use the COLLECT
statement.
If an entry with the same key already exists, the COLLECT statement does not append a new
line as APPEND statement, but adds the contents of the numeric fields in the work area to the
contents of the numeric fields in the existing entry.
Q80)What is an open SQL vs Native SQL?
Open SQL allows you to access all database tables known to the SAP system, regardless of
the database manufacturer. Sometimes, however, we may want to use database-specific SQL
statements called Native SQL in your ABAP/4 program.
To avoid incompatibilities between different database enables and also to make ABAP/4
programs independent of the database system in use, SAP has created a set of activate SQL
statements called Open SQL. Open SQL contains a subset of standard SQL statements as
some enhancements which are specific to SAP.
A database interface translates SAP's Open SQL statements into SQL commands specific to
the database in use. Native SQL statements access the database directly.

Q81)What does an EXEC SQL statement do in ABAP? What is the disadvantage of using it ?
To use a Native SQL statement, it must be preceded by an EXEC SQL statement and
concluded by an ENDEXEC statement.
An ABAP/4 program with Native SQL statements does not generally run with different
databases.

Q82)What are the events used in ABAP/4?


The events are :
- INITIALIZATION
- AT SELECTION-SCREEN
- AT SELECTION - SCREEN ON <field>
- START - OF - SELECTION
- TOP - OF - PAGE
- TOP - OF - PAGE DURING LINE SELECTION
- END - OF - PAGE
- END - OF - SELECTION
- AT USER - COMMAND
- AT LINE - SELECTION
- AT PF<NN>
- GET
- GET LATE
- AT USER COMMAND

Q83)What is an interactive reports? What is the obvious difference of such reports with HTML
type reports ?
Interactive reporting allows the user to participate actively in retrieving and presenting data
during the session. Instead of one extensive and detailed list, with interactive reporting you
create a condensed basic list from which the user can call detailed information by positioning
the cursor and entering commands. Interactive reporting thus reduces information retrieval to
the data actually required. Detailed information is presented in secondary lists. A secondary
list may either overlay the basic list completely or appear in an additional dialog window on the
same screen. The secondary list can itself be interactive again.
Apart from creating secondary lists, interactive reporting also allows to call transactions or
other reports from lists. These programs then use values displayed in the list as input values.
The user can, for example, call a transaction from within a list to change the database table
whose data is displayed in the list.

Q84)What happens when a table is activated in DD?


When the table is activated, a physical table definition in the database is added to the table
definition stored in the ABAP/4 Dictionary. The database-independent table definition from
the ABAP/4 Dictionary is translated into a definition of the relevant database.
Q85)What is a check table and what is a value table?
The relational data model contains not only tables, but also relationships are defined in the
ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data
integrity in the relational data model. Foreign key fields may assume only those values
allowed by the check table, in other works, values occuring in the primary key of the check
table. A foreign key provides a link between two tables, for eg. T1 and T2 by including a
reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields
assigned to the primary key fields of T2 are included in T1. The T1, which is the one being
checked, is called a foeign key table, and table T2 are included in T1. Table T1, which is the
one being checked, is called a foreign key table, and table T2 is called a check table. The
terms dependent (foreign key) table and referenced (check) table are also used.

VALUE TABLE :
If the domain of the check field has a value table, this is proposed by the system as check
table in the foreign field maintenance. The key fields of the value table are in this case
assigned fields of the foreign key table with the same domain. These fields may assume only
those values allowed.

Q86) Explain Window and Page in SAP Script?

WINDOW sets the values for the width and height to the values of the current window (default
setting).

PAGE sets the values for the width and height to the values of the current output page.

Q87) Calling a form from SapScript (* * * * * )

/ : DEFINE & CUST& = '00000021'.


/ : PERFORM GET _ NAME IN PROGRAM Z _ BC460 _ EX4 _ HF
/ : USING &CUST&
/ : CHANGING &NAME&
/ : ENDPERFORM.

Dear &NAME&

The ABAP routine could be defined as follows :

IMPORTANT : The structure itcsy must be used for the parameters.


REPORT Z _ HENRIKF _ SCRIPT _ FORM.
TABLES SCUSTOM.
Form get_name tables in_tab structure itcsy
out_tab structure itcsy.

Read table in_tab index 1

Select single * from scustom


Where id = in_tab-value.

if sy-subrc = 0
read table out _tab index 1.
move scustom-name to out_tab-value.
modify out_tab index sy-tabix.
else.
read table out_tab index 1.
move 'No name' to out_tab-value.
modify out_tab index sy-tabix.
endif.

* * You could also fill the output parameter table this way
READ TABLE out_par WITH KEY 'NAME1'.
out_par-value = 1_namel.

MODIFY out_par INDEX sy-tabix.

endform.

Note that if you use more than one parameter you must use Using or Changing before every
parameter !
/ : PERFORM <FORM> IN PROGRAM <PROG>
/ : USING &INVAR1&
/ : USING &INVAR2&
.......
/ : CHANGING &OUTVAR1&
/ : CHANGING &OUTVAR2&
......
/ : ENDPERFORM

Q88)Structure of a print program

The print program is used to print forms. The program retrieves the necessary data from
database tables, defines the order of in which text elements are printed, chooses a form for
printing and selects an output device and print options.

Open form printing - Must be called before working with any of the other form function modules.
Call function 'OPEN _ FORM' . . . . .
Must be ended with function module CLOSE FORM

*To begin several identical forms containing different data within a single spool request, begin
each form using START_FORM, and end it using END_FORM call function 'START_FORM'. . .
.

Write text elements to a window of the form


call function "WRITE _FORM' . . . . .

Ends form
call function 'END _ FORM' . . . .

Closes for printing


call function 'CLOSE_FORM'. . . . .

Examples of function calls

OPEN FORM

CALL FUNCTION 'OPEN_FORM'


EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
DEVICE = ' PRINTER '
DIALOG ='X'
* FORM =' '
* LANGUAGE = SY-LANGU
OPTIONS = OPTIONS
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE ='*'
IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS =
CANCELED =1
DEVICE =2
FORM =3
OPTIONS =4

UNCLOSED =5
MAIL_OPTIONS =6
ARCHIVE_ERROR =7
INVALID_FAX _NUMBER =8
MORE_PARAMS_NEEDED_IN_BATCH= 9
OTHERS = 10

START_FORM

CALL FUNCTION ' START_FORM '


EXPORTING
* ARCHIVE_INDEX =
FORM = ' MY_FORM '

* LANGUAGE =' '


* STARTPAGE =' '
* PROGRAM =' '
MAIL_APPL_OBJECT =
IMPORTING
* LANGUAGE =
EXCEPTIONS
FORM =1
FORMAT =2
UNENDED =3
UNOPENED =4
UNUSED =5
OTHERS =6

WRITE_FORM

See 'WRITE_FORM'

END_FORM

CALL FUNCTION ' END_FORM '


IMPORTING
* RESULT =
EXCEPTIONS
* UNOPENED =1
BAD_PAGEFORMAT_FOR_PRINT =2
OTHERS =3

CLOSE_FORM

Structure for Print options (return values) - Pages selected for printing, Number of copies etc.

DATA BEGIN OF RESULT.


INCLUDE STRUCTURE ITCP2.
DATA END OF RESULT.

CALL FUNCTION ' CLOSE_ FORM'


IMPORTING
RESULT = RESULT

* RDI_RESULT =
TABLES
* OTFDATA =
EXCEPTIONS
* UNOPENED =1
BAD _ PAGEFORMAT _ FOR _ PRINT =2
* SEND _ ERROR =3
* OTHERS = 4.

Q89)CONTROL_FORM - Calling Commands Using a program

The function module CONTROL _ FORM can be used to create SapScript control statements
from within an ABAP program.

Example :

call function ' CONTROL_FORM '


EXPORTING
COMMAND = 'PROTECT '.

call function 'WRITE _ FORM ' . . . . . . . . . . . . . .

call function ' CONTROL_FORM '


EXPORTING
COMMAND = ' ENDPROTECT '.

Q90) What are Styles?


Styles are used to predefine paragraph and character formate for forms. SAP provides
several standard styles eg. For address includes, on - line documentation and so on. You can
define your own styles.
To find styles, create styles and maintains styles, use transaction SE72.
You assign style to a text by using menu Format - > style
You can make temporary style changes using the control command / : STYLE

Q91)How to Use graphics in Sap Script?

Use transaction SE78 to import graphics to SAP.

In the form painter, you can either include directly to the form using menu Edit - > Graphic - >
Create or using the INCLUDE statement in a window.
To use an INCLUDE statement, goto into the window script editor and use menu Include - >
Graphic. The include can look like this for a bitmap :

/ : BITMAP MYLOGO OBJECT GRAPHICS ID BMAP TYPE BMON

Q92) Modifications in SAP Scripts


Considerations in connection with modifications

The standard SAP print program should only be changed when it is absolutely necessary. If
additional data is needed, these can in many cases be retrieved using a PERFORM
statement in the form instead of changing the print program.

There can be the following reasons to change the print program :

Structural changes
New text elements are needed
Print program to be used to print additional forms.

Determine / change which forms and print programs that are used for printing

The forms and print programs for a given output type and application can be found in table
TNAPR Processing programs for output.

Use view V _ TNAPR in ( Transaction SE30 ) to change entries.

Import / Export Sap Script form from PC file


Use ABAP program : RSTXSCRP

SD - Finding the name of the print program

For SD documents you can use table TNAPR top find the name of the printprogram

Transactions :
S transaction is a program that conducts a dialog with the user. In a typical dialog, the system
displays a screen on which the user can enter or request information. Based on the user
input or request, the program executes the appropriate actions like, it branches to the next
screen, displays an output, or changes the database.
Q93)Explain what is a transaction in SAP terminology.
- In SAP terminology, a transaction is series of logically connected dialog steps.

Q94)Explain how SAP GUI handles output screen for the user.

- User terminal input is accepted by SAP GUI and sent to the SAP displatcher. The
dispatcher co - ordinates the information exchange between the SAP GUIs and the work
processes. The dispatcher first places the processing request in request queues, which it
then processes. The dispatcher dispatches the requests to the available work process. The
actual processing takes place in the work process. When processing takes place in the work
process. When processing takes place in the work process. When processing is complete,
the result of a work process is returned via the dispatcher to the SAP GUI. The GUI interprets
the received data and generates the output screen for the user.

Q95)What is LUW or Database LUW or Database Transaction ?


- A "LUW" ( logical unit of work ) is the span of time during which any database updates
must be performed. Either they are all performed (committed ), or they are all thrown away
(rolled back ).

LUW (or " database LUW " or " database transaction " )
This is the set of updates terminated by a database commit. A LUW lasts, at most, from one
screen change to the next ( because the SAP system triggers database commits automatically
at every screen change ).

LUW help to guarantee database integrity. When an LUW has been successfully concluded,
the database is once again in a correct state. If, however, an error occurs within an LUW, all
database changes made since the beginning of the LUW are cancelled and the database is
then in the same state as before the LUW started.

A LUW begins

- Each time you start a transaction


- When the database changes of the previous LUW have been confirmed ( database
commit ) or
- when the database changes of the previous LUW have been cancelled ( database
rollback )

A LUW ends

- When the database changes have been confirmed (database commit) or


- When the database changes have been cancelled (database rollback)

Q95)What is SAP LUW or Update Transaction ?


- Update transaction ( or "SAP LUW " )
This is a set of updates terminated by an ABAP/4 commit. A SAP LUW may last much longer
than a database LUW, since most update processing extends over multiple transaction
screens. The programmer terminates an update transaction by issuing a COMMIT WORK
statement.

Q96)Does the external program run in the same SAP LUW as the caller, or in a separate one ?
- Transactions run with a separate SAP LUW
- Reports run with a separate SAP LUW
- Dialog modules run in the same SAP LUW as the caller
- Function modules run in the same SAP LUW as the caller

The only exceptions to the above rules are function modules called with IN UPDATE TASK (V2
function only ) or IN BACKGROUND TASK (ALE applications). These always run in their own
(separate ) update transactions.

Q97)What are the requirements a dialog program must fulfil?


- A dialog program must fulfil the following requirements
. A user friendly user interface
. Format and consistency checks for the data entered by the user
. Easy correction of input errors
. Access to data by storing it in the database.

Q98)What are the basic components of dialog program ?


- Screens (Dynpros )
Each dialog in an SAP system is controlled by dynpros. A dynpro consists of a screen and its
flow logic and controls exactly one dialog step.
- ABAP/4 module pool
Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also
called a module pool, since it consists of interactive modules.

Q99)What is a dynpro ? What are its components ?


- A dynpro (DYNamic PROgram) consists of a screen and its flow logic and controls
exactly one dialog step.
- The different components of the dynpro are :
Flow logic : Calls of the ABAP/4 modules for a screen
Screen layout : Positions of the texts, fields, push buttons, and so on for a screen
Screen attributes : Number of the screen, number of the subsequent screen, and others
Field attributes : Definition of the attributes of the individual fields on a screen.

Q100)What is screen flow logic ? What are the selctions in it ? Explain PAI and PBO >

Ans - Screen flow logic contains the procedural part of screen. The screen flow logic is like an
ABAP program in that it serves as a container for processing blocks. There are four event
blocks, each of which is introduced with the screen keywork
PROCESS :
....
PROCESS BEFORE OUTPUT.
...
PROCESS AFTER INPUT.
...
PROCESS ON HELP-REQUEST.
...
PROCESS ON VALUE-REQUEST.

Selections are performed in PAI.PROCESS BEFORE OUTPUT ( pbo ) is automatically


triggered after the PAI processing of the previous screen and before the current screen is
displayed. You can program the PBO processing of the screen in this block. At the end of the
PBO processing, the screen is displayed.

PROCESS AFTER INPUT ( PAI ) is triggered when the user chooses a function on the screen.
You can program the PAI processing of the screen in this block. At the end of the PAI.

Processing, the system either calls the next screen or carries on processing at the point from
which the screen was called.

PROCESS ON HELP - REQUEST (POH) and PROCESS ON VALUE - REQUEST ( POV ) are
triggered when the user requests field help (F1) or possible values help ( F4) respectively.
You can program the appropriate coding in the corresponding event blocks. At the end of
processing, the system carries on processing the current screen.

Q100)Can we use WRITE statement in screen fields ? If not how is data transferred from field
data to screen fields
- We cannot write field data to the screen using the WRITE statement. The system
instead transfers data by comparing screen field names with ABAP/4 variable names. If both
names are the same, it transfers screen field values to ABAP/4 program fields and vice-versa.
This happens immediately before and immediately after displaying the screen.

Q101)How does the interaction between the Dynpro and the ABAP/4 modules takes place ?
- A transaction is a collection of screens and ABAP/4 routines, controlled and executed by
a Dialog processor. The dialog processor processes screen after screen, thereby triggering
the appropriate ABAP/4 processing for each screen. For each screen, the system executes
the flow logic that contains the corresponding ABAP/4 processing. The control passes from
screen flow logic to ABAP/4 code and back.

Q102)How does the Dialog handle user requests ?


- When an action is performed, the system triggers the PROCESS AFTER INPUT event.
The data passed includes field screen data entered by the user and a function code. A
function code is technical name that been allocated in the Screen Painter or Menu Painter to a
menu entry, a pushbutton, the ENTER key or a function key of a screen. An internal work field
(ok-code) in the PAI module evaluates the function code, and the appropriate action is take.

Q103)How are the function codes handled in flow logic ?


- When the user selects a function in a transaction, the system copies the function code
into a specially designated work field called OK_CODE, This field is global in the ABAP/4
module pool. The OK_CODE can then be evaluated in the corresponding PAI module. The
function code is always passed in exactly the same way, regardless of whether it comes from a
screen's pushbutton, a menu option, function key or other GUI element.

Q104)What controls the screen flow ?


- THE SET SCREEN and LEAVE SCREEN statements control screen flow.

Q105)What are "field" and "chain" statements ?


- The FIELD and CHAIN flow logic statements let you program your own field checks.
FIELD and CHAIN tell the system which fields you are checking, and whether the system
should perform checks in the flow logic or call an ABAP/4 module.

Q106)What is an on "*-input field" statement ?


- ON*-INPUT
The ABAP/4 module is called if the user has entered a "*" in the first character of the field, and
the field has the attribute *-entry in the Screen Painter. You can use this option in exceptional
cases where you want to check only fields with certain kinds of input.

Q107)What are conditional chain statements ?


- ON CHAIN-INPUT similar to ON INPUT.
The ABAP/4 module is called if any one of the fields in the chain contains a value other than
its initial value (blanks or nulls).
Functions just like ON REQUEST, is called if any one of the fields in changes value

Q108)What is "at exit-command" ?


- The flow logic keyword AT EXIT-COMMAND is a special addition to the MODULE
statement in the flow logic. ATEXIT-COMMAND lets you call a module before the system
the automatic field checks.

Q109) Function type has to be used for using "at EXIT-COMMAND" ?


- To use AT EXIT-COMMAND, we must assign a function 'X' to the relevant function in the
Menu Painter or Screen Painter.

Q110)What is the difference between SET SCREEN and CALL SCREEN ?


With SET SCREEN, the current screen simply specifies the next screen in the chain. Control
branches to this next screen as soon as the current screen has been processed. Return from
next screen to current screen is not automatic. It does not interrupt processing of the current
screen. If we want to branch to the next screen without finishing the current one, use LEAVE
SCREEN.

With CALL SCREEN, the current (calling) chain is suspended, and a next screen (or screen
chain) is called in. The called screen can then return to the suspended chain with the
statement LEAVE SCREEN to SCREEN 0. Sometimes we might want to let an user call a pop
up screen from the main application screen to let them enter secondary information. After
they have completed their entries, the users should be able to close the pop up and return
directly to the place where they left off in teh main screen. Here comes CALL SCREEN into
picture. This statement lets us insert such a sequence into the current one.

Q111)Can we specify the next-screen number with a variable.


( Yes / No ).
Yes.

Q112)The field SY-DYBBR refers to ____________________.


Number or the current screen.

Q113)What is a dialog module ?


A dialog module is callable sequence of screens that does not belong to a particular
transaction. Dialog modules have their own module pools, and can be called by any
transaction.

Q114)The syntax used to call a screen as a dialog box (pop up) is ______________________.
CALL SCREEN < screen number >
STARTING AT <start column > <start line >
ENDING AT < end column > < end line >.

Q115)What is a "call mode "?


In the ABAP/4 world, each stackable sequence of screens is a "call mode". This is important
because of the way you return from a given current sequence. To terminate a call mode and
return to a suspended chain, set the "next screen" to 0 and leave to it :
LEAVE TO SCREEN 0 or ( SET SCREEN 0 and LEAVE SCREEN ). When you return to the
suspended chain, execution resumes with the statement directly following the original CALL
SCREEN statement. The original sequence of screens in a transaction is itself is a calling
mode. If you LEAVE TO SCREEN 0 in this sequence ( that is, without having stacked any
additional call modes ), you return from the transaction altogether

Q116)The maximum number of calling modes stacked at one time is __________.


Nine.

Q117)What is LUW or Database LUW or Database Transaction ?


A "LUW" (logical unit of work ) is the span of time during which any database updates must be
performed in an "all or nothing" manner. Either they are all performed (committed ), or they
are all thrown away (rolled back ). In the ABAP/4 world, LUWs and transactions can have
several meanings :
LUW ( or "database LUW " or "database transaction" ). This is the set of updates terminated
by a database commit. A LUW lasts, at most, from one screen change to the next (because
the SAP system triggers database commits automatically at every screen change ).

Q118)What is SAP LUW or Update Transaction ?


Update transaction ( or "SAP LUW ")
This is a set of updates terminate by an ABAP/4 commit. A SAP LUW may last much longer
than a database LUW, since most update processing extends over multiple transaction
screens. The programmer terminates an update transaction by issuing a COMMIT WORK
statement.

Q119)What happens if only one of the commands SET SCREEN and LEAVE SCREEN is used
without using the other ?
If we use SET SCREEN without LEAVE SCREEN, the program finishes processing for the
current screen before branching to < <screen no >. If we use LEAVE SCREEN without a
SET SCREEN before it, the current screen process will be terminated and branch directly to
the screen specified as the default next-screen in the screen attributes.
Q120)What is significance of the screen number '0' ?
In "calling mode", the special screen number 0 (LEAVE TO SCREEN) causes the system to
jump back to the previous call level. That is, if you have called a screen sequence with CALL
SCREEN leaving to screen 0 terminates the sequence and returns to the calling screen. If
you have not called a screen sequence, LEAVE TO SCREEN 0 terminates the transaction.

Q121)What does the command 'SUPPRESS DIALOG' do ?


Suppressing of entire screens is possible with this command. This command allows us to
perform screen processing "in the background". Suppressing screens is useful when we are
branching to list-mode from a transaction dialog step.

Q122)What is the significance of the memory table 'SCREEN' ?


At runtime, attributes for each screen field are stored in the memory table called 'SCREEN'.
We need not declare this table in our program. The system maintains the table for us
internally and updates it with every screen change.

Q123)What are the fields in the memory table 'SCREEN' ?


- Name Length Description

Q124)Why grouping of fields is required ? What is the maximum number of modification groups for
each field ?
- If the same attributes need to be changed for several fields at the same time these fields
can be grouped together. We can specify up to four modification groups for each field.

Q125)What is a screen group ? How it is useful ?


Screen group is a field in the Screen Attributes of a screen. Here we can define a string of up
to four characters which is available at the screen runtime in the SY-DNGR field. Rather than
maintaining field selection separately for each screen of a program, we can combine logically
associated screens together in a screen group.

Q126)What is a Sub screen ? How can we use a Sub screen ?


A sub screen is an independent screen that is displayed in an area of another ("main")
screen. To use a sub screen we must call it in the flow logic (both PBO and PAI ) of the main
screen. The CALL SUBSCREEN statement tells the system to execute the PBO and PAI
events for the sub screen as part of the PBO or PAI events of the main screen. The flow logic
of your main program should look as follows :
PROCESS BEFORE OUTPUT.
CALL SUBSCREEN < area > INCLUDING ' < program > '
' <screen > '
PROCESS AFTER INPUT.
CALL SUBSCREEN < area > .
Area is the name of the sub screen area you defined in your main screen. This name can
have up to ten characters. Program is the name of the program to which the sub screen
belongs and screen is the sub screen's number.

Q127)What are the restrictions on Sub screens ?


Sub screens have several restrictions. They cannot :
Set their own GUI status
Have a named OK code
Call another screen
Contain an AT EXIT-COMMAND module
Support positioning of the cursor

Q128)How can we use / display table data in a screen ?


ABAP/4 offers two mechanisms for displaying and using table data in a screen. These
mechanisms are TABLE CONTROLS and STEP LOOPS.

Q129)Why do we need to code a LOOP statement in both the PBO and PAI events for each table
in the screen ?
We need to code a LOOP statement in both PBO and PAI events for each table in the screen.
This is because the LOOP statement causes the screen fields to be copied back and forth
between the ABAP/4 program and the screen field. For this reason, at least an empty LOOP .
. . . ENDLOOP must be there.

Q130)What are the differences between TABLE CONTROLS and STEP LOOPS ?
- TABLE CONTROLS are simply enhanced STEP LOOPS that display data with the look
and feel of a table widget in a desktop application. But from a programming standpoint,
TABLE CONTROLS and STEP LOOPS are almost exactly the same . One major difference
between STEP LOOPS and TABLE CONTROLS is in STEP LOOPS their table rows can span
more than one line on the screen. By contrast the rows in a TABLE CONTROLS are always
single lines, but can be very long. (Table control rows are scrollable ). The structure of table
controls is different from step loops. A step loop, as a screen object, is simply a series of field
rows that appear as a repeating block. A table control, as a screen object consists of : i) table
fields (displayed in the screen) ii) a control structure that governs the table display and what
the user can do with it.

Q131)The field SY-STEPL refers to ___________________________________.


The index of the screen table row that is currently being processed. The system variable
SY-STEPL only has a meaning within the confines of LOOP . . . ENDLOOP processing.
Outside the loop, it has no valid value.

Q132)How can we declare a table control in the ABAP/4 program ?


Using the syntax controls < table control name > type table view using screen < screen no >.

Q133) Differentiate between static and dynamic step loops.


Step loops fall into two classes : Static and Dynamic.
Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are
variable in size. If the user re-sizes the window the system automatically increases or
decreases the number of step loops blocks displayed. In any given screen you can define any
number of static step loops but only a single dynamic one.

Q134)What are the two ways of producing a list within a transaction ?


By submitting a separate report.
By using leave to list-processing.

Q135)What is the use of the statement Leave to list-processing ?


Leave to list-processing statement is used to produce a list from a module pool. Leave to
list-processing statement allows to switch from dialog-mode to list-mode within a dialog
program.

Q136)When will the current screen processing terminates ?


A current screen processing terminates when control reaches either a Leave-screen or the
end of PAI.

Q137)How is the command Suppress-Dialog useful ?


Suppressing entire screens is possible using this command. This command allows us to
perform screen processing "in the background". The system carries out all PBO and PAI logic,
but does not display the screen to the user. Suppressing screens is useful when we are
branching to list-mode from a transaction dialog step.

Q138)What happens if we use Leave to list-processing without using Suppress-Dialog ?


If we don't use Suppress-Dialog the next screen will be displayed but as empty.
When the user presses ENTER, the standard list output is displayed.
Q)How the transactions that are programmed by the user can be protected ?
By implementing an authority check.

Q139)What are the modes in which any update tasks work ?


Synchronous and Asynchronous.

Q140)What is the difference between Synchronous and Asynchronous updates ?


A program asks the system to perform a certain task, and then either waits or doesn't wait for
the task to finish. In synchronous processing, the program waits : controls returns to the
program only when the task has been completed. In asynchronous processing, the program
does not wait: the system returns control after merely logging the request for execution.

Q141)What is the difference between Leave Transaction and Call Transaction ?


- In contrast to LEAVE TO TRANSACTION , the CALL TRANSACTION statement causes
the system to start a new SAP LUW. This second SAP LUW runs parallel to the SAP LUW for
the calling transaction.

Q142)Overall how do you write transaction program in SAP ?


Create the transaction using object browser (SE80)
Define the objects eg. Screen, Transactions.
Modules - PBO, PAI.
And you can create a transaction from SE93 also.

Q143)Does SAP has a GUI screen painter ? If yes what operating systems is it available on ?
What is the other type of screen painter called ?
Yes
On what OS (Operating System) is it available - Window based.
Other type of screen painter - alpha numeric screen painter.

Q144)What are step loops ? How do you program page down page up in step loop ?
Step loops : Method of displaying a set of record.
Page down & Page up : Decrement / increment base counter
Index = base + sy-step1 - 1

Q145)Normally how many and what files get created when a transaction program is written ? What
is top XXXXXXTOP program ?
Main program with A Includes
I ) TOP INCLUDE - GLOBAL DATA
II ) INCLUDE FOR PBO
III) INCLUDE FOR PAI
IV) INCLUDE FOR FORMS

Q146)Where is processing logic located in an on-line program ?


Ans :- ABAP/4 program (module pool)

Q147)Describe the online processor. What is its function ?


Ans :- Controls the flow of online program.

Q148)How are screen names defined ? Do you create a screen firs or define your program first ?
Ans :- Define the program first and then create a screen.

Q149)What does PBO stands for ? When is the PBO logic performed ?
Ans :- PROCESS BEFORE OUTPUT - Processed before the screen is displayed.

Q150)What does PAI stands for ? When is the PAI logic performed ?
Ans :- PROCES AFTER INPUT - Processed after the user has pressed ENTER.

Q151)How is data passed from the screen fields to the ABAP/4 program ?
Ans :- Through the flow logic.

Q152)What does the TOP Include do for you as a programmer ?


Ans :- For global declarations.

Q153)What are the steps in creating screen ?


Where are the module statement declared ? Where is the logic within each module ?
Ans :-
1. Go to SE41 (Screen Painter )
Enter the program name and screen number. Press Enter.
2. Design the screen and save, check and activate it.
Module statements are in the flow logic within each module is in the ABAP/4 module pool.

Q154)What is the significance of the word 'OUTPUT' in the declaration


MODULE TEST_KNOWLEDGE OUTPUT
ENDMODULE.

Ans :- Then we know that it is part of the PBO, therefore is processed before the screen is
presented.

Q155)Describe the fields on the screen ?


Ans :- Attributes screen, Screen types, follow up screens, cursor position etc. After you have
entered the screen number, the screen branches to the screen attribute maintenance. Enter
a short description, select the type NORMAL and specify the number of the follow-up screen.

Q156)What are the three components of ON-LINE program ?


Ans :- Screen, ABAP/4 program and transaction code.

Q157)What is gained by using the Dictionary Fields menu option when creating your screen ?
Ans :- The fields you have created inherits the same attributes as those in the Data Dictionary.

Q158)How to Create a check box, frame, push buttons and radio buttons on a screen ?
Ans :- Just type a name and go to graphic element push button.

Q159)How do you assign an OK_CODE for a push button ? How it is used in ABAP ?
Ans :- In the field list, name the element and give it the value that it will represent when pushed
. You must make sure that you clear the field that represents the pushbutton after every
check.
Q160)What automatic checks does the screen perform ?
(Should be four)
Describe all four and how they are used ?
Ans :- The field format, required input, a foreign key table, parameters.

Q161)What are the two methods to declare input field as mandatory ?


If you set required field as program attribute, the user must enter a value in the field.
Required fields appear on the screen containing a question mark (?).

Q162)How does foreign key work ? What you have to put in your screen to identify the foreign
key ?
No ? Then where is the foreign key identified ?
Ans :- You have defined a screen field by referring to a Data Dictionary, which has a check
table. When the foreign key is checked the system compares the values of the fields to be
checked with the contents of the key fields of the corresponding table.

Q163)What are the two effects of the foreign key from a user standpoint ?
Ans :- Possible entries & a check against the key field contents.

Q164)What is user defined validation checks in the flow logic ?


Ans :- FIELD . . SELECT FIELD . . . VALUES or in the module pool FIELD . . . MODULE.

Q165)Does the value command in the flow logic go in the PAI or the PBO event ?
Ans :- PAI.

Q166)If an error occurs in the module pool, which fields are available for entry and which are
display only fields ?
Ans :- Only those fields defined with the FIELD statement before MODULE & relevant checks
in a chain.

Q167)When is the chain command used in the PBO event ?


Ans :- If you want to make more than one field ready for input after an error.

Q168)What table stores the online messages ? What is the message class and what is its
significance ?
Ans :- Table T100. The message class is a specific class of messages for a group of
transactions.

Q169)What are the 5 different message types and how are they handled by the system? What is
the difference between the warning and Error messages ?
Ans :-
A: Abend Message displayed on the current screen and subsequent task terminated
I: Information Message displayed on the current screen, but user can continue program
by pressing ENTER
E: Error Message displayed on the current screen. With FIELD statements, the fields
concerned become ready again for input and user is required to make the entry / entries
again.
W: Warning As E message, but correcting input is optional
S: Success Message displayed on the follow-up screen as an I message.

Q170)What does With statement add to a message ?


Ans :- In the place of the & or $ the fields or values are placed in the error message.

Q171)What effect does the FIELD statement have within the flow logic ?
Ans :- The field statement resets the fields so those fields are ready for input again.

Q172)Where are messages displayed on the screen ?


Ans :- At the bottom.

Q173)Is the SET PARAMETER statement to be issued in PBO or PAI module ? Why ?
Ans :- PAI, the value must be input into the fields first before it can be placed in the buffer.

Q174)Where does the GET PARAMETER statement get its values ?


Which field gets populated with the new value ?
Ans :- From the buffer.

Q175)Where can the SET CURSOR command be executed ? What is its effect ?
Ans :- In PBO, To position the CURSOR in a particular field after the screen is displayed.

Q176)What are the match codes and how do they affect the screen field ? Where are they
specified in the online program ?
Ans :- In the Properties window of the Field.

Q177)What is the effect of an ON CHAIN-REQUEST command in you flow logic ?


Ans :- When value of any of the fields between CHAIN . . . . ENDCHAIN is attempted to change.

Q178)What commands are used to change database table entries ?


Ans :-
Q179)How can you check if the changes to the database were successful ?
Ans :-

Q180)What is the difference between the Long form and the short form of making database
changes ?
Ans :- Long Form :
Update MARA and set brgew = 0
where matnr = 'MAT !'.
This is a standard Oracle Statement to modify the entry in the Database.
Short Form :
MARA-MATNR = ' MAT1 '. MARA-BRGEW = 0.
Modify MARA.
This is an SAP defined statement to modify the table
It is more secure and consistent.

Q181)What is the advantages using the SAP long form over the short form of database changes ?
Ans :- May be Fast Effect.

Q182)Can 'where' clause be used when updating database entries ?


Ans :- Yes.

Q183)Describe array operations and their advantages ?


Ans :-

Q184)What is logical unit of work ? How is it defined ?


Ans :- Logical Unit of work is a block of memory area where database contents are stored and
manipulated.
For every SAP application LUW is automatically created for database communication. Besides
this we have SAP LUW s also there.

Q185)What function is performed by the commit work command ?


Ans :- When you perform Commit, all the LUW s work will be reflected to the database.

Q186)Why is it so important for a programmer to check the lock entries ?


Ans :- To find out if record is locked and also to maintain data integrity.

Q187)How can you find a lock entry for a database table ?


Ans :- The function module ENQUIRE < lock object >' checks whether a lock was triggered for
the same object. Otherwise an exception FOREIGN_LOCK is carried out. If the object is not
locked the function module sets the lock.

Q188) What steps are necessary to set a lock on a record within a database table ?
Ans :-
Execute CALL FUNCTION statement
CALL FUNCTION " ENQUIRE <lock object ">
EXPORTING . . .
EXCEPTIONS . . .
CASE SY-SUBRC.
.
ENDCASE.

Q189) How do you unlock the entry? Why is this necessary ?


Ans :-
Execute the CALL FUNCTION statement
CALL FUNCTION 'DEQUEUE <lock object >'
EXPORTING . . .
It is important to unlock the entry so others can update it.

Q190)What is the difference between 'CALL SCREEN # # # ' and ' SET SCREEN # # # '
. . . LEAVE SCREEN ?
Ans :-
SET SCREEN execute the screen number currently in the follow-screen field
CALL SCREEN interrupts the processing of the current screen to call a new screen or a chain
of screens, processing of the current screen is resumed directly after the call.
Q191) After a CALL SCREEN command where does the processing return after the screen has been
executed ?
Ans :- It returns the processing to the calling screen.

Q192)Which is the more similar to a call with return, the SET SCREEN or the CALL SCREEN ?
Ans :- The CALL SCREEN command.

Q193)What function is performed by the SET SCREEN 0 command ?


Ans :- Returns to the original screen.

Q194)What are the main differences between the report status and screen status ?
Ans :-

Q195)Where must you place the SET PF-STATUS command in your online program ?
Ans :- Place it in the PBO module of the screen.

Q196)Why is it good idea to clear OK_CODE field after deciding which action to take ?
Ans :- You need to clear the OK code to avoid sending a screen that already has a function
code.

Q197)How do you specify that a function is an exit type command ?


Ans :- By specifying function type E for the push buttons or menu options in the screen painter
or menu painter.

Q198)What is the purpose of the 'AT EXIT-COMMAND'?


Ans :- Usually there are many ways to leave a screen (back, exit, cancel). This command will
perform termination logic for all functions of type E.

Q199)What are screen groups ?


Ans :- A group of screen fields such as radio buttons or check boxes.

Q200)What is the correct syntax for dynamically modifying a large number of screen fields ?
Ans :-

SAP Scripts

Q201) What is sap script and layout set ?


Ans :- SAP Script is the integrated text management system of the SAP R/3 system. SAP
Script is tightly integrated into the SAP system. It is used for many different word-processing
tasks all over the SAP System.

Q202) What is layout set ?

A layout set in SAP Script is used for page layout. The layout set contains various elements,
which are used for layout control of the individual pages and also contain layout information
for texts which are to be output on the individual pages.

The layout of a document is defined in a layout set. A layout set specified the appearance
and structure of a document.

Layout sets contain predefined text modules with space reserved for variable data. You can
use these text modules for different application.

Every SAP script document uses a layout set.

To make changes to your documents, such as moving a piece of text, or changing fonts,
paragraph formats, and tabs, you only need to change the layout set.

There are two ways of formatting texts using layout sets :


The text is entered and output in standard text maintenance. You can assign any layout set.
Text can also be entered via the layout set a letter header, for example.

The text is formatted via an ABAP/4 program using a layout set. The program can either
dynamically output individual predefined text modules, text elements or transfer entire texts,
which are to be output in the layout set.

You can use Styles to define the formatting of the text in your documents. A style determines
text formatting by setting the
paragraph and character formats used in a document. You can, for example, use a style to
highlight character strings or whole paragraphs. You can assign a style to any text. Typically,
however, you'll use styles primarily in the main windows of layout sets, where users type or
enter text directly in documents.

Header data is found in both style and layout set maintenance.


In style maintenance, it is used primarily to present important information - designed to make it
easier for the end user to select a style. The header data in layout set maintenance, on the
other hand, is used for information and control purposes.

Windows are defined in layout set maintenance. They represent areas which are positioned
on pages as page windows and in which text is layer output. At least one window must be
defined for each layout set. If not, a text cannot be formatted by SAP Script.

Q203) How many types of windows are there in SAP Script?


The following window types can be used :

MAIN - Main window in which continuous text is output. This is the window used by dialog
users of a print program and layout set. For example the body text of a letter would be
entered in MAIN.

VAR - Window with variable contents. The text can vary on each page in which the window is
positioned. Variable windows are formatted for each page.

CONST - Window with constant contents which is only formatted once.

Q204) What are the elements in layout set?


Header data - Data related to development (Created, development class, etc.) and layout set
information (which elements are used ) are both stored in the header data. A start page must
be entered.

Paragraph formats - Paragraph formats are required in layout sets - as in styles - in order to
format. However, they are also used for word processing in layout sets, for example, to format
text elements.

Character formats - You can also use character formats to format texts or paragraphs. Unlike
paragraph formats, however, they are used to format text within a paragraph.

Windows - Windows are names and window types, which are not physically positioned until
they are allocated to pages and units of measurement are specified.

Pages - Pages are defined to provide the system with a start and end point in text formatting.

Page windows - Page windows are the combination of windows and pages, where the
dimensions of a window and its position on a page are specified.

Q205) What are control commands?


The purpose of SAP script control commands is to allow control of the output formatting.
These commands are not interpreted by the SAP script editor, but are passed through to the
SAP script Composer for processing. The composer is the program that converts text from the
form displayed in the editor to the form used for printing.

Q206)What is SAP script and explain its purpose ?

SAP Script is the SAP system's own text-processing system. You'll find that it looks and feels a
lot like other leading text-processing system that you may use on your personal computer.

Every company needs to output documents with a uniformly defined layout (eg. Invoices,
delivery notes, etc..) all the time.
The basic layout of the document is predefined, but in many cases, other data has to be
merged with it, such as address data or purchase order items. This data might be entered
manually by a employee, or retrieved from a database table.

Large quantities of these documents have to be produced. From printing is usually a matter
of large print runs of documents such as pay slips, checks, order confirmation, reminders etc.

SAP script has been developed to meet the above requirements. IT is an integrated tool for
text entry and form printing in R/3 applications.

These documents are normally provided by SAP but every organization have their unique
ways of these documents so to customize these and for creating newer ones if required; SAP
script is used.

Q207)What are components of SAP script ?


Layout set, SAP script text, ABAP print program, symbols, function modules like open_form,
close_form, Read_text etc.

Q208)What are the ABAP/4 Commands that link to a layout set ?


Call function OPEN-form.
Call function WRITE-form.
Call function CLOSE-form.

Q209) How do you import Logo to the SAP script?


Importing Graphics (Logos) into SAP Script.
The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into
individual standard text.

Q210)Other useful programs for SAP Script


RSTXFCON - Converts page format
RSTXSCRP - Upload / Download layout sets
RSTXDBUG - SAP Script debugger

Q211)How to debug a SAP Script?


To debug a SAP script : Use Tools - Word Processing of layout set
and then Utilities - Activate
Another way to set the SAP script debugger is to run program RSTXDBUG.

Q212)When a Form is copied from one client to another. And if U try to display or change the
form in the copied client. The possible error message could be :
1. Form not found
Try coping again specifying the language.

2. IF IT displays an error message saying that the text file is inconsistent.


Then go to SE38 and Run "RSTXCHKO".
It will ask for the form name, then check all the check boxes and then run the program.
Note : all Script related problems can be solved using Program 'RSTX*'.
Q213)How to take a back up of script layout into Local hard disk and load it later
Use Program RSTXSCRP.
Use EXPORT mode, when downloading and IMPORT when uploading a script. Don't forget to
give the form name in the object field. This will create a script with the same name as that of
the original script. If a script with the same name exists in the same client, then it will give an
error 'Object cannot be overwritten'.

Q214)I want to copy table across clients


Use Program RSCLTCOP

Q215) To transfer script files across systems (Not Clients)


RSTXSCRP

Q216) To compare the contents of a table across clients :


RSTBSERV

Q217) To change the development class of any object -


RSWB0052

Q218)How do you number pages in SAP script layout outputs ?


&page&
&next Page&

Q219)What takes most time in SAP script programming ?


Defining layout set up / sets.

Q220)How do you use tab sets in layout sets ?


Default paragraph with defined tabs.

Q221)How do you backup sap script layout sets ? Can you download and upload ? How ?
SAP script backup :- In transaction SE71 go to
Utilities -> Copy from client -> Give source form name, source client (000 default), Target form
name.
Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.
Upload :- Create form with page, window, pagewindow with the help of downloaded PC file.
Text elements for Page windows to be copied from PC file.

Q222)What is Compare Tool in SAP Script ?


SAP Script offers tools for comparing objects across clients. We can compare or copy the
following kinds of objects.
Styles
Layout sets
Documents
With the Compare tool we can do the following :
Check whether an object exists in both clients display the differences between the versions of
an object.

Layout sets are used to control page layout and text formatting in documents.
Control command are used to modify text output. Use format key /: in the format column.

/ : INCLUDE
/ : DEFINE
/ : ADDRESS . . . ENDADDRESS
/ : PROTECT . . .. ENDPROTECT

/ : NEW - PAGE
/ : IF . . . ENDIF
/ : CASE . . . ENDCASE

Q223)Frames, lines and shading

BOX

Draws a box

SAP Standard styles and layout sets are always held in client 000.

In what format does SAP Script store text?


SAP Script texts are stored in Interchange Text Format (ITF). SAP script offers conversion
programs for the text file formats Rich Text Format (RTF) and ASCII as an interface to other
word processors.

Examples of control commands


INCLUDE
INCLUDE name <parameter >

Parameters :
OBJECT E. g. TEXT, DOCU (Document ), DSYS (Hypertext).
ID Text ID - Text ID is a way to group texts - Se transaction S010
LANGUAGE If the parameter is not specified, the log on language will be used
PARAGRAPH The text to be included is formatted using the style allocated. The PARAGRAPH
parameter can be used to redefine the standard paragraph for this style for the current call.
All * - paragraphs in the included text will then be formatted using the paragraph specified
here.

Object
ID
Language
Paragraph
Standard texts are maintained in transaction S010.

Example 1 :
You have created a standard text in S010 Named MYTEXT and with Text Id ST
/ : INCLUDE MYTEXT OBJECT text ID st
Example 2 :
You can also use a dynamic name so that you can retrieve a text depending of the name
variable :

/ : INCLUDE & SCUSTOM - NAME & text ID st.

Depending on the name in the variable &SCUSTOM - NAME & different texts will be shown.
Note that a text with the name in the variable &SCUSTOM - NAME & name must be created in
S010.

DEFINE

/ : DEFINE &SYMBOL& = ' String 1 String 2'

/ : DEFINE &CUST& = ' 00000021 '.

ADDRESS - ENDDRESS

The ADDRESS - ENDADDRESS command formats addresses according to the postal norms
of the recipient's country, as defined in the country parameter.

/ : ADDRESS DELIVERY PARAGRAPH AD


/ : NAME &KNAI - NAME&
/ : STREET &KNAI - STRAS&
/ : POSTCODE &KNAI - PSTLZ&
/ : CITY &KNAI - ORTO1&
/ : COUNTRY &KNAI - LAND1&
/ : FROMCOUNTRY 'DE'
/ : ENDADDRESS

Q224)Time Date and decimal format

Examples :

/ : SET TIME MASK = ' HH : MM '


/ : SET DATE MASK = ' DD.MMMM.YYYY'
/ : SET COUNTRY ' USA '

Q225)The New - Page command is used to force a Page break in the text at any point.

Protect . . . Endprotect command pairs can be tested


(True / False ).
False.

Delimiter & must be used immediately before and after the symbol.

Q226)What does the composer do ?


The final appearance of your document depends on interaction between the print program
and the layout set.

The SAP script print program initializes the printing process. Every command entered using
the SAP script programming interfaces is transferred to the composer.

The composer received layout information from the layout set specified by the print program.
The documents are formatted according to this layout information.

If the documents contain variables, the composer replaces these variables with data from the
R/3 system, such as the current date, or with the user data selected by the print program.

The print program controls the completion of the layout set. Once this is done, the composer
places the completed document in the spool.

Q227)Where do we define Tab space for data in SAP script ?

When defining the paragraph for the text element we can define the TABS then. There is
parameter called TABS to be defined in paragraph definition.

Q228) What is difference between Window & a Page Window ?

Window : An area that is predefined in the layout set. Windows are text modules, which are
positioned on a document page.

We define the window type, Default Paragraph, specify the text elements or a SAP script text
to the included etc in the Window Component.

Page Window : We define the parameters of the earlier defined Window, appearance on the
document like left or right margins, Width & Height.

Q229)What are symbols & state their different types with E.g.
A Symbol is a constant, which can be inserted in a document. It saves the user unnecessary
work when replacing sections of text, phrases, etc. Each symbol has a name which is
encloses by &.

EX. &variable name &


System symbols ex &Date&, &time& etc.

Standard symbols : Standard symbols are user - defined. They are maintained centrally in
table TTDTG. Ex.
&SGDH& for the opening salutation : " dear sir / madam ".
&MFG& for the closing salutation : "yours Faithfully".

Program Symbols : Program symbols display data from the ABAP/4 program which has called
the word processing function Eg. Itab - connid.

Chooses a layout set for printing.


Selects the output device, such as printer, monitor, or fax.

Sets print attributes such as immediate output, number of copies, and pages to be printed.

Q230) How to re use some components of the script layout to other program?
Q231) Is this script layout is standard for all the printer?
Q232) If not then y we are going for script layout ?

Q233) Give me couple of methods that I will take standard script layout printout for different printer.

Q234) How u will analysis script program ? (which goes to main and how many windows etc. . . )

Q235) Can V inserted logo on your program? Give me the program name which uploads my logo
and syntax for logo inserting in SAP script.
Yes u can insert a logo on your script layout.
Use this Report "RSTXLDMC" which will uploads the logo.
Use the following statement which includes the logo on your script prog.
/ : INCLUDE ' ZHEX - MACRO - XXX ' OBJECT TEXT ID ST LANGUAGE 'E'.

XXX - object name, u will gives @ runtime in rstxldmc program.

Q236) Give me syntax for box command.


BOX XPOS 2 MM WIDTH 0 CM HEIGHT ' 9.5 ' CM FRAME 10 TW

Script Commands.

Defining a variable

DEFINE &CUST& = ' 00000021 '.

Q236)What is the purpose of "Protect and Endprotect "?

You can specify either in the style or in the layout set that a particular paragraph should not
be split in two by a page break. If the page protect attribute is then the complete paragraph is
always output one single page. This property applies only to that particular paragraph. SAP
Script provides the PROTECT . . . ENDPROTECT command pair to allow you to define the
areas to be protected against a page beak on an individual basis. Thus the PROTECT /
ENDPROTECT commands may be regarded as a kind of conditional NEW - PAGE command,
the condition being whether or not the lines enclosed between the two commands fit in the
space remaining in the current main window.

Q237)How do we set the date, time format ?

SET TIME MASK : CONTROLS THE TIME FIELD FORMAT.


SET DATE MASK : CONTROLS THE DATE FIELD FORMAT.

Eg. Set Time Mask = " HH : MM : SS ".


Q238)What is the role of an ABAP program in SAPScript ?

R/3 application data from the database.


The layout set processing logic (The order of repetition of text elements ). Created, changed
and displayed using transaction S010.

Q239)The text ID is used to classify texts.

To include a standard text in a form, use the INCLUDE command :

/ : INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD

When formatting the standard text the PARAGRAPH parameter is used. To center the text
use :

/ : INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD LANGUAGE EN PARAGRAPH C.

Q240)Formatting addresses

The ADDRESS - ENDADDRESS command formats addresses according to the postal norms
of the recipient's country, as defined in the

country parameter.

ADDRESS DELIVERY PARAGRAPH AD


NAME &KNAI - NAME&
STREET &KNAI - STRAS&
POSTCODE &KNAI - PSTLZ&
CITY &KNAI - ORTO1&'
COUNTRY &KNAI - LAND1&
FROMCOUNTRY 'de'
ENDADDRESS

Avoiding pagebreaks in a paragraph

/ : PROTECT
:
:/ : ENDPROTECT

The text lines to be protected are enclosed between the two commands
Conditional text output IF - ENDIF

You can use IF / ENDIF like in a normal ABAP program

/ : IF condition
:
/ : ENDIF
and

/ : IF condition
:
/ : ELSE
:
/ : ENDIF

Example:

/ : IF &SPFLI - CITYTO& = "BERLIN"


. . . . put some text here
/ : ENDIF

Symbols and Control commands

Symbols are placeholders for values that are inserted during print formatting.

Symbols are identified by name surrounded by "&" and are not case sensitive

Types of symbols

System symbols

DATE Date
DAY Day
NAME _ OF _ DAY Name of day
MONTH Month
YEAR Year
TIME Time
HOURS Hours
MINUTES Minutes
SECONDS Seconds
PAGE Page number
NEXTPAGE Number of next pages
DEVICE Output device
SPACE Blank space
ULINE Underline
VLINE Vertical line

Standard symbols

Standard symbols are user defined and are maintained in table TTDG. You use transaction
SM30 to change or display standard symbols.

An examples of standard symbols is &MFG& for "Yours faithfully"


Standard text

Standard texts is predefined texts that can be used in more than one form. Standard texts are
can be created, Changed and displayed using transaction S010.

The text ID is used to classify texts.

To include a standard text in a form, use the INCLUDE command :

/ : INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD

When formatting the standard text the PARAGRAPH parameter is used . To center the text
use :

/ : INCLUDE < name > < Parameter >

<parameter > = Object, ID, Language, Paragraph

Example :

/ : INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD LANGUAGE EN PARAGRAPH C.

Name : Z_BC460_EX4_HF

Object : Text

Text ID : SDVD (Text id from S010)

Paragraph : C (Centered)

Tip : You can use menu Insert - > Text - > Standard to make it easier to insert the text

Program symbols

Program symbols are for contents of database fields or global program symbols. When you
print the form, data from the database tables are printed instead of teh symbols.

In the print program :

TABLES : kna1

In the form :

&KNAI - NAME1&

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 teh 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

Q241). What should be the approach for writing a BDC program ?


Ans : 1. Analysis the Data 2. Generate SAP structure 3. Develop
transfer program
4. Create sequential file 5. Create batch input program 6. Process batch
input data

Q242). What is the alternative to batch input session ?


Ans : Call transaction & Call dialog
What are the steps in a BDC session ? The first step in a BDC session is to identify the
screens of teh transaction that the program will process. Next step is to write a program to
build the BDC table that will be used to submit the data to SAP. The final step is to submit the
BDC table that will be used to submit the data to SAP. The final step is to submit the BDC
table to the system in teh batch mode or as a single transaction by the CALL TRANSACTION
command.

Q243). What are the problems in processing batch input sessions ? How is batch input process
different from processing on line ?
Ans : Sessions cannot be run in and not fast.

Q244). What do you do when the system crashes in the middle of a BDC batch session ?
Check no. Of records already updated and delete them from input file and run BDC again.

Q245). What do you do with errors in BDC batch session ?


Analysis and correct input file format and entries in internal table BDCDATA.

Q246) What are the commands that allow you to process sequential file ? And what is their
syntax ?
Ans :- READ DATASET (reading) and TRANSFER (writing). OPEN DATASET <dataset
name > for < input output appending > in < binary text > mode at POSITION < position >
MESSAGE < field >. READ DATASET <dataset name > INTO <field >. CLOSE
DATASET <dataset name>. DELETE DATASET < dataset name > TRANSFER < field >
to < dataset name >

Q247) What is the process for transferring data from legacy system to SAP ?
Ans :- FTP file transfer, Manufacturer - specific field transfer NFS ( network file system ) / BDC.

Q248) Explain the process to transfer a record to a dataset ?


Ans :- TRANSFER < field > to < dataset name >.

Q249) Why batch input ?


Ans :- To input a large amount of information at off peak times.

Q250) Can data be put directly into the database ?


Ans :- No, only after the data has been entered via transaction.
Q251) Explain at high level, the batch input process ?
Ans :- Batch data is placed into queues called batch input sessions, then placed into the
application programs for maintenance into the database.

Q252) What are the function modules associated with batch input ?
Ans :- BDC _ OPEN _ GROUP, BDC _ CLOSE _ GROUP, BDC _ INSERT

Q253) What is the structure of the BDC table ?


Ans :- Program / Dynpro / start / field name / field content.

Q254) Write out a coding example for filling a BDC Table


Ans :- FORM < NAME > REFRESH < bdc table > CLEAR <bdc table >- MOVE < program name
> to < bdc table >- PROGRAM < number1 > TO < bdc table > CLEAR < bdc table > MOVE: <
field > TO <bdc table >- FNAM < field2 > TO < bdc table >- FVAL APPEND < bdc table >

Q255) How do you find the transaction number, program number and field names ?
Ans :- Transaction no., program no., - System - > status Field names - F1, Technical help.

Q256) What are the processing modes for Batch Input ?


Ans :- Process on screen ( foreground ), Display errors only and process in the background.

Q257) What are the available OK Codes that can be utilized during batch input processing ?
Ans :- . ...../n - terminates current batch input transaction and marks as incorrect. /bdel
- delete current batch input transaction from session. / bend - terminate batch input
processing and mark session as incorrect. /bda - change display mode to process the
session on screen instead of displaying only errors. / bdc - change display mode to
display only errors instead of processing the session on the screen.

Q258) What is the effect of the BDC _ CURSOR field name in the BDC table ?
Ans :- You can set the cursor and enter as a corresponding field value the name of the field
on which the cursor is to be positioned.

Q259) How many types of BDCs you have done ?

Q260) Why you choose Call transaction and / or session method ? Call transaction is mainly
used when you want to update the database using a single transaction, you can also update
the database in asynchronous mode, where as session is used to perform huge database
updations using more than one transaction and which will last for a long time.
Q261) How you trap errors in call Transaction ?
Ans :- Errors while updating the database using call transaction technique are trapped using a
structure bdcmsgcall, whose field msgtyp become ' e ' when an error record is encountered.
Those records are formatted using format _ message function call in the desired format and
stored in an internal table for listing of all error records in one shot.

Q262) What are different types of Update modes In BDC's we have two types of updation
modes - 1) Synchronous 2) Asynchronous

Q263) What is main difference between session method and LSMW in the context of session
method, the method of updating is " Batch Input ", we require a program to be coded, But in
the context of LSMW method. The methods of updating using " Batch Input / Direction Input "
from an IDOC, from a BAPI structure. No source code is required, the complete operation is
performed in 16 steps sequence.

Q264) What is main difference between CATT and LSMW ? Using LSMW you can update any
kind of data but no changes to database are allowed, where as CATT tool can update only
master data, which also allows changes to the master data and also a significant testing of
data is possible.

Q265) What is BDC and How you use it ?


Ans :- BC Basis Components -- ABAP workbench - - BC Basis Programming interfaces - - Data
transfer. During data transfer, data is transferred from an external system into the SAP R/3
System. Transfer data from an external system into an R/3 System as it is installed. Transfer
data regularly from an external system into an R/3 System.
Example : If data for some departments in your company is input using a system other than the
R/3 System, you can still integrate this data in the R/3 System. To do this, you export the data
from the external system and use a data transfer method to import it into the R/3 System.
Batch input with batch input sessions : Data consistency check with the help of screen logic.
With the batch input method, an ABAP program reads the external data that is to be entered in
the R/3 System and stores the data in a "batch input session ". The session records the
actions that are required to transfer data into the system using normal SAP transactions.
When the program has generated the session, you can run the session to execute the SAP
transactions in it. ( you can explicitly start and monitor a session with the batch input
management function ( by choosing System Services Batch input ), or have the session
run in the background processing system. Use the BDC _ OPEN _ GROUP function module to
create a new session. Once you have created a session, then you can insert batch input data
into it with BDC _ INSERT. Use the BDC _ INSERT function module to add a transaction to a
batch input session. Use the BDC _ CLOSE _ GROUP function module to close a session
after you have inserted all of your batch input data into it.

Q266) Will ask u for screen no's and dynpro names for BDC that u say u have done.

Q267) Which technical field in the BDCDATA table holds the last cursor position ?

Q)What is Dataset and how you use it ?


ABAP/4 provides three statements for handling files : The OPEN DATASET statement opens a
file. The CLOSE DATASET statement closes a file. The DELETE DATASET statement
deletes a file. To open a file for read access, use the FOR INPUT option of the OPEN
DATASET statement to open a file for write access, use the FOR OUTPUT option of the OPEN
DATASET statement to open a file for appending data to the file, use the FOR APPENDING
option of the OPEN DATASET statement to process a file in binary mode, use the IN BINARY
MODE option of the OPEN DATASET statement. To process a file in text mode, use the IN
TEXT MODE option of the OPEN DATASET statement. To open a file at a specific position,
use the AT POSITION option of the OPEN DATASET statement when you work with the
operating systems UNIX or WINDOWS NT, you can send an operating system command with
the statement OPEN DATASET. To do so, use the option FILTER. To receive the operating
system message after trying to open a file, use the MESSAGE option of the OPEN DATASET
statement. To close a file on the application server, use the CLOSE DATASET statement. To
delete a file on the application server, use the DELETE DATASET statement. To write data to
a file on the application server, use the TRANSFER statement. To read data from a file on the
application server, use the READ DATASET statement.

Q268). What is true about the LSMW : (Choose correct option/s).


Part of teh SAP system. Processes hierarchical data files (header and position ). Needs a source
field for every target field.

Q269) How do you read a LOCAL sequential file ?

Q270) How do you send the BDCDATA table in a Call Transaction statement ?

Q271) What loop do you code for a READ DATASET statement ?

Q272). What are the steps in a BDC session ?


The first step in a BDC session is to identify
the screens of the transaction that the program will process. Next step is to write a program to
build the BDC table that will be used to submit the data to SAP. The final step is to submit the
BDC table to the system in the batch mode or as a single transaction by the CALL
TRANSACTION command.

Q273) How do you find the information on the current screen ?


The information on the current screen can be found by System & Status command from any
menu.

Q274) How do you save data in BDC tables ?


The data in BDC tables is saved by using the field name ' BDC_ OKCODE " and filed value of '
/11 '.
Q275) What is the last entry in all BDC tables ?
In all BDC tables, the last entry is to save the data by using the field name BDC_OKCODE and
a field value of ' /11 '.

Q276) What is a multiple line field ?


A multiple line field is a special kind of field which allows the user to enter multiple lines of data
into it.
Q277) How do you populate data into a multiple line field ?
To populate data into a multiple line field, an index is added to the field name to indicate which
line is to be populated by the BDC session (Line index).

Q278). Write the BDC table structure -


BDC table structure FIELD TYPE
DESCRIPTION program CHAR (8)
Program name of transaction DynPro CHAR (4)
Screen
number of transaction DynBegin CHAR (1)
Indicator
for new screenFnam CHAR(35)
Name of database field
from ScreenFval
CHAR (80) Value to submit to
field

Q279) Does the CALL TRANSACTION method allow multiple transactions to be processed by
SAP ?
No, The CALL TRANSACTION method allows only a single transaction to be processed by
SAP.

Q280) Does the BDC_INSERT function allow multiple transactions to be processed by SAP.
Yes.

Q281). What is the syntax for 'CALL TRANSACTION' ?


CALL TRANSACTION trans (using bdctab MODE mode ). Three possible entries are there for
MODE.
A - show all screens
E - show only screens with errors
N - show no screens which mode of 'CALL TRANSACTION' method allows background
processing ? - N is the only mode that allows background processing.

Q282). Is it possible to use 'CALL TRANSACTION' without a BDC table ?-


Yes, it is possible to use 'CALL TRANSACTION' without a BDC table. In such case, the current
program is suspended, the transaction specified is brought up, and a user must enter the data
into the screens.

Q283). What is TCODE ? -


TCODE is the transaction code for the transaction that should be used to process the in
the BDC table being inserted.

Q284). What are the function modules that need to be called from BDC program to submit the
transactions for processing ?
BDC_OPEN_GROUP - BDC-INSERT BDC_CLOSE_GROUP

Q285). How many sessions will be opened using BDC_OPEN_GROUP ?


Only one session can be created using the BDC_OPEN-GROUP function.
Q286). What is ' BATCH INPUT ' or ' BDC " ?
The SAP system offers two primary methods (BDC SESSION METHOD, CALL TRANSACTION
METHOD ) for transferring data into the system from other systems and NON - SAP systems.
These two methods are collectively called as ' BATCH INPUT ' or 'Batch Data Communication '
(BDC)

Q287). What are the advantages in Batch Input ?


The Batch Input ensures Data integrity. No manual interaction is required during Data transfer.

Q288). What is the functionality of 'Classical Batch Input" ?


In 'Classical Batch Input" an ABAP/4 program reads the external data that is to be entered in
the SAP system and stores the data in a Batch Input session. This session stores the actions
that are required to enter your data using normal SAP transactions.

Q289). Which Function Modules are used in 'Classical Batch Input' ?


BDC_OPEN_GROUP, BDC_INSERT, BDC_CLOSE_GROUP.
Q). What is Synchronous Database update ?
During the processing no transaction is stored until the previous transaction has been written
to the Database. This is called Synchronous Database update.

Q290). What are the differences between CALL TRANSACTION and BATCH INPUT SESSION
?
The most important aspects of the batch session interface are :- Asynchronous processing -
Transfers data for multiple transactions - Synchronous database update. During
processing, no transaction is started until the previous transaction has been written to the
database - A batch input processing log is generated for each session - Sessions
cannot be generated in parallel. The most important aspects of the CALL TRANSACTION
USING interface are - Synchronous processing - Transfers data for a single
transaction - Synchronous and asynchronous database updating both possible. The
program specifies which kind of updating is desired - Separate LUW for the transaction.
The system performs a database commit immediately before and after the CALL
TRANSACTION USING statement - No batch input processing log is generated.

Q291). What are the types of Batch Input ?


Classical Batch Input - Call Transaction - Call Dialog

Q292). What is BDC _ OKCODE ?


The command field is identified by a special name in batch input called BDC _ OKCODE. This
name is constant and always identifies the command field.

Q293). How can we execute a function in a BDC session ?


We can execute a function in a transaction by entering the function code or function key
number in the command field of an SAP session. A function key number must be prefixed with
the / (slash) character. A function code must be prefixed with the
= character. -
Example : BDCDATA - FNAM = 'BDC _ OKCODE ' BDCDATA - FVAL = ' = UPDA '
Q294). How can we position the cursor on a particular field ?
BDCDATA - FNAM = 'BDC_CURSOR ' BDCDATA - FVAL = < FIELDNAME >

Q295). Who are Dialog users and who are Background users ?
Dialog users are normal interactive users in the SAP system. Background users are user
master records that are specially defined for providing authorizations for background
processing jobs.

Q296). What is the use of BDC _ INSERT ?


We add a transaction to a Batch Input Session by using this function.

Q297). What are the update modes in CALL TRANSACTION ?


S : Synchronous - A : Asynchronous - L : Local

Q298). What does the message parameter indicates ?


The message parameter indicates there all system messages issued during a CALL
TRANSACTION are written into the internal table < itab >. The internal table must have the
structure of BDCMSGCOLL.

Q299) What is Direct Input ?


To enhance the batch input procedure, the system offers the direct input technique especially
for transferring large amount of data. This technique doesn't create sessions but stores the
data directly. The direct input programs must be executed in the back ground only. To
maintain and start these programs, use program RBMVSHOW or the transaction BMVO.

Q300). What are the features of Recording Function ?


Recording transaction runs - creating batch input sessions from the recorded transaction
runs - Generating a batch input program from the recorded data.

Q301). What is synchronous database update ?


During the processing, no transaction is stored until the previous transaction has been written
to the database. This is called Synchronous database update.

Q302)How do you set up batch process ?


Data analysis : Analyze the data that is to be transferred to the SAP System. ll
Generate SAP structures : Generate SAP data structures for incorporation into your data
export program. l l Develop transfer program : You can write the program in ABAP/4
or as an external program. l l Create sequential file : Export the data that is to be
transferred, to a sequential file. l l Create batch input program : ABAP/4 batch input
program that will read the data to be transferred from the sequential file. l l Process
batch input data : Process the data and add it to the SAP System. You can do this either by :
batch-input session method or Call transaction method. l l Analyse results : Check that
all data has been successfully processed. l l Analyse Error session : Correct and
re-process erroneous data.

Q303). Where do you use BDC ?


Transferring data from another system when you install your SAP System. Regularly
transferring data that is captured by a non-SAP system in your company into the SAP system.
Assume, for example, that data collection in some areas of your company is still performed by
a non - SAP system. You can still consolidate all of your data in the SAP System by exporting
the data from the other system and reading it into the SAP System with batch input. You can
also use batch input to transfer data between two R/3 Systems. However, there are more
direct methods for doing this, such as RFC (remote function calls).
84. What has to be done to the packed fields before submitting to a BDC session ?
Declare these fields in teh internal table as characters and the length of the field should be
same as the field length of the field's data element. This internal table is used to hold the data
fetched from the sequential file using WS-upload function module.

Q304)What is LSMW ?
The LSMW is a cross - application component (CA) of teh SAP R/3 System. The tool has
interfaces with the Data Transfer Center and with batch input and direct input processing as
well as standard interfaces BAPI and IDoc in R/3. The LSMW comprises the following main
functions :
1. Read data (legacy data in spreadsheet tables and/ or sequential files ). Function Read
data replaces and enhances functions Spreadsheet interface and Host interface of LSMW
version 1.0. You can use any combination out of PC and server files now.
2. Convert data (from the source into the target format )
3. Import data ( to the database used by the R/3 application ). TCODE - LSMW.

Q305)Submit a BDC job with an internal batch number and wait for the end of the batch input
session.

RSBDCSUB
Release batch input sessions automatically
Typical Structure of ABAP Program

1. Report Definitions *
2. Table and Data definitions *
3. Initialization event
4. Screen Select Options / Inputs *
5. Selection - screen event
6. Start - of - selection event
7. Performs and other Events *
Statements
8. End - of - selection event

1. Initialization
.. Triggered prior to first display of selection screen
.. To specify Default value in SELECT - OPTIONS

2. At Selection - Screen
.. Processed after the selection screen value are entered
.. For validation of screen accepts
.. Returns back to SELECT - OPTIONS

4. START - OF - SELECTION & END - OF - SELECTION

.. This is implicit in any ABAP/4 program


.. Start & end of main processing logic
.. More in use with logical database access
.. All Statements between START - OF - SELECTION and END - OF - ELECTION is only
executed
.. By Default, no need to hav END - OF - SELECTION
.. Each procedural statement in an ABAP program automatically belongs to START - OF -
SELECTION

5. Form Event

.. Similar to PERFORM / SUBROUTINES


.. STARTS with FORM and ends with ENDFORM
.. All statements between ENDFORM and end of program are never processed.
.. Similarly all statements between ENDFORM and event keyword are never processed.
6. Limitations of Simple PERFORM

.. Values can be passed through PERFORM to FORM


.. Giving the flexibility to use the same subroutine multiple number of times.

Syntax1 : PERFORM <xxxx> using <YYY>


changing <MMM>
FORM <xxxx> using <YYY> like <ZZZ>
changing <MMM> like <NNN> - Pass by reference
OR

FORM <XXXX> using value <YYY> like <ZZZ> - Pass by value , creates another copy
of the variable.

Example1 :
PERFORM date - invert using in - date
Changing out- date

FORM date - invert using in - date like datum

Syntax2 : PERFORM function - name ( program ) IF FOUND.

Example2 : PERFORM HEADER ( FORMPOOL ) IF FOUND.

6. Get event

.. GET < table name >


.. Reads data of all columns from all database table falling in th hierarchy

.. Needs to mention table name in

TABLES : parameters . ......

.. Only fields part of the tables mentioned in the TABLES : parameter can be viewed &
edited

7. To Exit from an Event

.. Exit - It exits from the respective subroutine were this syntax is used, generally condition
for the EXIT is stated before this syntax.

.. Check - here the conditional check is done at the same time.

CHECK <condition>
If the condition si not satisfied, the system leaves
the subroutine and resumes
the processing after the PERFORM statement

.. Stop - it is the abrupt stopping the program flow

8. CALLing Functional Modules

Syntax :
CALL FUNCTION < module >
[ EXPORTING f1 = a1. . . . . fn = an ]
[IMPORTING f1 a1. . . . .. . ...fn = an ]
[CHANGING f1 = a1 . .. . ..fn = an]
[TABLES f1 = a1. . . . . . fn = a1]
[EXCEPTIONS e1 == r1 .. . en = rn]

Example :
CALL FUNCTION ' Z_DATE_CONVERSION'
EXPORTING STD_DATE = GEN_DATE
IMPORTING CH _ DATE = NEW_DATE

9. List Events

TOP - OF - PAGE, END - OF - PAGE,


AT LINE - SELECTION, AT USER - COMMAND

These events are triggered by the ABAP runtime environment while a list is being created or
when a user performs an action on a list. The statement in these blocks can format the list or
process the user's request.
ABAP PERFORMANCE ISSUES.

ABAP/4 Optimization

.. Use the GET RUN TIME command to help evaluate performance. It's hard to know
whether that optimization technique REALLY helps unless you test it out. Using this tool can
help you know what is effective, under what kinds of conditions. The GET RUN TIME has
problems under multiple CPUs, so you should use it to test small pieces of your program,
rather than the whole program.

Syntax HIDE < f >.


Eg HIDE : SPFLI - CARRID, SPFLI - CONNID, NUM.

READ LINE
Use the statements READ LINE and READ CURRENT LINE to explicitly read data from the
lines of existing list levels. These statements are tightly connected to the HIDE>
technique.

Syntax :

READ LINE < lin > [INDEX <idx>]


[FIELD VALUE <F1> [ INTO < G 1>]. . . < f n > [INTO < g n >] ]
[OF CURRENT PAGE l OF PAGE <p>]

Eg :
READ LINE SY - INDEX FIELD VALUE BOX.

GET CURSOR
Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output field or
output line on which the cursor was positioned during the interactive event to the processing
block.

Syntax
GET CURSOR FIELD <f> [ OFFSET <off>] [LINE <lin>]
[VALUE <val>] [LENGTH <len>].

SET CURSOR

To set the cursor, use the SET CURSOR statement. This statement sets the cursor in the
most recently created list. While creating the basic list, this is always the basic list itself. While
creating a secondary list, this is the previous list.

SET CURSOR <col> <lin>.


This statement sets the cursor to column <col> of line <lin> of the output window.

Calling Programs
If you need to program an extensive application, one

TOP - OF - PAGE DURING LINE - SELECTION.

The system triggers this event for each secondary list. If you want to create different page
headers for different list levels, you must program the processing block of this event
accordingly, for example by using system fields such as SY - LSIND or SY - PFKEY in control
statements (IF, CASE).

Data from System Fields of Interactive Lists

From system fields, you retrieve the follwing information : the index of a list, the position of the
list in teh output window, and the location of the cursor. The only system field that contains
the contents of the selected line is SY - LISEL.

Passing Data by Program Statements

To pass individual output fields or additional information from a line to the corresponding
processing block during an interactive event, use these statements :

HIDE
The HIDE statement is one of the fundamental statements for interactive reporting. Using the
HIDE technique, you can as the moment you create a list level define, which information later
to pass to the subsequent secondary lists.

the page headers for secondary lists ?


The secondary lists, the system does not display a page header and it does not
trigger the event TOP - OF - PAGE. To create page headers for secondary list, you must
enhance TOP - OF - PAGE.

Syntax : TOP - OF - PAGE DURING LINE - SELECTION. The system triggers this event for
each secondary list. If you want to create different page headers for different list levels, you
must program the processing of this event accordingly, for example by using
fields such as SY - LSIND or SY - PFKEY in control statements ( IF, CASE ).

Q306) What is meant by stacked list ?


A stacked list is nothing but secondary list and is displayed on a full-size screen unless you
have specified its coordinates using the window command.

Is the basic list deleted and you can return back to it using one of teh standard navigation
functions like clicking on the back button or the cancel button.
Q307)What is meant by hotspots ?
Hotspot is a list area where the mouse pointer appears as an upright hand symbol. When a
user points to that area ( and the hand cursor is active), a single-click does the same thing as
a double - click. Hotspots are supported from R/3 release 3.0c.

In which system field does the name of current GUI status is there ?
The name of the current GUI STATUS is available in the system field SY - PFKEY.

Q307)What is meant by hide area ?


The hide command temporarily stores the contents of the field at the current line in a
system-controlled memory called the HIDE AREA. At an interactive event, the contents of the
field is restored from the HIDE AREA. When calling a secondary list from a list line for which
the HIDE fields are stored, the system fills the stored values back into teh variables in the
program. In the program code, insert the HIDE statement directly after the WRITE statement
for the current line.

Q308)When the get cursor command used in interactive lists ?


If the hidden information is not sufficient to uniquely identify the selected line, the command
GET CURSOR is used. The GET CURSOR command returns the name of the field at the
cursor position in a field specified after the addition field, and the value of the selected field in
a field specified after value.

Q309)How to pass data from list to report ?


ABAP/4 provides three ways of passing data :
- - - Passing data automatically using system fields
- - - Using statements in the program to fetch data
- - - Passing list attributes

Q310)How to call other programs ?

Report Transaction
Call and return SUBMIT AND RETURN CALL
TRANSACTION
Call without return SUBMIT LEAVE TO TRANSACTION

System fields used in interactive Reporting


The SY - LSIND system fields contains the index of the list currently created. While creating a
basic list, SY - LSIND equals 0.

Q311)With each interactive event, the system automatically sets the following system fields :

System field Information

SY - LINCT total line count of a list

SY - LINNO current line no where cursor is placed

SY - LSIND Index of the list currently created during the current event (basic list = 0 )
SY - LISTI Index of the list level from which the event was triggered

SY - LILLI Absolute number of the line from which the


Interactive Reporting

Interactive reporting allows the user to participate actively in retrieving and presenting data
during the session. Instead of one extensive and detailed list with interactive reporting you
create a condensed basic list from which the user can call detailed information by positioning
the cursor and entering commands. Interactive reporting thus reduces information retrieval to
the data actually required.

Q312)What are the event key words in interactive reporting ?

Event keyword Event


AT LINE - SELECTION Moment at which the user selects a line by double -clicking
on it or by positioning the cursor on it
and pressing F2.
AT USER - COMMAND Moment at which the user presses a function key.
TOP - OF - PAGE DURING LINE - SELECTION Moment during list processing of a
secondary list at which a new page starts.

Q313)What is secondary list ?


Secondary lists allow you to enhance the information presented in the basic list. The user
can, for example, select a line of the basic list for which he wants to see more detailed
information. You display these details on a secondary list. Secondary lists may either overlay
the basic list completely or you can display them in an extra window on the screen. The
secondary lists can themselves be interactive again.

Q314)How to select valid lines for secondary list ?


To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities. At the end
of the processing block END - OF - SELECTION, delete the contents of one or more fields you
previously stored for valid lines using the HIDE statement. At the event AT LINE -
SELECTION, check whether the work area is initial or whether the HIDE statement stored field
contents there. In the latter case, create a secondary list, since you previously stored field
contents for valid lines only. After processing the secondary list, clear the work area again.
This prevents the user from trying to create further secondary lists from the secondary list
displayed.

Q314)How to create user interfaces for lists ?


The R/3 system automatically generates a graphical user interface (GUI) for your lists that
offers the basic functions for list processing, such as saving or printing the list. If you want to
include additional functionality, such as push buttons, you must define your own interface
status. To create a new status, the Development Workbench offers the Menu Painter. With
the Menu Painter, you can create menus and application tool bars. At the beginning of the
statement block of AT END - OF - SELECTION, activate the status of the basic list using the
statement : SET PF - STATUS 'STATUS'.
Q315)Can we call reports and transactions from interactive reporting lists?
YES. Interactive reporting also allows you to call transactions or other reports from lists.
These programs then use values displayed in the list as input values. The user can, for
example, call a transaction from within a list to change the database table whose data is
displayed in the list.
Q316)How to maintain lists ?
To return from a high list level to the next -lower level ( SY-LSIND), the user chooses Back on
a secondary list. The system then releases the currently displayed list and activates the list
created one step earlier. The system deletes the contents of teh released list. To explicitly
specify the list level into which you want to place output, set the SY - LSIND field. The system
accepts only index values which correspond to existing list levels. It then deletes all existing
list levels whose index is greater or equal to the index you specify. For example, if you set SY
- LSIND to 0, The system deletes all secondary lists and overwrites the basic list with the
current secondary list.

According to the application, you use a variant, which takes the variable values from Table
TVARV.

Q317)What is set parameter and get parameter ?

We can pass data to a called program using SPA / GPA parameters. SPA / GPA parameters
are field values saved globally in memory. Each parameter is identified by a three-character
code : You can define these parameters in the object browser by selecting other objects on
the first screen. The SPA/GPA storage is user - specific and valid throughout all the user's
sessions by using the SET PARAMETER or GET PARAMETER statements.

These statements let you store and retrieve SPA / GPA values from an ABAP/4 program. If
the selection screens for the two transactions do not share the same required fields, use
these statements to store screen fields explicitly by name.
Before calling the new transaction from a PAI module, store the caller transaction's fields
under one name :

SET PARAMETER ID ' RID ' FIELD < FIELD NAME1>

The system stores the value in <field name1> in the SPA parameter 'RID'. The three -
character identifier 'RID' must be defined in the SAP table TPARA. If the SPA parameter
statement overwrites it (with the contents of <FIELD NAME 1>).

In the PBO module for the called transaction, retrieve the fields under the other name :

GET PARAMETER ID 'RID' FIELD <FIELD NAME 2>.

Q318)What is field symbol ?

A field symbol does not physically reserve space for a field, but points to a field which is not
known until runtime of the program. Sometimes you only know which field you want to
process, and how you want to process it, at runtime.
For this purpose, you can create field symbols in your program. At runtime, you can assign
real fields to such field symbols. All operations which you have programmed with the field
symbol are then carried out with the assigned field. After successful assignment, there is no
difference in ABAP/4 whether you reference the field symbol or the field itself.
Q319)How to use a grid list ?
Use Function Module Display _* LIST. In your program. Put all the data that U want to output
in its final format and then pass this internal table to the function module.

Two types of grid list.


DISPLAY _ GRID _LIST (Version 4.0b)
DISPLAY _ BASIC _ LIST (Version 4.6b)
Calculate the subtotal etc and save it as a variant, however while printing it will print all the
entries of the fields.

Q320)How to pass data from the form to the Subroutine program ?


Use structure ITCSY

Q321)How can we pass selection and parameter data to a report ?


- There are three options for passing selection and parameter data to the report.
. Using SUBMIT . . . WITH
. using a report variant
. using a RANGE table

Standard Programs that every ABAPer Should Know


RSAVGLOO Table adjustment across clients
RSBDCSUB Release batch - input sessions automatically
RSCLTCOP copy tables across clients
RSINCLOO Extended program list
RSORAREL Get the Oracle Release
RSPARAM Display all instance parameters
RSTXSCRP Transport SAP script files across systems
RGUGBROO Substitution / Validation utility
RSUSROO3 Check the passwords of users SAP* and DDIC in all clients
RSUSROO6 List users last login
RSTXLDMC To load LOGO's to application server

Q322)What is Internal table ?


Internal tables are table objects that only exist for the runtime of the program. There are
several ABAP statements for working with internal tables, for example, append, insert, delete
or find lines.

The number of lines of an internal table is extended dynamically at runtime as required.

You can use internal tables for table calculations on subsets of database tables. For example,
you can read a part of one or more database tables into an internal table.

They also allow you to reorganize their contents to suit the needs of your program. You can,
for example, read particular entries from one or more large customer tables into an internal
table and then use them to create a list. When you run your program, you can access this
data directly, instead of having to search for each record in the database.
Q323)What is a variant and where do you use it ?
If you want to run a report program with same selections at regular intervals (for example, for
monthly sales statistics ), you would not want to enter the same values each time. So, ABAP/4
offers you possibility to combine the desired values for all these selections in one selection
set. You can create as many different selection sets as you like for each report program and
they remain assigned only to the report program in question. Such a selection set is called a
variant.
Using Variants Online
Using Variants in Background Processing
Online, starting a report via variant saves the user work, minimizes input errors. In
background processing, a variant is the only possibility you have to pass values for the
selections.

To fill certain selections with values that change value table.


The value range of the domain can be defined by specifying value table. All table fields
referring to this domain can then be checked against the corresponding field of this value
table. In order the check can be executed, a foreign key must be defined for the value table.

Q324)What are matchcodes ? Describe ?


A matchcode is a tool to search records in the system. Matchcodes are an effective and user-friendly search aid for
cases where the key of a record is unknown.It consists of two stages one is Match code object and the other is
Matchcode ID.
A match code object describes the set of all possible search paths for a search term.Matchcode ID describes a special
search path for a search term.

Q325)What are ranges ? What are number ranges ?


It is often necessary to directly access individual records in a data structure. This is done using unique keys. Number
ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such
numbers are e.g. order numbers or material master numbers.

Q326)How do you validate the selection criteria of a report ? And how do you display initial values in
a selection screen ?
The selection criteria is validated in the processing block of the AT SELECTION SCREEN
event for the input values on the screen and respective messages can be sent.
To display initial values in the selection screen :
. Use INITIALIZATION EVENT
. use DEFAULT VALUE option of PARAMETERS Statement
. Use SPA / GPA Parameters (PIDs)

Q327)What is the Client concept in SAP ? What is the meaning of Client independent ?
In commercial, organizational and technical terms, the client is a self contained unit in the R3
system, with separate set of Master data and its own set of Tables. When a change is made
in one client all other clients are affected in the system - this type of objects are called Client
independent objects.

You might also like