Interactive reporting allows the user to participate
actively in retrieving and presenting data during the session. Instead of one
extensive and detailed list, with interactive reporting you create a condensed
basic list from which the user can call detailed information by positioning the
cursor and entering commands. Interactive reporting thus reduces information
retrieval to the data actually required.
What are the event key words
in interactive reporting ?
Event keyword
|
Event
|
|
AT LINE-SELECTION |
Moment at which the user selects a
line by double-clicking on it or by positioning the cursor on it and pressing
F2. |
|
AT USER-COMMAND |
Moment at which the user presses a
function key. |
|
TOP-OF-PAGE DURING LINE-SELECTION |
Moment during list processing of a
secondary list at which a new page starts. |
What is secondary list ?
Secondary lists allow you
to enhance the information presented in the basic list. The user can, for
example, select a line of the basic list for which he wants to see more
detailed information. You display these details on a secondary list.Secondary
lists may either overlay the basic list completely or you can display them in
an extra window on the screen. The secondary lists can themselves be interactive
again.
How to select valid lines
for secondary list ?
To prevent the user from
selecting invalid lines, ABAP/4 offers several possibilities. At the end of the
processing block END-OF-SELECTION, delete the contents of one or more fields
you previously stored for valid lines using the HIDE statement. At the event AT
LINE-SELECTION, check whether the work area is initial or whether the HIDE
statement stored field contents there. In the latter case, create a secondary
list, since you previously stored field contents for valid lines only. After processing the
secondary list, clear the work area again. This prevents the user from trying
to create further secondary lists from the secondary list displayed.
How to create user
interfaces for lists ?
The R/3 system automatically generates a graphical user
interface (GUI) for your lists that offers the basic functions for list
processing, such as saving or printing the list. If you want to include
additional functionality, such as pushbuttons, you must define your own
interface status.To create a new status, the Development Workbench offers the
Menu Painter. With the Menu Painter,you can create menus and application
toolbars.And you can assign Function keys to certain functions. At the
beginning of the statement block of AT END-OF-SELECTION, activate the status of
the basic list using the statement: SET PF-STATUS 'STATUS'.
Can we call reports and
transactions from interactive reporting lists ?
YES.Interactive reporting
also allows you to call transactions or other reports from lists. These
programs then use values displayed in the list as input values.The user can,
for example, call a transaction from within a list to change the database table
whose data is displayed in the list.
How to maintain lists ?
To return from
a high list level to the next-lower level (SY-LSIND), the user chooses Back on
a secondary list.The system then releases the currently displayed list and
activates the list created one step earlier.The system deletes the contents of
the released list.To explicitly specify the list level into which you want to
place output, set the SY-LSIND field.
The system accepts only index values which correspond to existing list
levels.It then deletes all existing list levels whose index is greater or equal
to the index you specify.For example, if you set SY-LSIND to 0, the system
deletes all secondary lists and overwrites the basic list with the current
secondary list.
What are the page headers
for secondary lists?
On secondary
lists, the system does not display a standard page header and it does not
trigger the event TOP-OF-PAGE.To create page headers for secondary list, you
must enhance TOP-OF-PAGE:
Syntax TOP-OF-PAGE DURING LINE-SELECTION. The
system triggers this event for each secondary list. If you want to create different page headers
for different list levels, you must program the processing block of this event
accordingly, for example by using system fields such as SY-LSIND or SY-PFKEY in
control statements (IF, CASE).
What is meant by stacked
list ?
A Stacked list
is nothing but secondary list and is displayed on a full-size screen unless you
have specified its coordinates using the window command.
Is the basic list deleted
when the new list is created?
NO.It is not
deleted and you can return back to it using one of the standard navigation
functions like clicking on the back button or the cancel button.
What is meant by hotspots ?
Hotspot is a
list area where the mouse pointer appears as an upright hand symbol.When a user
points to that area(and the hand cursor is active),a single-click does the same
thing as a double-click. Hotspots are supported from R/3 release 3.0c.
In which system field does
the name of current gui status is there ?
The name of the current GUI STATUS is
available in the system field SY-PFKEY.
What is meant by hide area ?
The hide
command temporarily stores the contents of the field at the current line in a
system-controlled memory called the HIDE AREA.At an interactive event,the
contents of the field is restored from
the HIDE AREA. When calling a secondary list from a list line for which the
HIDE fields are stored, the system fills the stored values back into the
variables in the program. In the program code, insert the HIDE statement
directly after the WRITE statement for the current line.
When the get cursor command
used in interactive lists ?
If the hidden
information is not sufficient to uniquely identify the selected line ,the
command GET CURSOR is used.The GET CURSOR command returns the name of the field
at the cursor position in a field
specified after the addition field,and the value of the selected field in a
field specified after value.
How to pass data from list
to report ?
ABAP/4 provides three ways of passing
data:
---Passing data automatically using system fields
---Using statements in the program to fetch data
---Passing list attributes
How to call other programs ?
|
|
Report
|
Transaction
|
|
Call and return |
SUBMIT AND RETURN |
CALL TRANSACTION |
|
Call without return |
SUBMIT |
LEAVE TO TRANSACTION |
System fields used in interactive Reporting
The SY-LSIND system field contains the index of the
list currently created. While creating a basic list, SY-LSIND equals 0.
With each interactive event, the system automatically sets
the following system fields:
System field Information
SY-LINCT total
line count of a list
SY-LINNO current
line no where cursor is placed.
SY-LSIND Index
of the list currently created during the current event (basic list = 0)
SY-LISTI Index
of the list level from which the event was triggered
SY-LILLI Absolute
number of the line from which the event was triggered
SY-LISEL Contents
of the line from which the event was triggered
SY-CUROW Position of the line in the window from which the event was
triggered (counting starts with 1)
SY-CUCOL Position of the column in the window from which the event was
triggered (counting starts with 2)
SY-UCOMM Function
code that triggered the event
SY-PFKEY Always
contains the status of the current list.
TOP-OF-PAGE DURING LINE-SELECTION.
The system triggers this event for each secondary list. If
you want to create different page headers for different list levels, you must
program the processing block of this event accordingly, for example by using
system fields such as SY-LSIND or SY-PFKEY in control statements (IF, CASE).
Ø Data from System Fields of Interactive Lists
From system fields, you retrieve the following information:
the index of a list, the position of the list in the output window, and the
location of the cursor. The only system field that contains the contents of the
selected line is SY-LISEL.
Ø Passing Data by Program Statements
To pass individual output fields or additional information
from a line to the corresponding processing block during an interactive event,
use these statements:
HIDE
The HIDE statement is one of the fundamental statements for
interactive reporting. Using the HIDE technique, you can at the moment you
create a list level define, which information later to pass to the subsequent
secondary lists.
Syntax HIDE
<f>.
Eg HIDE:
SPFLI-CARRID, SPFLI-CONNID, NUM.
READ LINE
Use the statements READ LINE and READ CURRENT LINE to
explicitly read data from the lines of existing list levels. These statements
are tightly connected to the HIDE
technique.
Syntax :
READ LINE <lin>
[INDEX <idx>]
[FIELD VALUE <f1> [INTO <g 1>]... <f n>
[INTO <g n>]]
[OF CURRENT PAGE|OF PAGE <p>].
Eg :
READ LINE SY-INDEX FIELD VALUE BOX.
GET CURSOR
Use the statements GET CURSOR FIELD and GET CURSOR LINE to
pass the output field or output line on which the cursor was positioned during
the interactive event to the processing block.
Syntax
GET CURSOR FIELD <f> [OFFSET <off>] [LINE
<lin>]
[VALUE <val>] [LENGTH <len>].
SET CURSOR
To set the cursor, use the SET CURSOR statement. This
statement sets the cursor in the most recently created list. While creating the
basic list, this is always the basic list itself. While creating a secondary
list, this is the previous list.
SET CURSOR <col> <lin>.
This statement sets the cursor to column <col> of line
<lin> of the output window.
Calling Programs
If you need to program an extensive application, one single
program will become very complex. To make the program easier to read, it is
often reasonable to divide the required functions among several programs.
ABAP allows you to call reports as well as transactions
using these statements:
Report
Transaction
Call without return SUBMIT LEAVE TO
TRANSACTION
Call and return SUBMIT AND RETURN CALL TRANSACTION
Typical Structure of ABAP Program
1. Report Definitions *
2. Table and Data definitions *
3. Initialization event
4. Screen Select Options/Inputs *
5. Selection-screen event
6. Start-of-selection event
7. Performs and other Events *
Statements
8. End-of-selection event
1.
Initialization
·
Triggered prior to first display of selection screen
·
To specify Default value in SELECT-OPTIONS
2.
At Selection-Screen
·
Processed after the selection screen value are entered
·
For validation of screen accepts
·
Returns back to SELECT-OPTIONS
4.
START-OF-SELECTION &
END-OF-SELECTION
·
This is implicit in any ABAP/4 program
·
Start & end of main processing logic
·
More in use with logical database access
·
All Statements between START-OF-SELECTION and
END-OF-ELECTION is only executed
·
By Default , no need to have END-OF-SELECTION
·
Each procedural statement in an ABAP program automatically
belongs to START-OF-SELECTION
5.
Form Event
·
Similar to PERFORM/SUBROUTINES
·
STARTS with FORM and ends with ENDFORM
·
All statements between ENDFORM and end of program are never processed
·
Similarly all statements between ENDFORM and event keyword
are never processed.
6. Limitations of Simple PERFORM
·
Values can be passed through PERFORM to FORM.
·
Giving the flexibility to use the same subroutine multiple
number of times.
Syntax1: PERFORM
<XXXX> using <YYY>
changing <MMM>
FORM <XXXX> using <YYY> like
<ZZZ>
changing <MMM> like <NNN>
- Pass by reference
OR
FORM
<XXXX> using value (YYY) like <ZZZ> - Pass by value, creates another copy of
the variable.
Example1:
PERFORM
date-invert using in-date
Changing out-date
FORM
date-invert using in-date like datum
Syntax2: PERFORM function-name(program)
IF FOUND.
Example2: PERFORM HEADER(FORMPOOL) IF
FOUND.
6. Get event
·
GET < table name >
·
Reads data of all columns from all database table falling in
the hierarchy
·
Needs to mention table name in
TABLES: parameters………
·
Only fields part of the tables mentioned in the TABLES: parameter can be viewed &
edited
7.
To Exit from an Event
·
Exit – It exits from
the respective subroutine were this syntax is used , generally condition for the EXIT is stated
before this syntax
·
Check - here the
conditional check is done at the same time .
CHECK
<condition>
If the
condition is not satisfied, the system leaves the subroutine and resumes
the
processing after the PERFORM statement
·
Stop – it is the abrupt stopping the program flow
8.
CALLing Functional Modules
Syntax:
CALL FUNCTION <module>
[EXPORTING f1 = a1 .... fn = an]
[IMPORTING f1 = a1 .... fn = an]
[CHANGING f1 = a1 .... fn = an]
[TABLES f1 = a1 .... fn = an]
[EXCEPTIONS e1 =
r1 .... en = rn
Example:
CALL FUNCTION 'Z_DATE_CONVERSION'
EXPORTING STD_DATE = GEN_DATE
IMPORTING CH_DATE = NEW_DATE
9.
List Events
TOP-Of-PAGE,
END-OF-PAGE,
AT
LINE-SELECTION, AT USER-COMMAND
These
events are triggered by the ABAP runtime environment while a list is being
created or when a user performs an action on a list. The statement in these
blocks can format the list or process the user’s request.
No comments:
Post a Comment