Abap QuestionandAnswers
Abap QuestionandAnswers
| SELECT-oPTIONS . 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 [/] ...... 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 ...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
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_
(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
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