| PARAMETERS
| SELECT-oPTIONS
| comment
| PUSH-BUTTON
When can you call the standard selection screen?
‘The standard selection screen is called automatically between
the INITIALIZATION and START-OF - SELECTION events.
During selection screen processing, the ABAP runtime envi-
ronment generates special selection screen events,
How do you call au
There are three ways to call a user-defined selection screen
1 From a program—This statement is used to call these screens
from any program,
As a report transaction—When the program starts using
the transaction code, the user-defined selection screen is
called between the INITIALIZATION and the START-
OP-SELECT ION events.
Asa dialog transaction—Any selection screens in executable
programs and module pools that are called with transaction
codes for dialog transactions can be used as the initial screen
These screens can be called at any point in the program flow
using the following statement:
CALL SELECTION-SCREEN [STARTING AT
] [ENDING AT ]
This statement calls selection screen number 63__How do you define check boxes?
‘The following syntax is used to define the input field of a parameter
asa check box:
PARAMETERS . AS CHECKBOX.
Parameter
is created with type C and length 1. Valid values
for
are’ ‘and ’X’. These values are assigned to the parameter
when the user clicks the check box on the selection screen,
64. How do you create a pushbutton?
The following syntay
is used to create a pushbutton:
SELECTION-SCREEN PUSHBUTTON [/]
USER-COMMAND [MODIF ID ]
determines the pushbutton text. You can specify a
text symbol or a field name with a maximum length of eight
characters.
is the value thatidentifies the pushbutton. You must
specify a code of up to four characters.
65.__How do you define radio buttons?
is used to define radio buttons:
PARAMETERS RADIOBUTTON GROUP
Parameter is created with type C and length 1, and is,
assigned to group . The maximum length of the string
exad> is 4.
66. What is the syntax for allowing uppercase or lowercase
for character string parameters?
‘The following syntax is used to allow uppercase or lowercase for
character string parameters:
PARAMETERS ...... LOWER CASE.Ifthe LOWER CASE addition is not used, then all input values
are automatically converted to uppercase,
67. How do you define the selection screen block with a
frame?
‘The following statement defines the selection screen block with
a frame:
selection-screen begin of block 0 with
frame title text-000
68. _How do you place a comment on the selection screen?
‘The following syntax is used to place a comment on the selection
screen:
selection-screen comment
69. __How do you place the input fields on the same li
‘The following syntax is used to place the various input fields on
the same line:
selection-screen begin-of-line
selection-screen hegin-of-line
All of the input fields defined between these two statements
are placed next to each other on the same line.
70. How do you create blank lines on the selection screen?
The following syntax is used to create a blank line:
selection-screen skip n.
‘is any number of lines.71.
72.
73.
Whatis the main difference between select-options
and parameters?
The main difference between select-options and
parameters is thatelect -options creates two input fields
containing both a FROM and a TO field, whereas parameters
creates only a single input field
Whatis the internal structure of the select -options
statement of a selection screen?
The internal structure of select -options contains the
following features:
1 SIGN—It signifies INCLUSIVE or EXCLUSIVE. By default it
is INCLUSIVE.
© OPTION—It can hold values BT (between), CP (contains
pattern), EQ (equal to), and GE (greater than or equal to)
= LOW—tt hola the value entered in the FROM field
| HIGH—tt holds the value entered in the TO field
What are the various additions of the select -opt ions
statement?
Uppercase and lowercase for selection criteria:
SELECT-OPTIONS FOR ... LOWER
CASE,
To make the FROM field a required field on the selection
screen, the following option is used:
SELECT-OPTIONS FOR
OBLIGATORY
To hide the input fields on the selection screen, the NO
DISPLAY option is used
SELECT-OPTIONS FOR ... NO
DISPLAY74,
‘To modify the input fields on the selection screen, the
following option is used:
SELECT-OPTIONS FOR ... MODIF
ID seseee
What are the
dynamically?
ferent ways to modify the screen
There are three different ways to modify the screen
dynamically:
1 Setting attritutes dynamically—A special internal table is used
to override some of the attributes of ABAP programs.
1 The field selection function —The field selection Function is used
to change the attributes of screens dynamically.
& Setting the cursor position—The cursor position can be set
either statically in Screen Painter or dynamically in an ABAP
program,CHAPTER 4
NITERNAL T ABLES
TERNAL TABLES
What are internal tables?
Internal tables are temporary tables that are stored in RAM on
the application server. Line-by-line memory is used to store
data that have the same structure. Internal tables also work as
arrays and are used where data processing is done with a fixed
structure in a program, These tables exist during the runtime
of a program. They act as dynamic objects at runtime.
How do you declare an internal table?
An internal table consists of a body and a header line that is
optional. The body contains the rows of the internal table. The
headler line can hold only a single row. The headler line is like
a field string that has the same structure as a row of the body.
For example:
Declaration of an internal table with a header line—option I:DATA : BEGIN OF TTAB OCCURS 0,
NAME (10) ,
DEPT(10) ,
END OF ITAB.
75
Declaration of an internal table with a header line—option Il:
TYPES : BEGIN OF FS,
NAME(10),
DEPT(10),
END OF FS
DATA ITAB TYPE FS OCCURS 0 WITH HEADER
LINE.
Figure 4.1 shows diagrammatically the header line and body
of an internal table,
Header Line
map
NAME DEPT
Boy
Body
man
SS
Figure 4.1: Header!
ye and Body of an Internal Table.Declaration of an internal table without a header line:
TYPES : BEGIN OF FS,
NAME (10),
DEPT(10),
END OF FS
DATA ITAB TYPE FS OCCURS 0.
Explain the data types of an internal table.
Internal tables and structures are the two structured data types
in ABAP. The data type of an internal table is fully specified by
its line type, key, and table type. The data type of an internal
table is specified by the following three types:
'& Line fype—An intemal table has line type that can be any data
type. Usually, the data type of an internal table isa structure.
nan internal table, each element of a structure is a column.
Itcan also be another internal table.
1 Key—The key identifies rows of an internal table. Two types of
keysare available for internal tables: the standard key and the
user-defined key. The key can be specified either as UNIQUE
orNONUNIQUE. An internal table that contains a unique key
cannot have duplicate entries,
1 Table—The table type specifies how ABAP is accessing the
individual table entries. There are three types of internal
tables: standard tables, sorted tables, and hashed tables. Stan-
dard tables contain an internal linear index and a nonunique
key. A sorted table also contains an internal index. A table
index or key is used by the system to access the entries.
A hashed table is accessed only through a key. It does not
havea linear index4,
Differentiate between internal tables and extract
datasets.
Internal Table Extract Dataset
Ithas lines that alwayshave the | It has a group of data that always
same structure have different structures.
Itdefines the structureat the | Ithas noneed to define the
beginning, structure.
Itneeds a special workarea for _ | Ithas no need for a special work
the interface. area for the interface.
5.__What are the different types of internal tables?
1m Standard
1m Sorted
m Hashed
Explain the different types of internal tabl
Standard table—A standard table is suitable if an index is used
to address the individual entries. An internal index or key is
used to access it Itis filled by the APPEND statement. To read,
modify, and delete entries, an index is used with the relevant
ABAP command. As the number of entries increases, access-
ing time for the table also increases ina linear form.
© Sorted table—A sorted table is suitable when there is a need
for sorted entries. The TNSER” statement is used to fil this
table. A sort sequence, which is defined through a table key,
is used to insert entries in a sorted table. Because the system
uses binary search, the response time for accessing the table is
proportional to the number of entries in the table. The sorted
table has ether a unique o a nonunique key.
Hashed table—A hashed table is used when a user wants to
process a large amount of data. It is also used when a user
‘wants to use an internal table, which is similar to a database
table. It is suitable where key accessing is a major consider-
ation. An index cannot be used to access a hash table. The
response time is independent of the number of table entries
and the constant, as a hash algorithm is used to access the
table entries. The hashed table must have a unique key.7.__Whatis OCCURS used for?
OCCURS is used to guide the allocation of memory. If a num-
ber of table entries are unknown, OCCURS 0 is used. OCCURS 0
assigns 8 KB of memory at runtime.
Explain an internal table declared as a data object.
Internal tables can be declared directly as data objects using
the STATICS, CLASS-DATA, and DATA statements. Internal
tables in procedures can be created by using the STATICS state-
ment, and internal tables in classes can be created by using
the CLASS-DATA statement. Internal table data objects can be
declared using the DATA statement with all other local objects
in the program.
9. Whatis the editox-cal statement of an internal table
used for?
‘The edi tox-call statement is used to display the contents of
an internal table in an editor similar to the ABAP source code
folder. This statement is useful for debugging and serves as a
simple interface that allows a user to enter and modify data in
table form. The following is the syntax for the editor-call
statement
Editor-call for itab [title t] (display mode]
In the previous code:
tab is thename of an internal table.
mt denotes a literal, constant, or variable.
title defines the title of the editor-call screen,
.
display mode is used only for display and changes cannot
be made init,10.
What values can be set for SY-SUBRC after the
editor-call statement?
nu.
12,
After the editor-cal1 statement has been executed,
SY-SUBRC is set lo one of the following values:
Change and not saved: 4
Change and save: 0
Save without changing: 2
How is an internal table assigned?
‘The move statement is used to assign the internal table header
line or work area. Internal tables can be used as operands in the
move statement.
move to
=
‘These statements assign the header line of table to
table . The original contents of the table
are overwritten, After the table name, two brackets ({}) can be
placed to address the body of an internal table.
For what is the clear statement used?
Internal tables are initialized using the clear statement. Itis used
toeither delete all rows from an internal table or clear the header
line, The syntax of the clear statement is as follows:
clear clear [1
In the previous code:
MI isa header line.
1 [J is the body of the table.
clear clears the header line of the internal table.
If does not havea header line, it will delete the body
of the internal table.
clear [] deletes the body of the internal table, and
the header line remains unchanged. In both methods, the
memory remains allocated.13.__How can internal tables be compared:
Internal tables can be used as operands in the logical expression:
. .
For , all operators in comparisons between data
types can be used, such as £0, =,NE, <>, ><,GE, >=, LE, <=,
Gt, >, Un, <
The criterion for comparing internal tables is the number of
lines they contain. The more lines an internal table contains, the
larger the comparison. If two internal tables contain the same
number of lines, they are compared line by line, component
by component. If components of the table lines are themselves
internal tables, they are compared recursively.
14, How do you sort internal table:
The following statement is used to sort a hashed or a
standard table:
SORT [ASCENDING | DESCENDING]
(8 TEXT) [STABLE] .
It sorts the internal table in ascending order by its
key. Italways applies to the table itself, The order of sorting
is dependent on the standard key fields in the internal table.
ASCENDING and DESCENDING additions are used to specify the
direction of sorting, By default, the table is sorted in ascending
order. A sorted table cannot be sorted using the SORT statement,
as such tables are always in a sorted order automatically,
15. How do you insert a single line into an internal table?
‘The following syntaxis used to insert. single line into an internal
table:
INSERT <
ine> INTO [INDEX ).16.
17.
In this code:
Ml <1ine> is a work area that is compatible with the
line type.
(INDEX ] isan index value thats to be inserted.
What rules must be followed to insert lines into internal
tables?
Standard table—The line is inserted at the end of the internal
table. It has the same effect as the APPEND statement.
= Sorted table—Depending on the table key, a line is inserted
into the table. Duplicate entries are inserted above the existing,
entry with the same key if the key is nonunique.
Hash tabtes—A lines inserted into a hashed table according
tothe table key,
How is it possible to insert several lines into an internal
table from another internal table?
The following statement is used to add several lines into one
intemal table from another internal table:
INSERT LINES OF INTO [INDEX ]
‘This statement inserts the lines of the table one by one
into the table
When an index table is appended to another index table, the
lines are specified as follows:
INSERT LINES OF [FROM ] [70
] INTO [INDEX ]
andn2> specify the inclexes of the first and last lines of
TAB that are to be inserted into PTAB.18.
Give an example of inserting several lines into an internal
table from another internal table.
In this example, two internal tables are created with the same line
type. Four records are inserted into the first table and two
records into the table , and the second, third, and fourth
records of the table are inserted into the table in
the second row,
‘TYPES : BEGIN OF FS,
NAME (10),
DEPT (10)
END OF FS
DATA: ITAB TYPE FS OCCURS 0 WITH HEADER LINE,
PTAB TYPE FS OCCURS 0 WITH HEADER LINE
ITAR-NAME = 'Kingston'
TTAB-DEPD = I?"
APPEND ITAB.
ITAB-NAME = ‘Allen’.
ITAB-DEPT = ‘SALES.
APPEND ITAB.
ITAB-NAME = 'Verrnon'.
ITAB-DEPT = ‘IT’,
APPEND TTAB.
ITAB-NAME
ITAB-DEPT = IT".
APPEND TTAB
‘aLlexis'
PTAB-NAME = 'Adam'.
PTAB-DEPT = ‘ IT".
APPEND PTAB.
PTAB-NAME = ‘Attaccus'.
PTAB-DEPT = ‘IT!
APPEND PTAB
WRITE : / “Internal table : - TTAB".
LOOP AT TTAB .
WRITE : / SY-TABIX, TTAB-NAME, TTAB-DEPT.
ENDLOOP.
SKIP 2.WRITE : / ‘Internal table : - PTAB'.
LOOP AT PTAB.
WRITE : / SY~TABIX, PTAB-NAME, PTAB-DEPT.
ENDLOOP.
INSERT LINES OF ITAB FROM 2 TO 4 INTO PTAB
INDEX 2
SKIP 2.
WRITE: / ‘Internaltable: - PTAB After Insertion’.
LOOP AT PTAB.
WRITE : / SY~TARIX, PTAB-NAME, PPAB-DEPD.
ENDLOOP.
The output is as follows:
Internal table ; — ITAB
1Kingston, IT
2allen SALES
3Verrnon iT
dallexis iT
Internal table : - PTAB
Adam IT
2actaccus T
Internal table:
- PTAB After Insertion
Adam IT
2Allen SALES
3Vernon IT
4allexis IT
sattaccus IT19.
Whatis the collect: statement used for?
‘The collect statement is used to insert lines in a summarized
form into an internal table. The collect statement compares
the character fields of an internal table, and ifthe character fields
are similar, it adds the numerical value; otherwise, it inserts it as
anew row.
collect INTO .
In the case of an internal table with a header ine, the following
syntax is used:
collect
The following example fills a sorted table. The first two
collect statements work likénsertion statements. In the
third col Lect statement, the first line of TTAB is modified,
TYPES : BEGIN OF FS,
NAME (10) ,
DEPT(10) ,
EXPEN TYPE I,
END OF FS.
DATA: ETAB TYPE SORTED TABLE OF FS WITH NON
UNIQUE KEY NAME DEPT WITH
HEADER LINE,
ITAB-NAME = ‘Alex'
ITAB-DEPT = 'IT*
ITAB-EXPEN = 5000.
COLLECT TTAB.
TTAB-NAME = 'Herraldo'
ITAB-DEPT = ‘Sales’.
ETAB-EXPEN = 1000
COLLECT 1PAB.
TTAB-NAME = 'Herraldo'.
ITAB-DEPT = ‘Sales’.
ITAB-EXPEN = 1500COLLECT TTAB.
LOOP AT TTAB.
WRITE : / S¥-TABIX, ITAB-NAME, ITAB-DEPT,
ITAB-EXPEN.
ENDLOOP.
The output isas follows:
1Alex ir 5,000
2QHerraldo Sales 2,500
20. Whats the difference between the append statement
and the collect statement?
The append statement inserts one or more lines at the end of,
an internal table, and the collect statement inserts lines into
an internal table in a summarized form. The collect state-
‘ment compares the character fields of the internal table, and
if the character fields are similar, it adds the numerical value;
otherwise, it inserts it as a new row.
21. How do you read a single line of a table?
The read statement is used to read a single line from a
table. The following syntax is used to read a single line of
any table:
read table itab [into wal] [index idx | with
key keyexp (binary search) ]
In this code
1 itabis the name of an internal table.
wat is the name of a work area.
1 idxis an integer literal, constant, ot variable.
_ keyexp is an expression representing the value to be found.22.
23.
How do you make changes in the lines of an internal
table?
The modi ty statement is used to modify a single line of any inter-
nal table, The table key can be used to modify a single line. Ifa
table contains duplicate entries and a nonunique key, then the
first entry is changed.
modify table
E> <£>
itab> from [transporting
The work area is not only used for finding the line that is
to be changed, but also contains the new contents.
How do you delete lines in an internal table?
The delete statement can be used to delete a single line
(or more) from an internal table using an index,
Deleting a single line—The following statement is used to
delete a single line.
delete itab [index )
Inthis code, the deLete statement is used to delete a line from.
the internal table , which corresponds to the index
and reduces the subsequent number of lines by 1
Deleting several lines—To delete more lines, the following
statement is used:
delete itab [fron to ] where
In this code, the delete statement is used to delete all
lines from index to , which satisfies the given
condition.24. What is the refresh statement used for?
‘The refresh statement is used to delete all of the rows of an
internal table, but it does not release the memory space. It always
applies to the body of a table,
refresh
In this code, is an internal table with or without a
header line.
‘This statement refills an internal table immediately after
clearing it; therefore, the table contains no lines. The memory
already occupied, however, remains allocated to the table until it
is cleared. The header line remains unchanged.
25. _Whatis the free statement used for?
‘The fxee statement is used to delete all the rows of an inter-
nal table. Memory space is also released by using the free
statement. Like the refresh statement, it also works on
the body of a table, The header line remains unchanged if it
exists
‘The following syntax is used for the free statement:
free
In this code, is an internal table with or without a
header line.
26. How do you process table entries in loops?
‘The LOOP statement is used to read some or all rows from an
internal table,
Syntax:
LOOP AT
ENDLOOP.
In this code:
1 itabisthename of an internal table.
wal is the name of the work area
xan y are integer literals, constants, or variables.
expression denotes a logical expression.The lines of the table are read one by one and are processed
in the statements within the LOOP. . .BNDLOOP control
structure.
27. How do you determine whether an internal table is
empty?
‘The following statement is used to determine whether an internal
table is empty
if itab[] is initial
If the test is true, the internal table is empty. When the test is
false, it contains at least one row. Initial means that the internal
table is empty; that is, it contains only blanks and spaces.
28, _Whatis the describe table statement used for?
The describe table statement is used to fill the internal
table properties, such as the number of rows that exist, the
occur value, and the table type.
‘The following is the syntax of the describe table statement:
describe table itab(lines i] [occurs 3]
(kind t]
In this code:
tabs the name of an internal table.
and 5 are numeric variables, which contain the number of
rows in an internal table and the oceur value.
m ¢ is the character value, which contains the type of table,
such as $ for a sorted table, H for a hashed table, and T fora
standard table.
‘The describe table statement is used to fill the following
three system variables:
m cy-t8l1 determines the number of rows ina table.
lm sy-tleng determines the length of rows in bytes.29.
30.
lm sy-toccu determines the current value of the occur clause.
What are the control break statements in an
internal table?
The following are the different types of control break
statements in an internal table:
at first/endat
m at last/endat
Mat new/endat
at end of/endat
What is the syntax of theat first andat last
statements?
Theat first and at Last statements are used to perform
processing during the first or last loop pass of an internal table, The
following is thesyntaxof the at first and at. last statements:
loop at it.
--- "Enter your code here*
at fret
endat
at last.
endat.
endloop
In this code:
& itisan internal table.
~~~ represents any number of lines of code.31.
32.
What are the at first andat last statements
used for?
The following are the uses of the at first and at last
statements:
_abtistatement:
Loop initialization processing
Used to write totalsat the top of a report
Used for writing headings
at last statement:
Loop termination processing
Used for writing totals at the bottom of a report
Used for writing footers
What are the at new and at end statements
used for?
‘Theat new and at end statements are used to find a change in
a column from one loop pass to the next loop pass. These state-
ments low execution of code at the beginning and end of a group
of records. The following syntax is used forthe at new and at
end statements:
sort by c.
loop at it.
at new c.
endat
at end of c.
endat
endloop
In this code:it isan internal table.
1 cisa componentof it
~~~ represents any number of lines of code.
The lines of code between the at. new and at. end statements
are executed when the value of ¢ changes.
33. What are the rules for the control break
statements?
1M Theorderoftheat first andat last statements can be
interchanged,
HM Theat first,at new,at end of,andat last statements
always comein the sequence.
92 SAPABAP Questions ao ANsweRs
‘They cannot be used within the select statement. They can
be used within the loop at statement.
They can be used within the same loop at multiple places.
‘They should not be nested insicle one another.
No additions are used for these statements.
Internal tables must be sorted on the control field.
‘The first field must be a control field in an internal table.
34, _Whatis the sum statement used for?
‘The sum statement is used to calculate totals for the rows of a con-
trol level. The following is the syntax for the sum statement:
at first/last/new/end of35.
What is the on change of statement used for?
It is used to perform control break processing, It behaves like
the at new statement
The following syntax is used for the on change of
statement
on change of varl [or var2
else.
o--1
endon.
In this code:
vari and var? are variable or field string names.
©... .indicates that any number of ox conditions might follow.
= ~~~ represents any number of lines of code.If the value of any of the variables, such as var, var2, and so
‘on, changes from one test to the next, then the statements follow-
ing the on change of statement are executed; otherwise, the
statements following the e1 se statement are executed.
36. Whatis the difference between the on change of and
at_new field statements?
‘Activates when changing all | Activates when changing a
the fields particular field
Does not use any logical AND or OR logical expression can
expression beused
Cannot be used for the first | Can also be used for the first value
value of afield ofa field
37. How do you copy data from one internal table to another
ternal table using a body operator?
Data are copied from one internal table to another internal table if
two internal tables have the same structure. The following body
operator is used to copy data from one internal table to another
internal table:
ita = it2n.
‘The contents of the table it2 are copied to the table it 1. Any
existing contents in the table it are overwritten.CHAPTER 5
MODULARIZATION
M®DULARIZATION
Modularization is the process of dividing a large block of code
into small and manageable units. These units are known as
modularization units. The lines of codes are grouped and exe-
cuted when called. The code lines are like a microprogram that
can be called from any other program
2. What are the different types of processing blocks?
Advance business application programming (ABAP) programs
are mace up of processing blocks, which are modular in nature.
There are two types of processing blocks in ABAP-
1 Processing blocks that are called from outside the program
‘with the help of an ABAP runtime environment. These blocks
help in normal execution of ABAP programsand include the
following:
© Event blocks
© Dialog modules
Processing blocks that are called from ABAP statements in
ABAP programs. These include the following:
© Subroutines
© Functional modules
© Methods98
SAP ABAP Questions aND ANSWERS
What are the benefits of modularization in a processing
block?
Modularization of these processing blocks provides the
following benefits:
Prevents code redundancy
Increases the reusability of the source code
m Ensures easy readability of the program
Improves the program's structure
= Provides encapsulation of data
What are the modularization techniques in procedures?
The following are the various modularization techniques in
procedures:
1 Source code modules
Subroutines
Function modules
Explain the various modularization techniques in
procedures.
™ Source code modules—A series of ABAP statements are
placed in modules while modularizing the source code.
When you modularize source code, you place a sequence
of ABAP statements ina module. Then, instead of plac-
ing all of the statements in your main program, you just
call one module instead of calling all the statements. When
the program is executed, the source code behaves as if it
is actually present in the main program. By using source
code modules, there is no need to write the same set of
statements again, thus making the program easier to read
and understand. They are not used in modularization of
tasks and functions.
There are two types of source code modules in ABAP:
© Local modules
© Cross modules1 Subrowtines—Subroutines are procedures that can be defined in
any ABAP program and can be called by any ABAP program.
‘They are mainly for local modularization, which means that
they are usually called from the programs by which they are
defined. Subroutines are normally called internally, as they
contain sections of code or algorithms that are used locally.
Function modules—Function modules are procedures that are
defined in function groups and can be called from any ABAP
program. They are used forglobal modularization,as they are
always called froma different program. They must be defined.
ina function group. Function groups act as a container for
defined function modules, where a function builder is used to
_generate the function group and the function modules.
What are the various types of subroutines?
There are two types of subroutines:
© Internal subroutines
m External subroutines
How do you define and call an internal subroutine?
Subroutines are defined at the end of a program after all events
are executed. They cannot be nested inside the events that
are to be executed, Subroutine definitions cannot be nested.
An internal subroutine supports recursion, as it can call itself
ora subroutine that calls it.
Syntax:
PERFORM... [USING ......1
CHANGING...
.
How do you exit from a subroutine?
Any one of the following statements can be used to exit from
a subroutine:
= Exit—This statement removes control froma subroutineand
processes the next executable statement appearing after the
pey form statementcheck—This statement also takes the control out of a
subroutine immediately and processes the next executable
statement
1 Stop—This statement immediately stops a subroutine and
moves to the end-of select ion event.
How do you define an external subroutine?
10.
subroutine thal resides ina program other than the per-foxm
statement is known asan external subroutine.
Syntax
Perform (Prog)
How do you call an external subroutine?
The following are the steps for calling external subroutines:
An external program that contains the subroutine is loaded
in the application,
The syntax of the entire external program is checked.
Control goes to the £oxm statement in the external program.
The statements that are in the external subroutines are
executed.
| endform retums control to the statement after the perform
statement.
What is the syntax for the form statement?
‘The formstatement is used to specify the beginning of a subroutine
and the end of the preceding event. The syntax of the Form state-
ment is as follows:
form [tables tabl tab? ...] (using
ust value(us2) ...] [changing
chi value(ch2) ...1.
endforn.12.
In the previous code:
lm is the name of the subroutine.
@ tabl, tab2, usl, us2, ch1,and ch? are the names of the
parameters,
The following are some of the rules of the f
1 Alladditions are optional.
When theadditions are coded in the statement, tables must
come first, followed by using, and then changins.
Each addition can occur only once in the statement.
statement:
Parameters are not separated by commas.
The user can only specify tables as internal tables (not as
database tables) in the statement.
™ A subroutine can invoke other subroutines used in the
program.
A subroutine can call itself or a subroutine can be called by
other subroutines.
A subroutine cannot be embedded within another subroutine.
What is the syntax of the perform statement?
The perform statement is used to calla subroutine ina program.
‘The syntax of the per form statement is as follows:
perform x) sub
y) p of subl sub? sub3
[tables tabl tab? ...1
[using us us2 ...1
[changing chi ch? ...1.
In the previous code
sub, sub1, sub2, and sub3 are the names of the
subroutines
isa numeric variable
1 x) andy) are statements that are mutually exclusive
The following are some of the rules of the perform statement:
tables, using, and changing can appear with either
x) ory)13.
14.
The addition value () cannot be used with the perform
statement, as it is used with the £orm statement.
What are the different types of parameters?
‘There are mainly two types of parameters:
© Formal parameters—Formal parameters are those parameters
that are defined with the FOR statement. These parameters
are defined when the subroutines are defined.
Actual parameters—The PERFORM statement is used to define
actual parameters. When subroutines are called, these param-
‘eters come into action,
What is a typed parameter? Explain it with syntax.
Atyped parameter is a formal parameter. It has a data type after
its name in the form statement. The following is the syntax of a
typed parameter:
form si using usi type tl value(us2)
type t1
changing cel type ti value(cs2) type tl.
pL -> Subroutine name
uel, us2, esl, and cs2 -> They are formal
parameters.
tL -> It is either an ABAP/4 data type or
a user-defined data type.
What are the advantages of typed parameters?
© They prevent coding errors, as the syntax checker will point
‘out the error if it passes an incompatible parameter.
© They prevent runtime errors if there are any untyped vari-
ables accepted by the program.
© They are more efficient, as less processing is required to
allocate memory for them.16.
17.
18.
19.
Name the additions that are used to pass field strings.
‘The following two additions are used to pass field strings:
m Likex
Structure x
x can be a field string, table, or Data Dictionary (DDIC)
structure.
Whats an untyped parameter?
An untyped parameter is a formal parameter. It does not have
data type after its clefinition in the form statement. Untyped
parameters allow variables of any data type and length.
What are the various methods of passing parameters to
a subroutine?
‘There are three methods of passing parameters to a subroutine:
1m Pass by reference
1m Pass by value
® Pass by value and result
What is meant by pass by reference?
When the address of an actual parameter is passed to a formal
parameter, then tis called pass by reference. If changes have been
‘made to the formal parameter, the actual parameter is changed,
too. Actual parameters do not have their own memory.
The following is an example of pass by reference:
report 2tpbr.
DATA NAME(15) VALUE ‘Jack Kapson'.
WRITE: / ‘Before Perform statement’, NAME.
PERFORM Al USING NAME.
WRITE :/ ‘After Perform statement’, NAME.20.
FORM Al USING Ri.
RI sel ita’
ENDFORM.
‘sack
Output:
Before Perform statement Jack Kapson
After Perform statement Jack smith
What is meant by pass by value?
In pass by value, only a copy of the actual parameter is passed
to the formal parameter. When changes have been made to the
formal parameter, the actual parameter value is not affected; it
remains the same. Formal parameters have their own memory
to store parameters.
The following is an example of pass by value:
report 2pass_value
DATA NAME(20) VALUE ‘Nadia Serugg*
WRITE :/ ‘Before Perform Statement", NAME.
PERFORM Al USING NAME. WRITE :/'After Perform
Statement’, NAME. FORM
Al USING VALUE(C NAME). C_NAME = ‘Paula Adams".
WRITE :/ ‘Inside Form Statement C_NAME", C_NANE.
WRITE :/ ‘Inside Form Statement NAME", NAME.
ENDFORM
Output:
Befoze Perform Statement Nadia Serugg
Inside Form Statement C_NAME Paulla Adams
Inside Form Statement NAME Nadia Scrugg
After Perform Statement Paulla Adams
What is meant by pass by value and result?
In the pass by value and result method, a copy of the actual
parameter is also passed to the formal parameter. At the end22.
of the program, changes that have been made to the formal
parameter will be copied to the actual parameter. Formal
parameters have their own memory.
The following. is an example of the pass by value and result
method:
report 2t.
DATA: NAME (15) VALUB ‘Ashton Kerry’
PERFORM: Al CHANGING NAME,
22 CHANGING NAME.
END-OP-SELECTION,
WRITE: / ‘Stopped. NAME =", NAME.
FORM Al CHANGING VALUE(R1) .
Rl = "Vickie K
ENDFORM.
FORM A2 CHANGING VALUE(R1}
y'
Rl = ‘Valerie Kerzy'.
STOR.
ENDFORM.
Output
Stopped. NAME = Vickie Khare
What is a function module?
23.
Procedures that are defined in a special ABAP program are
called function modules. These modules can be called from all,
ABAP programs. A fuatction group acts as a container for func
tion modules that relate to each other. A friction builder is used
to generate a function group and function modules. There is no
need for a function builder to test these modules.
Which transaction code is used to create a functional
module?
‘The SE37 transaction code is used to create a functional module.24.
25.
26.
27.
What are the benefits of function modules?
| Support encapsulation and reuse of global functions
Ensure database updates
&™ Support remote communication between different SAP
systems or ERP systems and non-SAP systems
Support exception handling
What are the statements used in a function module?
Data statement—Used to define local variables that are initial-
ized again in a function module.
Statics statement—Used to define local variables that are
allocated the first time a function module is called.
What is the function module interface?
It is an interface that is used to pass a parameter to a function
module. It describes the parameters passed to and received
from a function module.
What are the various parameters used in a function
module?
‘The following are the parameters used in a function module:
Inport parameters—Variables that contain values passed into
function modules from the calling program are known as import
parameters, Values contained by these parameters are gener
ated outside of the function module and are imported into it
Export parameters—Variables that contain values returned
from function modules are known as export parameters.
Values contained by these parameters are generated
within the function module and are exported out of it
© Changing parameters—Variables that contain values that are
passed into function modlules are known as charging param-
eters, These values are changed by the code within a function‘module and then returned. Values contained by these param-
eters are generated outside of the function module.
1 Table parameters—These are internal tables that are passed on
toa function module, changed within it, and returned. Table
parameters must be defined in the calling program.
Exception —This is an error generated within a function
module.
Source code—This uses variables defined in import, export,
and changing parameters for coding,
28. What are the methods of passing parameters in a
functional module?
‘The methods of passing parameters in a functional module are
as follows:
Using import and export parameters—These parameters are
passed by value.
Using changing parameters—These parameters are passed by
value and result
1 Using internal tables—These parameters are passed by
reference.
29. How do you call a functional module in an ABAP
editor?
A fanctional module is called in an ABAP editor by clicking,
the patien button,
30.__What are table parameters?
These are internal tables that are passed on to a function
module, changed within it, and returned. The internal table
must be defined in the calling program.
31. Whatis a function group’
A fuection group is used as a container for function modules. It is
created by using transaction code SE80. Twenty-six characters are33.
34.
allowed for naminga function group. There is automatic generation
of the main program, which includes programs present atthe timea
function group is created in the function builder. A function group
isalso used to contain screens, Bither a dialog module or an event
block in the function group is used to process the user input. These
are special include programs in which the user can write code.
What are include programs?
Inclucle programs are cross-programs in which modules of source
cocte can be used by another program. These are mainly used for
modularization of source codle that has no interface-containing,
parameters. These are global SAP ERP repository objects.
What is the syntax of the include statement?
The syntax of the include statement isas follows:
include iprog
In this code, iprog is a type i program.
‘The following are some rules of the include statement:
= An jinclude program must be type i. A program type must be
specified in the type fie in the program attributes screen,
= A.user can use this statement in one or more including
programs.
'® Partial or incomplete statements cannot be included in a
program of type i
What are the functions of include program
The functions of include programs are as follows:
1 Library—In library functions, include programs help by using
the same source code in different programs. This technique is
very useful if a programmer is using a lengthy data declara-
tion in different programs.
§ Onder—For performing complex functions, an order function
is used. The different parts of programs that belong to each.
other are stored in include programs in an orderly way. Theseare not loaded at runtime but rather are expanded at the time
of program generation,
“Include programs” is called in a program by the following
statement:
INCLUDE
35._ Explain system variables
SAP defines some variables internally that are called system vari
ables. These variables are used by a function module to retrieve
certain information. These variables are also used in some formu
las. The following are the system variables available in SAP:
m s¥_TEST Refers to the status of a PI sheet, whether active
(or test in functional modules.
S¥_MODE—Also used in functional modules and signifies the
current mode of a PI sheet.
S¥_RoW—Refers to the current table line of functional
modules,
= SY_VALUE OR X—Generally refers to the input value
immediately preceding it
36. What are macros?
Macros are local modules of a source code program. A macro is
used to store statements that are needed frequently in a program,
‘A macro is used in the program in which itis defined.
37.__Whatis the syntax for d
DEFINE .
.
END-OF-DEFINITION
Statements specified between the DEFINE and END~
OF-DEFINITION statements can contain up to nine
placeholders.CHAPTER 6
QGICAL
DATABASESlocicAL DATABASES
Define a logical database.
A logical database is a special type of ABAP program used to
retrieve data from a database and make it available to appli-
cation programs. A logical database links database tables to
executable ABAP programs to read data from the tables. Logi-
cal databases contain OpenSQL statements that read data from
the database. Asa consequence, you do not need to use SQL in
your own programs. A logical database helps provide a par-
ticular view of the database tables in the ERP system. The data
structure that is available in a logical database is hierarchical
innature.
What are the advantages of a logical database’
lm Ithelps in selecting correct and meaningful data.
im Ithasan easy-to-use standard user interface.
m It helps in data retrieval without the need for any
programming.
For accessing the database, it provides checks that are centrally
authorized
m It helps in maintaining a hierarchical view of data while
retrieving data from databases.What are the
isadvantages of a logical database?
1 Ithas slow retrieval of data, as all of the tables at an upper
level will have to be read if the user wants to read the tables
at the lowest level of the hierarchy.
A llogical database in a program has to be specified every time
so that the GET event occurs.
What are the main components of a logi
database?
m Structure
® Selection part
Database program
Expl
in the main components of a logical database.
1m Siructure—The structure defines the data view of the logical
database. Itcetermines the database table that can be accessed.
Italso ascertains the behavior of the logical database and the
structure of other components at runtime, The hierarchical
structure of a logical database decides the sequence in which
data are accessed by users,
1m Selection part—The selection part is used to define the input
fields for the data selection. The data are displayed on the
selection screen in the runtime environment on the execution
ofa program that is linked to a logical database. The selection
canbe changed according to the requirement.
Database program—The database is a container of the ABAP
statements used to retrieve the data and send it to the user.
It contains special subroutines that are called in a predefined
sequence in the runtime environment by the reporting
processor.
What are selection views?
A collection of fields from different database tables is called
selection views. Using dynamic selections, the extra selections
for fields ina selection view can be defined. The extra selectionsare sent to a database that helps to minimize the number of
database accesses.
What are the tasks of a logical database?
Defines the seme user interface—A logical database has built-in
selection screen; therefore, it defines the same user interface
for several programs.
Improves performance—A logical database improves response
times, as it uses joins instead of nested SELECT statements.
Reads the same data for several programs—There is no need
for individual programs to know the exact structure of
the relevant database tables. During the GE event, a logi-
cal database reads the database entries for the individual
programs
8.__ Explain the two events use
a logical database.
1 GET—The GE? event is executed when a line is read by a
logical database from the node table. The data for this record
are loaded into the table work area. They are then passed.
on to a program that is declared using the NODES
statement. This statement is helpful in determining the limit
of the returned logical table, A GB event keyword can be
coded only once for any one table in the logical database
program.
= PUT—The PUP statement is used to direct program flow
according to the structure of the program,
9. Whatare the common subroutines contained by a logical
database (LDB) program?
The following are the common subroutines contained in an
LDB program:
FORM LDB_PROCESS_INIT
FORM INIT
= PORK PEOFORM LDB_PROCESS_CHECK_SELECTIONS
FORM PUT_
FORM AUTHORITY_CHECK_
FORM PUT__SP
FORM BEFORE_EVENT
FORM AFTER_EVENT
10. What are the two ways of using a logical database?
Linking a logical database to an executable program
Calling a logical database using a function module
11. How do you link a logical database to an executable
program?
In the program attributes, the name of the logical database is
specified to link a logical database to an executable program,
The subroutines of the logical database program and the event
blocks of the executable program form a modularized program
to read and process data.
Program attributes contain selection fields from the logical
database and also from the program itself; therefore, a user can
specify which of the logical database selections are relevant tothe
program and should appear on the sereen.
‘The runtime environment executes a series of processors. The
ABAP code shows the processing blocks in the following steps:
1. Initialization before a selection screen is processed.
Subroutine:
FORM INIT
Before displaying the selection screen, this subroutine is
called only once.
Event block:
INITIALIZATION.
Before displaying the selection screen, this event occurs
only once.2. Process before output (PBO) of the selection screen
initialization.
Subroutine:
FORM PBO.
Each time this subroutine is called the selection screen
appears.
Event block:
AT SELECTION-SCREEN OUTPUT,
Each time this event is called the selection screen
appears.
3. Theselection screen is then displayed, and the user can enter
data in the input fields appearing on the screen.
4, Input help (Fa) or field help (FI) requests.
Subroutines:
FORM _VAL
FORM _VAL.
FORM -LOW_VAL,
FORM -HIGH VAL.
Event blocks:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
-Low.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
12.
For maltiple selections: AT SELECTION-SCREEY
ON END OP
For all user input: AT SELECTION-SCRREN.
6. Processing before reading data,
Subroutine:
BEFORE EVENT 'START-OF-SELECTION'
Event block:
START-OF-SELECTION
7. Reading data in the logical database.
Subroutine—The logical database reads the selected data of
the node in the subroutine.
FORM PUT_
Event block: This event is triggered by the PUT statement in
the subroutine given previously.
GET (LATE)
8. Processing after reading data.
Subroutine:
APTER EVENT 'END-OF-SELECTION' .
Event block—It is the last reporting event.
END-OF-SELECTION,
What are the authorization checks available in a logical
database?
Anauthorization check is placed on the subroutines and event
blocks. The AUTHORITY CHECK statement is used to place
authorization checks.
Subroutines in a database program:
m Ar
AUTHORITY_CHECK 13.
14.
15.
Event blocks in an executable program:
= AT SELECTION-SCREEN
MAT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON END OF
GET
How do you call a logical database using a functional
module?
‘The LDB_PROCESS functional module is used to calla logical data-
base. A user can call more than one logical database from the same
program. A selection screen is not displayed by using the L05_.
PROCESS functional module, A selection screen is filled by using the
interface parameter of the functional module. A logical daiabase does
notexecute any G2T events.n the calling program; however, it passes
the data back tothe caller in callback routines in the program,
What are the parameters of the LDB_PROCESS functional
module?
Import parameters,
Table parameters
What are the various import parameters?
1 LDBWAME—The name of a logical database.
1 VARTANT—The name of a variant. Itis used to fill the selec-
tion screen of a logical database. It must be assigned to the
database program of the logical database.
1 EXPRESSTONS—This is used to pass extra selections for the
nodes of the logical database. The selection of nodes must
bbe dynamic. The data type of the RSDS_TSXPR parameter is
defined in the type group RSDS.
H_PTELD_SELECTTON—This is used to pass a list of required
fields for the nodes of a logical database where dynamic
selections are allowed. The data type of the parameter is the
RSPS_PIELDS deep internal table.16. What are the various table parameters?
1 CALLBACK—This is used to assign callback routines to the
names of nodesand events. It determines the nodes ofa logi-
cal database that eadls the data. Italso determines when the
data are passed back to the program.
Ml SELECTTONS—This is used to pass input values for the fields
of the selection screen of a logical database. The data type of
the parameter corresponds to the RSPARAMS structure in the
ABAP dictionary.
17. Whatare the exceptions of the LDB_PROCESS functional
module?
LDB_ALREADY_RUNNING—If a logical database process
is already running, it may not be called again. If such an
attempt is made, the LD3_ALREADY_RUNNING exception is
executed.
1 _LDB_NOT_REENTRANT—This exception is triggered to pre-
vent repeated calling of a logical database. A logical data-
base may be called repeatedly only if its database program
contains the LDB_PROCESS_INIT subroutine; otherwise, this
exception is triggered.
1 LDB_SELECTIONS_NOT_ACCEPTED—This exception is tri
gered for error handling in the LDB_PROCESS_CHECK_
SELECTIONS subroutine of the database program ina logical
database.18.
How do you create a logical database?
1
10,
IL
Open the initial screen of the logical database builder. Enter
name, and click Create.
Enter ashort description when the dialog box appears.
After entering the short description, define the root node of
the logical database. Enter the node name and its attributes.
‘The structure editor of the logical database builder appears,
On the left is the name of the root node.
Click the right arrow on the application toolbar, and then
click Next screen. It is used as search help for the logical
database.
.. Click the right arrow on the application toolbar, and then
click Next screen. A dialog box appears, Itis used to generate
the selections for the logical database.
In the ABAP Editor, the generated selection include is dis-
played. It can be changed later on.
Click the right arrow on the application toolbar, and then
lick Next screen. A dialog box appears. Itis used to generate
the database program for the logical database.
‘The generated database program is displayed in the ABAP
Editor. Itcan be changed later on.
Click the left arrow on the application toolbar Ifthe previous
screen is chosen repeatedly, then it is used to display and
change the general attributes of the logical database.
Optional selection texts and documentation are saved.MAPTER 7
FORMS
Forms
What is SAPscript
SAPscript is a word-processing tool used within the SAP ERP
application to manipulate and display text. It is SAP's own
text-processing system, which is provided by the SAP object for
creating documents that have a uniformly defined layout, such
as tables, logos, invoices, and so forth. These layouts look like
preprinted documents, SAPscript is an integrated tool for form
printing and text entry. It is usually provided by SAP.
2. Whyis SAPscript needed?
SAPscript is needed to display the ABAP program output in
a predesigned format that cannot be obtained through normal
ABAP code.
What are the advantages of SAPscri
Ithelps the developer by formatting a program's output.
It provides more control methods for formatting fonts and
Paragraphs.
SAPscript forms provide standard graphic elements,
SAPscript forms are event triggered, which means that they
are updated as the document is saved.4,__ What are the main components of SAPscript?
Editor
Styles and forms
Composer
Programming interface
Database tables
Explain the various components of SAPs
© Editor—The editor is used to enter and edit lines of text. Ibs
automatically called by the application transaction if the user
decides to maintain text that concerns an application object.
1 Siyles and forms—These are used for print layout, created using,
the corresponding maintenance transaction, and allocated to
text later.
' Composer—This central output module, which is not visible on
the outside, prepares text fora certain output device by includ-
{ng the corresponding formatting information. This informa-
tion comes from the style and text allocated to the text
Programming interface—It is used to include SAPscript
components in application programs. It is also used to control
the output of forms within the program.
Database tables—These tables store texts, styles, and forms,
How do you create SAPscript forms?
SAPscript forms are ereated in two ways
1 Select Tools > SAPscript > Forms.
Directly call transaction SE71
7. What are the vi
jous parts of an SAPscript form?
Header data
Paragraph and character formatsWindows and text elements
™ Pages
® Page windows
Explain the various pars of an SAPscript form.
Header data—The header data of a form consist of global data,
‘such as the page format used and the initial font chosen. It
also includes the name of the form, its description, the form
class, and the status
1 Paragraph and character formats—These are used to format texts
in forms,
Windows and fext elements—In forms, there are individual
text areas. To provide these areas with text, the areas must
be defined as output areas. An output area is called a
wintdow. Text elements are part of the form and are stored
together with the other form elements. Text elements
are named, and these names are used to refer to the text
elements later.
Pages—The individual pages of a document have different
layouts. The first page is different from subsequent pages.
Pages also have names. These names need to specify the
subsequent page in case of a page break,
Page windows —Page windows are required for the alphanu-
‘meric form painter only.
What is a layout set?
A layout set is a template that is created by SAPscript-format
extracted data. It is created in the SAP ERP system by using,
transaction SE71. A layout set is used by every SAPscript,
document to define and format its form. It defines the physical
appearance of a form that is to be printed. It also specifies the
structure of a document. It contains the predefined text modules,
that are used for different applications. When modifications in
the text, fonts, tabs, and paragraphs are needled, the layout set
is changedM.
12.
13.
Explain the Visual Composer.
‘The Composer receives every command inserted using the
SAPscript programming interface. It receives the layout
information from the layout set specified by the output program.
The documents are formatted according to the information
specified in the layout set. Ifa document contains any variable,
then it is replaced by the Composer with the data provided by
the SAP ERP system. The final appearance of a document is
a combination of the output program and the corresponding,
layout set. The output program provides the completion of
the layout set, after which the composer sends the completed
document to the printer spool.
What are the components of a layout set?
‘The main components of a layout set are as follows:
= Header
1m Pages
m Windows
m Page windows
Paragraphs
1m Text elements,
Character strings
What is a window?
‘The predefined area of a layout set is called a window. Windows
are text modules containing text that are positioned on a docu-
‘ment page. Only one window can be created, for each page, and
each window must have a unique name,
dow?
Whatis a page
A page window is the rectangular output area determined
by the left upper edge and the height and width of the area14.
15.
It determines which windows appear on a page and their
sizes and positions. Thus a page window determines the
following points:
The windows that appear on a certain page
The windows’ width and height
The distance between the left upper window edge and the
left and upper page margins
For what is a page window used?
A page window is used to determine the following points:
Left margin
| Upper margin
1 Window height
Window width
How do you call a subroutine in an SAPscript form?
The command line Put Perform statement is used to call a
subroutine in an SAPscript form,
Syntax:
Performesubroutine name> Sn
gram <'Program nane'>
using .
Changing
Ina program:
FORM TABLES
STRUCTURE ITCSY.
ENDFORM.
_TAB>
In this code, STRUCTURE. TTCSY consists of two fields: NAME
and VALUE.16.
By using the Loop at statement, we can find the field name
and the value of the parameter passed in the subroutine that is
used within the form and the end £orm statement.
Example:
In an SAPscript form:
PERFORM GBT_ITEM DELIVERY_DATE IN PROGRAM
*ZPO_SCRIPT"
USING GEKKO-EBELNE
USING &EKPO-EBELPE
CHANGING &DEL_DATER
CHANGING @I7M_TxTE
Ina program:
FORM GET_ITEM_DELIVERY_DATE TABLES IN_TAB
STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
LOOP AT IN_TAB
IF IN_TAB-NAME = ' EKKO-EBELN*
PO_NUM = IN_TAB-VALUE.
ELSEIF IN_TAB-NAME = 'EKPO-EBELP’.
PO_ITEM = IN_TAB-VALUE.
ENDIF.
ENDLOOP.
Describe the window types in SAPscript.
-MAIN—In this window, the output is continuous text. [tis
used by a layout set and dialog users of the output program,
_ VAR—This window contains variables. Itis formatted for each
page. The text can differ on each page in which the window
is positioned.
& CONST—This window contains constants. It is formatted
only once.17.__ What is an SAPscript control command?
An SAPscript control command is used to control the formatting,
of the output. These commands are processed by the SAPscript
‘Composer. These commands are not interpreted by the SAPscript
Editor,
18. What is the syntax of the NEW-PAGE command?
‘The NEW-PAGE command is used to place an unconditional
page break anywhere in the text, This command completes the
current page.
Syntax
7 NEW-PAGE [pagename]
Define the PROTECT. . . ENDPROTECT command.
This command is used to prevent the break of a paragraph.
It acts like a conditional NEW-PAGE command. The condition
is whether the lines enclosed between the two commands fit
in the space remaining in the current main window. Putting
the text within this command prevents the breaking of text
across multiple pages. If this attribute is set, then the output of
the paragraph is displayed on a single page. It is applied to a
particular paragraph only. If there is not enough space for the
entire paragraph to be printed in the space remaining on the
page, then the entire paragraph is printed on the next page.
The text lines to be protected are enclosed between the two
commands.
Syntax:
(+ PROTECT
/+ ENDPROTECT,21.
22.
23.
For what
the NEW-WINDOW command used?
The NEW-WINDOW command is used to call the next main
window explicitly. It calls the next main window even if the
main window is not yet full. It performs the same function as
the NBii-PAGE command if a user is in the last main window
of the page.
Syntax
73 NEW-WINDOW
For what is the DEFINE command used?
‘The DEFINE command is used to assign values to variables
permanently. When the text module is called again, the values
are available again.
Syntax:
(; DEPINE &symbol_names = ‘value’
For what is the SET COUNTRY command used?
The SBP COUNPRY control command is usedl to choose a formatting
option other than the one specified in the user master record.
Syntax
72 SET COUNTRY country key
For what is the SET SIGN command used?
These? SEGN control command is used to set the sign explicitly:
Syntax:
7+ SBD SIGN LEPT: The leading sign appears to the left of
the number.
/+ SED SIGN RIGHT: The leading sign appears to the right
of the number.24,
For what
the RESET command used?
The REED control command is used to reset the numbering of
an outline paragraph to its initial value.
Syntax
(+ RESET paragraph_format
the INCLUDE command used?
25,
26.
For what
‘The INCLUDE control command is used to include the contents
of another text in the current text
Syntax
7; INCLUDE name [OBJECT 0] [ID i] [LANGUAGE 1)
PARAGRAPH p]
NEW-PARAGRAPH np)
For what is the STYLE command used?
27.
‘The STYLE command is used to change the style within a
text
Syntax
7: STYLE style
For what is the TOP... ENDTOP command used?
‘The TOP. . .ENDTOP control command is used to specify lines
of text that should always appear at the top of the main wi
dow. These text lines are also known as header texts,
Syntax:
fs TOP
(+ ENDTOP28.
29.
30.
For what is the BOTTOM command used?
The BOPTOM command is used to specify footer texts for the
main window. This text is always printed at the bottom of the
window.
Syntax:
7+ BOTTOM
ENDROTTON,
For what is the IF control command used?
‘The TF control command is used to specify that certain text lines
should be printed only when certain conditions are met. If the
logical expression contained within the 1F command is true, then
the text lines enclosed by the IF... ENDIF command pair are
printed. Otherwise, they are ignored.
Syntax
7+ IF condition
(+ ENDIF
For what
the CASE command used?
The CASE command is used to cover a special case of the
multiple-cases IP command, The CASE command allows a
given symbol to be tested against specific values until a match-
ing value is found.
Syntax:
CASE symbol
/: WHEN value 1
/ WHEN value 231.
32.
33.
/) WHEN value n
7+ WHEN OTHERS.
/: BNDCASE
For what is the PRINT-CON'TROL command used?
This command is used to call certain printer functions from an
SAPscript text.
‘The name of the print control is specified either with or with-
‘out inverted commas.
Syntax
For what are the BOX, POSITION, and SIZE commands
used?
‘The BOX, POSTTTON, and $122 commands are used for draw-
ing boxes, lines, and shading for particular windows within a
form or passage of text.
Syntax:
BOX [XPOS] [¥POS] [WIDTH] [HEIGHT] (FRAME)
INTENSITY]
POSITION [KORIGIN] [YORIGIN] [WINDOW]
PAGE]
{+ SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
/
For what is the SUMMING command used?
The stnartNc command is used to accumulate a total value for
a program symbol. The command should be specified just once.
Each time the specified program symbol is then formatted, its
current value is added to the total symbol.
Syntax:
{+ SUMMING program_syrbol INTO total_symbol34, What are the various SAPscript symbols?
There are four types of SAPscript symbols:
m System symbols
Standard symbols
= Program symbols
m Text symbols
35. What are the vi
5 jous system symbols?
Current date
(Current day number
(Current month number
(Current year number
Current day name (long form)
‘Current month name (long form)
(Current time
Hours component of current time
Minutes component of current time
Seconds component of current time
Current page number
Page number of the next page
Selected device type
Spaces
Underline
Vertical line
36. What are the formatting options in SAPscript?
Offset
Output length
Omitting the leading sign
Omitting leading zeros
Suppressing output of initial values37.
38.
1m Ignoring conversion routines
Changing the value of a counter
Preceding and subsequent texts (pre-text/post-text)
1m Date mask
m Time mask
For what is offset used?
O££set is used to prevent the display of a certain number of
bytes of the symbol value, starting with the first byte on the
left. Nothing is printed if the offset specified is greater than the
length of the value.
Syntax:
esymbol offs!
What is an output length specification?
An output length specification is used to define how many
bytes of a value should be copied.
Syntax
sym
For example
Tf has the value 56789.
esymbol (6)& -> 56
(aye -> 5678
kaymb
How can you omit a leading sign?
The s option is used to ensure that the value is formatted with-
out the sign
Syntax:
kaymbol (8)40.
41.
42.
43.
it a lea
How can you o1 1g zero?
‘The 2 option is used to omit a leading zero.
Syntax
symbol (2)&
For example:
‘The current date is 6.9.2009
smonthé -> 09
& month(2)& -> 9
How can you ignore conversion rules?
‘The K option is used to ignore conversion rules
Syntax:
koymbol (K) &
What is page layout?
Two windows are displayed in page layout:
The administration sereen—This screen is used to determine
the administration information in the header data and to
set the basic settings of the form. Values are entered directly,
in the administration screen,
1m The desigi rwindowo—This window is used to design the page
layout. [tis used to determine the layout of the different out-
put areas graphically
What are elements?
Elements are predefined text components that are determined
in the layout set definition and can be accessed with one name.
They are related to the window in which they are defined and.
have to be called explicitly. The window MAIN is always the
defautt.44.
45.
46.
47.
48.
What is the procedure to debug an SAPscript?
Debugging of a script is done in two ways:
In the form, go to Utilities > Debugger.
Another way isto puta breakpoint in the print program wher-
ever there is a need to stop the execution. Then go to SE71,
and enter the form name. Go to the Utilities > Active Debugger
option. After that, go to SE38. Enter the print program name,
and execute the program. Now debugging of the script is pos
sible both page-wise and window-wise.
How do we set date and time formats in SAPscript?
The date and time formats in SAPscript can be set as follows:
M / : SBD TIME MASK—controls the time field format
= / : SBP DATE MASK—controls the date field format.
For example, Set Time Mask = °HH:xM”
In what format does SAPscript store text?
SAPscript uses the Interchange Text Format (ITF) to store text.
SAPscript also provides conversion programs for the Rich Text
Format (RTP) and ASCII as an interface to other word processors.
What is the function of the Compare tool in SAPscript?
The Compare tool is used to compare abjects across clients. It
can copy styles, layouts sets, and documents. The Compare tool
does the following tasks:
Shows the various versions of the object
Verifies the existence of objects in both clients
Whats the procedure for creating and inserting logos in
SAPscript?
‘The following are two ways of creating and inserting logos in
SAPscript.The first procedure is
1 GBM
Click Insert.
Click Graphics.
Click stored Document Server.
Click Execute.
6. Select the Name BMAP.
The second procedure is,
1. Draw the picture to be inserted,
Save it.
Go to SE78,
Type the name and select color.
Click Import
Browse for the picture.
Nousen
Press Enter.
49. What are the functions of SAPscript?
‘There are three different functions used in SAPscript:
™ OPEN_FORM,
1 URITE_FORM,
1m cLOSE_FORE,
50._What are the parameters used in SAPscript functions?
@ OPEN_PORM—In this module, the name of the layout set that
is to be opened is given. Parameters used in this functional
module are
© Exporting
© Form
© Language
= WRIPE_FORM—This module is used to display the data. The
element name and window are specified. Parameters used in
this functional module are© Exporting.
© Blement
© Window
CLOSE_FORM—This module is used to close the form after
displaying or printing thedata
51, What are SAP Smart Form:
SAP Smart Forms are a new-generation GUI tool used to
create and maintain forms quickly for mass printing. This
feature is an enhancement to earlier printing technology in
SAPscript. SAP Smart Forms allow simple modifications to
forms and in form logic by using simple graphical tools, with
little programming effort required. Thus, a user without any
programming knowledge can easily configure forms with
data from an SAP system for relevant business processes.
SAP Smart Forms also support the Internet as an output
‘medium,
52.__What types of tables are included in a Smart Form?
Both static and dynamic tables are included in Smart Forms.
Ina static table, the size is predetermined, whereas in dynamic
lables, the size is determined at the time of output
52._ What types of tables are included in a Smart Form?
Both static and dynamic tables are included in Smart Forms.
Ina static table, the size is predetermined, whereas in dynamic
tables, the size is determined at the time of output.
Describe the features of Smart Forms.
The following are some of the features of Smart Forms:
© Components are easy fo create—A combination of a graphi-
cal painter, context menu, and tree structure gives an easy
representation of the form flow, tables, templates, and
program lines.
1 Colors—Smart Forms allow color in forms. Texts can also be
written in various colors.
Client independent—There is no need to transport forms
between different clients in the same system. It is very
helpful to use different clients for development and
testing. Smart Forms can be developed in the developmentclient and tested in the test client without transporting,
the form,
Web publishing—For web publishing, the system provides a
‘generated XML output of the processed form.
54. What are the advantages of Smart Forms?
55.
Smart Forms provide Interactive Web forms that have input
fields, radio buttons, and so forth.
They support dynamic framing of texts.
They usea graphical table painter for drawing tables.
‘They support form translation by standard translation tools.
They display the forms in HTML.
They are user friendly.
They require half the time to create and maintain compared
to SAPscript forms.
‘They providean integrated form painter tool for the graphical
design of forms, which includes color
They are easy to use as no programming knowledge is
Describe the architecture of a SAP Smart Form.
‘The architecture of SAP Smart Forms separates application data
retrieval from the actual definition of the form. Figure 7.1 shows
the architecture ofan SAP Smart Form.
‘Thearchitecture of an SAP Smart Form describes the following:
The layout of the form
Individual elements such as text, graphics, addresses, tables,
and so forth
The logic of the form
= A form interface to transfer application data to the form
definitionFigure 7.1: SAP Smart Form Architecture
56. Describe form lo;
Form logic is represented by a hierarchy structure (tree struc-
ture) that consists of individual nodes, such as nodes for global
settings, nodes for texts, nodes for output tables, or nodes for
graphics. A Smart Form is described by a set of nodes in the
form builder. To create any new form, the Global settings node
and the Form Attributes, Form Interface, and Global Definitions
inferior nodes should exist.
57._What are the types of inferior nodes?
Page—This is a page of the form. An inferior node can be
placed directly on the page.
1 Windows—A window is the output area on a page.39.
60.
‘There are four window types:
© Main window
1 Secondary window
1 Copies window
Final window
What is the SAP Form Builder?
The SAP Form Builder is used to create forms. It has the
following components:
Form Painter—Used to create the layout of a form.
PC Editor—Used to enter text and fields into output areas
Navigation Tree—Used to maintain form logic.
Table Painter—Used to create templates and tables.
What are the different command nodes?
The different command nodes used for different application
purposes are as follows:
1 Go to New Page—This command is used within a main
window. Itis a dynamic page break.
Reset Paragraph Numbering —This command is used to initial-
ize the counter of a specified outline.
1 Insert Printer Control— This command is used to send a print
control to the output device.
How do you download and y
‘The following are the steps to download and upload Smart
Forms
1, Click Utilities > Download Form to download an entire form.
When storing the form in a directory, SAP Smart Forms
automatically sets the form name as the file name.
2. Click Utilities > Download Subtree to download a subtree
of the form. In the navigation tree, double click an inferior
node of the Pages and Windows node as the root node of
the form.3. Click Utilities > Upload to upload a file again. Smart Forms
know, by default, whether the file contains an entire form or
a subtree.
4. Check whether all fields and styles used in the subtree are
known in the target form before uploading a subtree. If not,
create fields and styles.
61. Can an SAPscript form be migrated to a Smart Form?
‘Yes, Smart Forms provide a migration tool to migrate the layout
and text of an SAPseript form to a Smart Form. This tool does
not migrate the SAPscript form logic of the output program.
‘This logic is described by the tree structure of the Form Builder
with the use of a Smart Form. The complexity of the output
program determines the efforts involved in the migration of
an SAPscript form,
62. How do you migrate an SAPscript form?
1. Goto the initial screen of SAP Smart Forms by using transac-
tion SMART FORMS.
2. Enter the name of the Smart Form in the form field.
3. Click Utilities > Migrate SAPseript form. A dialog window to
migrate the SAPscript form will open.
4, Enter the name and the language of the source form,
5, Click Enter.
6. Change the design of the form and the form logic. Click
Actioate to activate the Smart Form,
63. _How do you convert an SAPscript style?
1. Goto the Smart Styles initial screen using transaction SMART
STYLES.
Enter the name of the Smart Style in the Style name field,
3. Click Smart Styles > Convert SAP script style.
4, Enter the name of the SAP script style to be converted.64.
65.
66.
5. Click Enter to display the list of converted styles.
6. Click Back.
7. Click Activate to activate the Smart Style.
For what is form graphics administration used?
Form graphics administration is used to import, administer,
and transport graphics and to display them in a print preview
window. Graphics can be transported directly into other sys-
tems from the graphic administration. Choose transaction SE78
to access the graphic administration,
How do you create pages in Smart Forms?
1, Create a New Page Node in the navigation tree of the Form
Builder. Select an existing page node to position the new page
node.
2. Enter a unique name for the node and a description.
3, Determine the format and the mode of the page counter in
the General Attributes tab. By default, the next page is the
page itself.
4, Determine the print attributes of the page in the Output
Options tab.
5, Determine a background graphic for the entire page in the
Background tab.
How do you create windows in Smart Forms?
1. Create a Window Node in the navigation tree of the Form
Builder.
2. Entera unique name for the node and a description,
In the General Attributes tab, select a window type. The
swinclow type copies the window and final window that are
secondary windows with additional attributes.
4, The position and size values in the Output Options box
correspond to the position in the Form Painter.67.__How do you define the form interface?
The form interface is defined to pass data to the form. It is
used to define import and export parameters, tables, and
exceptions. To control the form output, the form interface
has a number of SAP Smart Forms and standard parameters
by default. The following are the steps to define the form
interface,
1. Click the node Global Settings > Forne Interface.
2. Enter the parameter names for the data to be passed.
These names are valid throughout the form; they need
not correspond to the variable names in the application
program,
3. Enter the appropriate reference type. The LIE or PE key-
word is used to assign a type. To display its definition, double
click the type.
4. Deié exceptions for the form if needed.
5. Check the entries for the form interface by using a local check
oneach tab page,
68._How do you integrate a Smart Form into an application?
The following are the steps to integrate a Smazt Form into an
application:
1. Call the function Environmeut > Name of the function module
in the Form Builder and use CTRL-Y and CTRL-C to copy
its name.
2. In the application program, define a variable of type
RS38L_FNAM for the name of the generated function
module.
3. Callthe SS2_#IELD_LIST function module if needed.
It returns a list of the form parameters actually used in
the form.
4, Callthe Sse_PUNCTTON_MoDULE_NaMfunction module. Tt
returns the name of the generated function module,69. What are the types of fields?
Two types of fields exist
System fields —Provieled by Smart Forms.
Own fields Defined in the form interface or declared as global
definitions. The value of a field can be a maximum of 255
characters.
70. Where are the fields included?
‘The fields are included in the following nodes:
Text nodes—To display a dynamic value, text nodes are used
to include fields. These fields are enclosed in ampersands
("8") to set them apart from normal text.
Input fields of a nede—Used to display static values.
71, What are included fields used for in the PC Editor?
Fields are included in the PC Editor to display variable data in
the form. When the system displays the form, it replaces the
field with the value that was assigned to it during processing.
72. What are the features of system fields?
System fields are replaced with the corresponding values
during form processing,
The field string SFSY is used within a form.
The system field values come from the SAP system or are
results of the processing,
73. Describe the various types of system fields of Smart
Forms.
The various types of system fields of Smart Forms are as,
follows
m GSPS
~DATES—Used to display the date.
Ml GSPSY¥-TIMES—Used to display the time of day in the form
of HH:MMSS.74.
75.
Ml &SPSY-PAGES—Used to insert the page number of the
current print page.
Ml &SPSY-FORMPAGESE—Displays the total number of pages
for the currently processed form
Bl GSPSY-JOBPAGESS—Conlains the total page number of all,
forms in the currently processed print request.
m asrsy,
window.
m &SPSY-PAGENAMES—Contains the name of the
current page.
M_SPSY-USERNAME—Displays the log-on name of the user who
prints the form.
TNDOWNAME—Contains the name of the current
What are the rules for defining a field name?
| The name must be enclosed in ampersand characters ("&"),
The name must not contain any blanks.
The name can be up to 130 characters long
.
There is no difference between uppercase and lowercase
letters in field names. For example, the &sapfielde,
kSAPfield&, and &SAPPIELDS field names all identify the
same field.
The names of system fields cannot be used to define their
own fields,
‘What are the formatting options for fields in Smart
Forms?
&field+k—Skips offsets () in the
character field value only. If the offset is greater than the
length of the value, nothing is displayed.
Gfield () &—Sets the output length of a program
to
field (*) &—Sels the output length of the program to
the value specified there if the field is defined by a Data
Dictionary type.
gheld(<) &—Displays the sign to the left of the number,
field (5) & Suppresses the sign.&fie14 (7) <—Suppresses thousands indicators when
displaying fields of the DEC, CURR, INT, and QUAN types.
field (1) & Suppresses the display of initial values.
field (x) &—Deactivates a conversion routine specified in
the Data Dictionary.
field (2) & Suppresses leading zeros in numbers.
1 Gfield (R) & Used to display right-aligned text. It is used
only when an output length is specified.
field (F) «Replaces left-justified blanks in the
value by the fill character
76. What are the node types for tables?
Template node—Templates are static because the number of
columns and lines is determined before the actual output.
Table node—Tables are dynamic because the tablesize depends
on the amount of data selected at runtime.
Line types are used to construct the layout of templates and
tables and describe the following attributes of a table line:
The width of the table line
= The number and width of individual cells within the table lineCompare the features of Smart Forms and SAPscript.
Support multiple page Does not support multiple page
formats formats
Labels cannot be created in | Labels can be created
Smart Forms
Colored output of text ‘Output only in black-and-white text
‘Separate data retrieval is not possibleGMAPTER 8
DIALOG
PROGRAMMING
DIALOG PROGRAMMING
What is dialog programming?
Dialog programming is used to work interactively with a system
and to change the contents of database tables. It provides a
sequence of screens that are processed one after the other.
What are the events used
log programi
ing?
The following are the four events used in dialog, programming:
Process Before Output (PBO)
Process After Input (PAD
1 Process On Help (POH)
Process On Value (POV)Explain the events used in dialog program
PBO—The PBO event is activated after the PAI processing,
of the previous screen and before the current screen is dis-
played. The screen is displayed to the user at the end of the
PBO processing,
PAI—The PAI event is processed at the time of user interac
tion with the screen. At the end of PAI processing, the system
cancall the next screen. It can also carry on processing at the
point from which the sereen was called.
= POH—This event is activated when the user requests fields
help (F1). In the event block, appropriate coding can be done
by the user. When the program is processed, the system con-
tinues processing the current screen.
= POV—Thiseventis activated when the user requests possible
values help (F4). In this case, appropriate coding in the
corresponding event block can be done. While the program is,
being processed, the system continues processing the current
Describe the components of dialog programming.
‘The following are the components of dialog programming:
Transaction code—Transaction codes are used to start a screen
sequence. Transaction codes are created using transaction,
SE93. The CALLSCREBN statement is used in any ABAP
program to start a screen sequence.
1 Screens—A screen is used to control dialog inan SAP system.
It contains a screen mask and its flow logic. Screen Painter is
used to create a screen in the ABAP Workbench. Fach screen
belongs toan ABAP program. Its layout determines the posi-
tions of the input /output fields. The layout also determines,
graphical elements, such as check boxes and radio buttons.
Graphical user interface (GUD status—The GUI status is used.
to control menu bars, as well as the standaed toolbars and the
application toolbar, which are independent components of an
ABAP program. Menu Painters used to create the GUI status
in the ABAP Workbench.
ABAP program—in the ERP system, every ABAP program has
a screen and a GUI status. The ABAP program contains the
dialog moctules that are called by the screen flow logic. Italso
processes the user input from the GUI status. ABAP programs
that contain screens are also called dialog programs.How is a screen processed?
A screen is processed in two ways: either by a transaction
code or by using the CALL SCREEN statement in an ABAP
program.
How can users interact with a screen?
Users can interact with a screen by filling in the input fields.
Users can enter values in any input field on the screen or change
the value of a field by using the mouse. The following are
the steps:
1. Choose a push bution on the screen.
2. Select a check box or radio button to which a function code
isassigned.
3. Choose a function in the menu, standard toolbar, or applica
tion toolbar.
4, Choose a function key on the keyboard,
5. Select an entry from the drop-down box.
How is an ABAP dialog module called?
The MODULE statement is used to call dialog modules in an
ABAP program. This statement is used in a PBO event to call
any dialog module in the ABAP program. It is defined as
follows:
MODULE OUTPUT.
ENDMODULE
This statement is also used in the PAI, POH, and POV
events to call any dialog module in the ABAP program that
has been defined as follows:
MODULE [INPUT]
ENDMODULE
Which function is used to modify a screen dynamically?
‘The field selection function is used to modify a screen dynami-
cally. Itis also possible to set the cursor dynamically om a par-
ticular position on the screen in a program.10.
What is Screen Painter?
Screen Painter is a tool that allows users to create GUI
sereens. It is used to design and maintain a screen. The main
elements used in Screen Painter are attributes, layouts, and
flow logic,
What is Menu Painter?
11.
12.
The tool used to design interface components is known as
Menu Painter. The main components used are status, menu
bars, menu lists, functions, and titles
What is Dynpro?
Dynpro is a screen that contains fields used to display or
request information. Fields can be text strings, input or
output fields, radio buttons, check boxes, or push buttons
The screen of transaction TZ10 contains only text and input/
output fields,
‘SAP Dynpro contains the following components:
Flow logic—Calls the ABAP modules for a screen.
Screen layout—Positions of the text, fields, and push buttons
fora screen,
1m Screen attributes—The number of the screen and the number
fof the subsequent screen,
Field attributes—Definition of the attributes of the individual
fields ona screen,
What are the steps to create a screen’
1. Dagithe screen attributes.
2. Design the layout of the screen.
3. Define the attributes of the field.
4, Write the flow logic of the screen.13.
Describe screen attributes.
14.
Screen attributes include the following:
1 Progran—The name of the ABAP program that belongs to the
screen. Itcan be either of type 1, M, or F
Screen number—A unique four-digit number used within an
ABAP program,
Screen type—The screen type can be normal or subsereen.
Anormal screen is a screen that oceupies a whole GUI win-
dow. A subscreen is a screen that can be displayed on a dif-
{erent screen in the same ABAP program.
Next screen—A statically defined screen number that specifies
the next screen in the sequence. An ABAP program allows for
overriding of the statically defined next screen.
Cursor position—The static definition of the screen element
‘on which the cursor is positioned. An ABAP program allows,
overwriting of the static cursor position dynamically,
Screen group—A four-character ID that is placed in thesystem
field S¥_DYNGR that allows assigning various screens to a
common screen group.
Hold data—This is used when a user wants to display a
screen more than once during a terminal session. Go to
System > User profile > Hold data to change the settings to
hold the changed data
What are screen elements?
15.
Screen elements contain various elements, They can be used to
display field contents and also allow the user to interact with
the program.
Describe the various screen elements.
1 Text fields—Display elements. These elements cannot be
changed either by the user or by the ABAP program
© Inputfoutpurt felds—Used to display the data from an ABAP
program,1 Drop-doc list boxes—A special input/output list that helpsa
‘user to choose one item from a given list of items.
Check boxes—A special input/output field that allows a
user to select multiple fields. A user can select or deselect
check boxes.
Radio buttons—A special input/output field that allows a
user to select a single field out of multiple fields. When
‘one button is selected, all others are automatically
deselected.
Push buttons—Elements on a screen that trigger the PAL
event of the screen flow logic. Each push button has a
function code that is passed to the ABAP program.
Bor—Displays an element used for visual grouping of related.
elements on the sereen.
1m Subscreenis—An area on the screen in which another screen
is placed.
Table contvols—A tabular input/output field
1 Tab strip cotrols—The areas on a screen in which a user can
switch between various pages.
© Custom comttrol—A container on the sereen in which another
control can be displayed.
Status icons—Indicate the status of an application program.
= K_CODE fielé—This code is not displayed on the sereen;
however, every screen has this code, and it is 20 char-
acters long,
16. __How do you create and display input help?
Three techniques create and display input help:
Create a definition in the ABAP dictionary—In the ABAP
dictionary, you can link search helps to fields. Search
helps are atitomatically available when screen fields are
created with reference to ABAP dictionary fields. The
ABAP dictionary offers the contents of @ check table
or fixed domain values if a field does not contain any
search help.
Create a definition om a screen—In individual screen fields,
input checks are created by using screen flow logic. Theycan also be created hy linking search helps to screen
fields.
1 Createa definition in dialog madules—ABAP dialog modules can
be called in the POV event of the screen flow logic to create
input help.
17.__How are screen sequences defined?
Sereen sequences are defined as follows:
Static next screen—A screen is called statically after the cur-
rent screen. A staticattribute isalways overwritten if the next
sereen is processed dynamically.
Dynamic next screen—The SET SCREEN statement is used to
overwrite the statically defined next screen dynamically.
Syntax
SBT SCREEN —This statement exits
the current screen and calls the dynamic next screen that is,
specified as part of the statement.
19,__How are sequences of screens called?
‘The following are the two ways to call screen sequences:
Using a transaction code—A transaction code can be used to
call screen sequences. The corresponding, ABAP program is,
loaded automatically. Upon reaching the end of the screen
sequence, the entire program terminates.
1 Froman ABAP Program—The following statement is used to
start a screen sequence from an ABAP program:
CALL SCREEN .20. What are messages?
‘Messages are maintained in SE91. They are stored in table T100,
which has the following components
Language key—Supplied by the system according to the system
language environment.
1 Tiventy-character message class—Assigns messages to an
application,
Message nuaber—Identifies the individual messages within
the message class.
Message text —Can be up to 72 characters.
21, How are messages sent?
Messages are sent using the ABAP statement MESSAGE. This
statement specifies the following:
Message olass—Identifies a message in a table,
1 Nuomber-—Also used to identify the message in table T100.
Type of message—The type of message defines how the ABAP
runtime should process the message. The message type is A,
E,1S, Worx.
How many variants are there in the MESSAGE statement
‘The MESSAGE statement has the following three variants:
Global message class—If the introductory statement of a pro~
‘gram contains the addition MESSAGE-ZD and a mes-
sage class contained in table T100, then the following
MESSAGE statement can be used:
MESSAGE [WITH <£>
IRAISING ].
el
In this code, is the single-character message type,
and is the three-digit message number. The system
retrieves the corresponding message text from table T100 for
the message class specified in the introductory statement and
displays itSpecifying the message statically—To specify the message class,
message number, and message type statically, the following
form of the 42SSAGE statement is used:
MESSAGE () (WITH ... <£4>]
[RAISING ]
This statement is like the first variant but specifies the
message class within the statement
Specifying the message dynamically —To specify the message
‘lass, message number, and message type dynamically, the
following form of the MESSAGE statement is used:
MESSAGE ID TYPE NUMBER [WITH
... ] [RAISING
]
In this code, , , and are fields containing
the message class, message number, and message type,
respectively.
23. __ Explain the various message type:
The following are the various message types:
Termination (A)—The message appears in a dialog box, and
the program terminates.
1 Error(E)—Anertor dialog appears or the program terminates
according to the context of the program.
Information (I)—The message appears in a dialog box. After
the user confirms the message, the program continues
immediately.
Status (S)—In this type, a message appears in the status bar
‘of the next screen. The program continues normally after the
MESSAGE statement
Warning (W)—An error dialog appears or the program termi-
nates according to the context of the program.
Exit (X)—The program terminates suddenly, and no message
is displayed. Its displayed normally when a runtime error
occurs.How do you process a message without a screen?
In ABAP programs, the following processing blocks are
included for a message without a sereen:
1 PBO modules
The selection screen event, suchas A? SELECTION-SCREEN
oureur
Reporting events, such as INITIALIZATION, START-OF-
SELECTION, GBT, and END-OF-SELECTION
The list of events ToP-OF-PAGE and BND-OF-PAGE,
Adialog box. ‘Program comes to end, and control
returns to previous menu
In PBO, thestatusbarof the | After the MESSAGE statement
next screen; otherwise,a_| appears, the processing of program
dialog box continues
In PBO, the status bar of In PRO, the same as type; program
thenext screen; otherwise, | ends and control returns to point
the status bar of the current _| from which the program was called
screen
25. __How do you process a message in a screen?
‘Adialog box ‘The program comes toan end, and
control returns to the previous menu,Adialog box Alter the MESSAGE statement
appears, processing of program
continues.
Same as type E. The user can confirm
the message by pressing Enter
without having to enter new values.
How do you process a message on selection screens?
Adialog box Program comes to an end, and
control returns to the last area menu.
A dialog box: After the MESSAGE statement,
‘program continues processing.29.
Same as type E. The user can
confirm the message by pressing.
Enter. There is no need to enter new
values.
How do you maintain transaction codes?
‘Transaction codes are maintained by any of the following
methods:
Using the object navigator
Going to Development > Other Tools > Transactions
Using transaction code SE93
How do you create transactions codes?
‘The following are the steps to create transaction codes using
transaction SE93:
1. Entera transaction code. Itcan be up to 20 characters.
2, Select the create button. A dialog box appears.
3. Entera short description and click the transaction type.
4. Give the program name and screen number.
5. Select GUI support options.
How do you set the GUI status?
The following ABAP statement is used to set the GUI status of a
screen. It is used to define the user interface for all subsequent
screens:
SET PP-STATUS [OF PROGRAM ]
[BXCLUDING |1]In this code:
isa component of the current ABAP program.
1 <£> deactivates the function code stored.
How do you set the GUI title?
‘The GUI tite is created using Menu Painter. The following
ABAP statement is used to set the GUL title. Itis used to define
the title of the user interface for all subsequent screens of a
screen sequence,
SET TITLEPAR [OF PROGRAM ]
(wren 1
31. Describe the function codes of the standard toolbar.
The following are the function codes of the standard toolbar:
print Print
6
Brace down
532.__Describe the function codes of the application toolbar.
The following are function codes of the application toolbar:
Position/Function Code Purpose
ISELE g
2MARK %
SDELETE o
4FUNCT_FS Function 1
SFUNCT_F6 Function 2
33.__How do you find the cursor position?
The following statement
used to find the cursor position:
GET CURSOR FIELD [OFFSET ]
[LINE