SlideShare a Scribd company logo
LIST PROCESSING
LIST PROCESSING
Objective
Extract datasets
Filling an extract with data
Reading an extract
Sorting an Extract
Lists
Standard list
Self-Defined list
List with several pages
Interactive lists
At line-selection
At PF <nn>
At User-command
LIST PROCESSING
.
Refining Data
A report must sort data,calculate totals,count item in lists and so on.
you can read the data to be refined from database tables or from
sequential files or u can create generic report.
The refining process is independent of the process of retrieving data.
Create data set
Refine the data set
LIST PROCESSING
.
Creating and Refining datasets:
Abap/4 offers two methods of creating datasets in the storage
Internal tables
Extract datasets
Internal tables :
If you want the datasets to map the underlying data structures as
closely as possible and if you want to access individual data
directly.
Extract datasets :
An extract is a sequential dataset you can create with a report.Use
extracts if you want to process large amount of data as a whole
several times
LIST PROCESSING
.
Refining data using EXTRACT DATASETS:
An Extract is a sequential dataset in the report’s storage area.this means
that you can access its data only within a loop.
During the report’s run time,the system can create exactly one extract
dataset.
As for internal tables the size of the extract data set is principally
unlimited,since the system rolls it out if necessary.
In one extract dataset,you can store records of different length and
structure one after the other.
LIST PROCESSING
.
Declaring Extract Records as Field Groups
An extract dataset consists of a sequence of records. These records may
have different structures. All records with the same structure form a
record type. You must define each record type of an extract dataset as a
field group, using the FIELD-GROUPS statement.
Syntax
FIELD-GROUPS <fg>.
LIST PROCESSING
.
Filling an Extract with Data
Once you have declared the possible record types as field groups and
defined their structure, you can fill the extract dataset using the following
statements:
Syntax
EXTRACT <fg>.
When the first EXTRACT statement occurs in a program, the system
creates the extract dataset and adds the first extract record to it. In each
subsequent EXTRACT statement, the new extract record is added to the
dataset
LIST PROCESSING
.
Reading an Extract
Like internal tables, you can read the data in an extract dataset using a
loop.
syntax
LOOP.
…
[AT FIRST | AT <fgi> [WITH <fg j>] | AT LAST.
...
ENDAT.]
...
ENDLOOP.
LIST PROCESSING
.
Sorting an Extract
You can sort an extract dataset in much the same way as an internal table
by using the following statement:
syntax
SORT [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
BY <f1> [ASCENDING|DESCENDING] [AS TEXT]
...
<fn> [ASCENDING|DESCENDING] [AS TEXT].
LIST PROCESSING
.
Processing Control Levels
When you sort an extract dataset, control levels are defined in it. For
general information about control levels, The control level hierarchy of an
extract dataset corresponds to the sequence of the fields in the HEADER
field group. After sorting, you can use the AT statement within a loop to
program statement blocks that the system processes only at a control
break, that is, when the control level changes.
Syntax
AT NEW <f> | AT END OF <f>.
...
ENDAT.
BASIC LISTS
Lists
Lists are the output medium for data from ABAP/4 report programs. Each
program can produce up to 21 lists: one basic list and 20 secondary lists.
Structure and the options of a list are
The Standard List
The Self-Defined List
Lists with Several Pages
BASIC LISTS
The standard list
If an ABAP/4 report makes use only of the WRITE, SKIP, and ULINE
output statements .This list is called standard list.
The standard list consists of:
Standard Page Header
Standard Page
User Interface of the Standard List
The next slide shows a standard list.
BASIC LISTS
BASIC LISTS
The Self-Defined List
Self-defined list is a list created by modifying the standard list by
using options of the REPORT statement and using event keywords
TOP-OF-PAGE and END-OF-PAGE.
The possible modifications that can be performed in a standard list
are :
Page Header
List Width
Page Length
Page Footer
BASIC LISTS
Page Header
To layout a page header individually, you must define it in the processing
block following the event keyword TOP-OF-PAGE:
Syntax
TOP-OF-PAGE.
WRITE: ....
The TOP-OF-PAGE event occurs as soon as the system starts processing
a new page of a list and before outputting the first line on a new page.
Note :
The self-defined page header appears beneath the standard page header.
If you want to suppress the standard page header, use the NO STANDARD
PAGE HEADING option of the REPORT statement.
BASIC LISTS
REPORT demo_list_page_heading NO STANDARD PAGE HEADING.
TOP-OF-PAGE.
WRITE: sy-title, 40 'Page', sy-pagno.
ULINE.
WRITE: / 'SAP AG', 29 'Walldorf, ',sy-datum,
/ 'Neurottstr. 16', / '69190 Walldorf/Baden'.
ULINE.
START-OF-SELECTION.
DO 5 TIMES.
WRITE / sy-index.
ENDDO.
BASIC LISTS
BASIC LISTS
List Width
To determine the width of the output list, use the LINE-SIZE option of
the REPORT statement.
Syntax
REPORT <rep> LINE-SIZE <width>.
Note :
•If you set <width> to 0, the system uses the width of the
standardlist .
•The system field SY-LINSZ contains the current line width
BASIC LISTS
Page Length
To determine the page length of an output list, use the LINE-COUNT
option of the REPORT statement.
Syntax
REPORT <rep> LINE-COUNT <length>[(<n>)].
<n> ---->The system reserves <n> lines of the page length for the
page footer.
Note :
•If you set <length> to zero, the system uses the standard page
length .
•The system field SY-LINCT contains the current number of lines per page
BASIC LISTS
REPORT demo_list_line_count LINE-SIZE 40 LINE-
COUNT 4.
WRITE: 'SY-LINCT:', sy-linct.
SKIP.
DO 6 TIMES.
WRITE / sy-index.
ENDDO.
BASIC LISTS
BASIC LISTS
Page Footer
To define a page footer, use the END-OF-PAGE event.
Syntax
END-OF-PAGE.
WRITE: ....
This event occurs when the system reaches the lines reserved for the
page footer, or if the RESERVE statement triggers a page break.
Note :
The system only processes the processing block following END-OF-PAGE
if you reserve lines for the footer in the LINE-COUNT option of the
REPORT statement .
BASIC LISTS
REPORT demo_list_end_of_page LINE-SIZE 40 LINE-COUNT 6(2)
NO STANDARD PAGE HEADING.
TOP-OF-PAGE.
WRITE: 'Page with Header and Footer'.
ULINE AT /(27).
END-OF-PAGE.
ULINE.
WRITE: /30 'Page', sy-pagno.
START-OF-SELECTION.
DO 6 TIMES.
WRITE / sy-index.
ENDDO.
BASIC LISTS
BASIC LISTS
Lists with Several Pages
If in your report has more number of lines than defined in the LINE-
COUNT option of the REPORT statement, the system automatically
creates a new page .
Apart from automatic page breaks, you can use the NEW-PAGE and
RESERVE statements to code page breaks explicitly.
BASIC LISTS
Page Break- Conditional
To execute a page break under the condition that less than a certain
number of lines is left on a page, use the RESERVE statement:
Syntax
RESERVE <n> LINES.
This statement triggers a page break if less than <n> free lines are left
on the current list page between the last output and the page footer.
Before starting a new page, the system processes the END-OF-PAGE
event.
BASIC LISTS
REPORT demo_list_reserve LINE-SIZE 40 LINE-COUNT 8(2).
END-OF-PAGE.
ULINE.
START-OF-SELECTION.
DO 4 TIMES.
WRITE / sy-index.
ENDDO.
DO 2 TIMES.
WRITE / sy-index.
ENDDO.
RESERVE 3 LINES.
WRITE: / 'LINE 1',
/ 'LINE 2',
/ 'LINE 3'.
BASIC LISTS
BASIC LISTS
Page Break- Unconditional
Syntax
NEW-PAGE.
* Ends the current page. All other output appears on a new page.
* The system then increases the SY-PAGNO system field by one.
* Does not trigger the END-OF-PAGE event.
Variants in NEW_PAGE are:
NEW-PAGE [NO-TITLE|WITH-TITLE] NO-HEADING|WITH-HEADING].
NEW-PAGE LINE-COUNT <length>.
NEW-PAGE LINE-SIZE <width>.
BASIC LISTS
REPORT demo_list_new_page LINE-SIZE 40.
TOP-OF-PAGE.
WRITE: 'TOP-OF-PAGE', sy-pagno.
ULINE AT /(17).
START-OF-SELECTION.
DO 2 TIMES.
WRITE / 'Loop:'.
DO 3 TIMES.
WRITE / sy-index.
ENDDO.
NEW-PAGE.
ENDDO.
BASIC LISTS
BASIC LISTS
Scrolling from within the Program
From within the program, you can scroll through lists vertically and
horizontally.
The SCROLL statement allows you:
Vertical Scrolling
Scrolling Window by Window
Scrolling by Pages
Horizontal Scrolling
Scrolling to the List's Margins
Scrolling by Columns
BASIC LISTS
Scrolling Window by Window
To scroll through a list vertically by the size of the current window use
this statement:
Syntax
SCROLL LIST FORWARD|BACKWARD.
This statement scrolls forward or backward through the current list
by the size of the current window.
BASIC LISTS
REPORT demo_list_scroll_1 NO STANDARD PAGE HEADING LINE-SIZE 40.
TOP-OF-PAGE.
WRITE: 'Top of Page', sy-pagno, 'SY-SROWS:', sy-srows.
ULINE.
START-OF-SELECTION.
DO 100 TIMES.
WRITE / sy-index.
ENDDO.
DO 3 TIMES.
SCROLL LIST FORWARD.
ENDDO.
BASIC LISTS
BASIC LISTS
Scrolling by Pages
To scroll a list vertically depending on the page length, the SCROLL
statement offers two options.
Scrolling to Certain Pages
Scrolling by a Certain Number of Pages
BASIC LISTS
Scrolling to Certain Pages
To scroll to certain pages, use the TO option of the SCROLL statement:
Syntax
SCROLL LIST TO FIRST PAGE | LAST PAGE | PAGE <page> .
This statement scrolls the current list to the first, to the last, or to the
page numbered <page> .
BASIC LISTS
Scrolling by a Certain Number of Pages
To scroll a list by a certain number of pages, use the following options of
the SCROLL statement:
Syntax
SCROLL LIST FORWARD | BACKWARD <n> PAGES.
This statement scrolls forward or backward <n> pages.
BASIC LISTS
Scrolling to the List's Margins
To scroll horizontally to the left or right margin of a list, use the
following options of the SCROLL statement:
Syntax
SCROLL LIST LEFT | RIGHT.
This statement scrolls to the left or right margin of the currentlist.
BASIC LISTS
REPORT demo_list_scroll_3 NO STANDARD PAGE HEADING LINE-SIZE 200.
TOP-OF-PAGE.
WRITE: AT 161 'Top of Page', sy-pagno,
'SY-SCOLS:', sy-scols.
ULINE.
START-OF-SELECTION.
DO 200 TIMES.
WRITE sy-index.
ENDDO.
SCROLL LIST RIGHT.
BASIC LISTS
BASIC LISTS
Scrolling by Columns
To scroll a list horizontally by columns, the SCROLL statement offers
two options. A column in this case means one character of the list line.
•Scrolling to Certain Columns
•Scrolling by a Certain Number of Columns
BASIC LISTS
Scrolling to Certain Columns
To scroll to certain columns, use the TO COLUMN option of the
SCROLL statement:
Syntax
SCROLL LIST TO COLUMN <colm> .
This system displays the current list starting from column
<colm>.
BASIC LISTS
Scrolling by a Certain Number of Columns
To scroll a list by a certain number of columns, use the following option
of the SCROLL statement:
Syntax
SCROLL LIST LEFT | RIGHT BY <n> PLACES.
This system scrolls the current list to the left or right by <n> columns.
BASIC LISTS
REPORT demo_list_scroll_4 NO STANDARD PAGE HEADING LINE-SIZE
200.
TOP-OF-PAGE.
WRITE: AT 161 'Top of Page', sy-pagno,
'SY-SCOLS:', sy-scols.
ULINE.
START-OF-SELECTION.
DO 200 TIMES.
WRITE sy-index.
ENDDO.
SCROLL LIST TO COLUMN 178.
BASIC LISTS
BASIC LISTS
Left Boundary for Horizontal Scrolling
To determine the left boundary of the horizontally scrollable area, use:
Syntax
SET LEFT SCROLL-BOUNDARY [COLUMN <col>].
BASIC LISTS
Excluding Lines from Horizontal Scrolling
To exclude a line (for example, a header or comment line) from
horizontal scrolling, define the line feed for that line as follows:
Syntax
NEW-LINE NO-SCROLLING.
The line following the statement cannot be scrolled horizontally.
However, it can be scrolled vertically.
INTERACTIVE LIST
A list is an interactive list if the user interface allows actions that
trigger events and if the corresponding interactive event keywords
occur in the report.
All lists created during an interactive list event are secondary lists.
Interactive lists enhance the classical type of output list with dialog
functionality,thus coming close to dialog programming. Interactive
lists provide the user with so-called “interactive reporting” facility.
Interactive reporting allows the user to participate actively in
retrieving and presenting data during the the session. Instead of one
extensive and detailed list,with interactive reporting you create a
condensed basic list from which the user can call detailed
information by positioning the cursor and entering commands.
Interactive reporting thus reduces information retrieval to the data
actually required.
Detailed information is presented in secondary lists.
INTERACTIVE LISTS
Interactive Reporting
REPORT
TRANSACTION
Interactive List
Secondary List
INTERACTIVE LISTS
Events for Interactive Lists
•AT LINE-SELECTION
•AT PF<nn>
•AT USER-COMMAND
INTERACTIVE LISTS
Allowing Line Selection
To allow the user to select a line from the list, define and write a
processing block for the AT LINE-SELECTION event in your program:
Syntax
AT LINE-SELECTION.
<statements>.
In the predefined interface, Edit --> Choose and F2 are assigned to PICK.
INTERACTIVE LISTS
Page Headers for Secondary Lists
On secondary lists, the system does not trigger the event TOP-OF-PAGE.
To create page headers for secondary list:
Syntax
TOP-OF-PAGE DURING LINE-SELECTION.
The system triggers this event for each secondary list.
INTERACTIVE LISTS
Program which shows At LINE-SELECTION & TOP-OF-PAGE DURING LINE-SELECTION.
REPORT demo_list_interactive_3 .
START-OF-SELECTION.
WRITE 'Basic List'.
AT LINE-SELECTION.
WRITE 'Secondary List'.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-lsind.
WHEN 1.
WRITE 'First Secondary List'.
WHEN 2.
WRITE 'Second Secondary List'.
WHEN OTHERS.
WRITE: 'Secondary List, Level:', sy-lsind.
ENDCASE.
ULINE.
INTERACTIVE LISTS
This is the basic list
Page Header in Basic List
• When clicked on the basic list Event AT LINE-SELECTION
is triggered.
• Next Slide shows the modified Page Header and Text of the
Secondary List
INTERACTIVE LISTS
This is the secondary list
Changed Page Header in secondary
list
INTERACTIVE LISTS
Allowing Function Key Selection
To allow the user to select an action by pressing a function key,
Syntax
AT PF<nn>.
<statements>.
<nn> is a number between 1 and 24.
SY-UCOMM returns the function code PF<nn>.
INTERACTIVE LISTS
START-OF-SELECTION.
WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'.
AT pf5.
PERFORM out.
AT pf6.
PERFORM out.
AT pf7.
PERFORM out.
AT pf8.
PERFORM out.
FORM out.
WRITE: 'Secondary List by PF-Key Selection',
/ 'SY-LSIND =', sy-lsind,
/ 'SY-UCOMM =', sy-ucomm.
ENDFORM.
INTERACTIVE LISTS
If any function keys f5,f6,f7 & f8 are
pressed it will take you to the relavent
secondary list
INTERACTIVE LISTS
Secondary list when function key(f5) is
pressed
INTERACTIVE LISTS
Setting a Status
You set the status with the SET PF-STATUS statement,
Syntax
SET PF-STATUS <stat> [EXCLUDING <f>|<itab>].
Note:
For the Status type of interactive lists, choose List or List in dialog box.
The system then automatically loads function codes predefined for list
processing into the Menu Painter.
INTERACTIVE LISTS
The AT USER-COMMAND Event
To allow your program to react to a user action triggering a self-defined
function code
Syntax
AT USER-COMMAND.
<statements>.
The AT USER-COMMAND event occurs whenever the user selects a self-
defined function code from a self-defined user interface.
The event does not occur if the user selects function codes predefined for
system functions or the function code PICK, which always triggers the AT
LINE-SELECTION event.
INTERACTIVE LISTS
REPORT demo_list_at_user_command NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE: 'Basic List',
/ 'SY-LSIND:', sy-lsind.
TOP-OF-PAGE.
WRITE 'Top-of-Page'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-pfkey.
WHEN 'TEST'.
WRITE 'Self-defined GUI for Function Codes'.
ULINE.
ENDCASE.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
PERFORM out.
sy-lsind = sy-lsind - 1.
INTERACTIVE LISTS
When clicked on the Basic list AT LINE-SELECTION event
is triggred and secondary list is displayed which has pf-
status.
INTERACTIVE LISTS
At USER-COMMAND when any of the
button in application tool bar are pressed it
will take to relavent lists.
INTERACTIVE LISTS
Important System Fields for Secondary Lists
SY-LSIND Index of the list 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-UCOMM Function code that triggered the event
SY-PFKEY Status of the displayed list
INTERACTIVE LISTS
Messages in Lists:
They are grouped by language, a two-character ID, and a three-digit
number. From your program, you can send a message with different
qualifications:
A Abend; the current transaction is stopped
E Error; the system waits for new input data
I Information; after pressing ENTER, the system continues
processing
S Confirmation; the message appears on the next screen
W Warning; you can change the input data or continue by
pressing ENTER
You must specify the MESSAGE-ID behind the REPORT statement of your
program.
INTERACTIVE LISTS
REPORT demo_list_interactive_4 NO STANDARD PAGE HEADING.
START-OF-SELECTION.
WRITE 'Basic List'.
MESSAGE s888(sabapdocu) WITH text-001.
AT LINE-SELECTION.
IF sy-lsind = 1.
MESSAGE i888(sabapdocu) WITH text-002.
ENDIF.
IF sy-lsind = 2.
MESSAGE e888(sabapdocu) WITH text-003 sy-lsind text-004.
ENDIF.
WRITE: 'Secondary List, SY-LSIND:', sy-lsind.
INTERACTIVE LISTS
Popup window showing the message in the lists
INTERACTIVE LISTS
Defining Titles for Interactive Lists
By default, the system uses the program title as the title of the
output screen of a report. To choose another title for the output
screens, use this statement:
Syntax
SET TITLEBAR <tit> [WITH <g1> ... <g9>].
INTERACTIVE LISTS
Displaying Lists in Dialog Windows
To display a secondary list in a dialog window use the WINDOW
statement:
Syntax
WINDOW STARTING AT <left> <upper> [ENDING AT <right> <lower>].
The WINDOW statement takes effect only within the processing block
of an interactive event, that is, only for secondary lists.
Note:
Dialog windows have no menu bar and no standard toolbar
INTERACTIVE LISTS
REPORT demo_list_window NO STANDARD PAGE HEADING.
START-OF-SELECTION.
SET PF-STATUS 'BASIC'.
WRITE 'Select line for a demonstration of windows'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SELE'.
IF sy-lsind = 1.
SET PF-STATUS 'DIALOG'.
SET TITLEBAR 'WI1'.
WINDOW STARTING AT 5 3 ENDING AT 40 10.
WRITE 'Select line for a second window'.
ELSEIF sy-lsind = 2.
SET PF-STATUS 'DIALOG' EXCLUDING 'SELE'.
SET TITLEBAR 'WI2'.
WINDOW STARTING AT 45 10 ENDING AT 60 12.
WRITE 'Last window'.
ENDIF.
ENDCASE.
INTERACTIVE LISTS
INTERACTIVE LISTS
Triggering Events from within the Program
Instead of letting the user trigger an interactive event by an action on the
output screen, you can yourself trigger events from within the program.
Syntax
SET USER-COMMAND <fc>.
This statement takes effect after the current list is completed. Before the
system displays the list, it triggers the event that corresponds to the
function code stored in <fc>,independent of the applied user interface.
Note:
Function code PICK triggers an event only if the cursor is located on a list
line .
INTERACTIVE LISTS
Passing data from list to report
To effectively use interactive lists for interactive reporting, it is not
sufficient for the program to react to events triggered by user actions on
the output list. You must also be able to interpret the lines selected by the
user and their contents.
Following options are available:
Passing data automatically using system fields
Using statements in the program to fetch data
INTERACTIVE LISTS
Using SY-LISEL
The SY-LISEL system field is a field of type C with a length of 255
characters.
It contains the selected line as one single character string, thus
making it difficult for you to retrieve the values of individual fields.
To process certain parts of SY-LISEL, you must specify the
corresponding offsets
INTERACTIVE LISTS
REPORT demo_list_sy_lisel NO STANDARD PAGE HEADING.
DATA num TYPE i.
SKIP.
WRITE 'List of Quadratic Numbers between One and Hundred'.
SKIP.
WRITE 'List of Cubic Numbers between One and Hundred'.
TOP-OF-PAGE.
WRITE 'Choose a line!'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE sy-lisel.
ULINE.
INTERACTIVE LISTS
AT LINE-SELECTION.
IF sy-lisel(4) = 'List'.
CASE sy-lilli.
WHEN 4.
DO 100 TIMES.
num = sy-index ** 2.
WRITE: / sy-index, num.
ENDDO.
WHEN 6.
DO 100 TIMES.
num = sy-index ** 3.
WRITE: / sy-index, num.
ENDDO.
ENDCASE.
ENDIF.
INTERACTIVE LISTS
INTERACTIVE LISTS
INTERACTIVE LISTS
Passing Data by Program Statements
HIDE
The moment you create a list level you can define which information to
pass to the subsequent secondary lists.
READ LINE
Use the statements READ LINE and READ CURRENT LINE to explicitly
read data from the lines of existing list levels.
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.
INTERACTIVE LISTS
The HIDE Technique
You use the HIDE technique while creating a list level to store line-
specific information for later use.
Syntax
HIDE <f>.
This statement stores the contents of variable <f> in relation to the
current output line (system field SY-LINNO) internally in the so-called
HIDE area. The variable <f> need not necessarily appear on the current
line.
As soon as the user selects a line for which you stored HIDE fields, the
system fills the variables in the program with the values stored.
INTERACTIVE LISTS
REPORT Z_HIDE1 .
TABLES : SPFLI, SFLIGHT.
SELECT-OPTIONS : CARR FOR SPFLI-CARRID.
SELECT * FROM SPFLI WHERE CARRID IN CARR.
WRITE :/ SPFLI-CARRID , SPFLI-CONNID.
HIDE SPFLI-CARRID.
ENDSELECT.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN '1'.
SELECT * FROM SFLIGHT WHERE CARRID = SPFLI-CARRID.
WRITE :/ SFLIGHT-FLDATE, SFLIGHT-SEATSOCC.
ENDSELECT.
ENDCASE.
INTERACTIVE LISTS
INTERACTIVE LISTS
Value is stored
INTERACTIVE LISTS
INTERACTIVE LISTS
Reading Lines from Lists
To read a line from a list after an interactive list event occurred, use the
READ LINE statement:
Syntax
READ LINE <lin> [INDEX <idx>]
[FIELD VALUE <f1> [INTO <g1>] ... <fn> [INTO <gn>]].
The statement without any options stores the contents of line <lin> from
the list on which the event was triggered (index SY-LILLI) in the SY-LISEL
system field and fills all HIDE information stored for this line back into the
corresponding fields .
INTERACTIVE LISTS
Reading Lists at the Cursor Position
To retrieve information on the cursor position during an interactive event,
use the GET CURSOR statement to refer to either the field or the line.
Syntax
GET CURSOR FIELD <f> [VALUE <val>] .
INTERACTIVE LISTS
REPORT demo_list_get_cursor NO STANDARD PAGE HEADING LINE-SIZE 40.
DATA: hotspot(10) TYPE c VALUE 'Click me!',
f(10) TYPE c, off TYPE i, lin TYPE i, val(40) TYPE c, len TYPE i.
FIELD-SYMBOLS <fs> TYPE ANY.
ASSIGN hotspot TO <fs>.
WRITE 'Demonstration of GET CURSOR statement'.
SKIP TO LINE 4.
POSITION 20.
WRITE <fs> HOTSPOT COLOR 5 INVERSE ON.
INTERACTIVE LISTS
AT LINE-SELECTION.
WINDOW STARTING AT 5 6 ENDING AT 45 20.
GET CURSOR FIELD f OFFSET off
LINE lin VALUE val LENGTH len.
WRITE: 'Result of GET CURSOR FIELD: '.
ULINE AT /(28).
WRITE: / 'Field: ', f,
/ 'Offset:', off,
/ 'Line: ', lin,
/ 'Value: ', (10) val,
/ 'Length:', len.
SKIP.
GET CURSOR LINE lin OFFSET off VALUE val LENGTH len.
WRITE: 'Result of GET CURSOR LINE: '.
ULINE AT /(27).
WRITE: / 'Offset:', off,
/ 'Value: ', val,
/ 'Length:', len.
INTERACTIVE LISTS
INTERACTIVE LISTS
Calling Reports
To call a report from with in other report,use the SUBMIT statement.
To set the name of the called program statically in the programcoding.
Syntax :
SUBMIT <rep> [AND RETURN] [<options>].
The first statement starts the report<rep>,the second statement starts the
report whose name is stored in field<rep>.
INTERACTIVE LISTS
In this program we r calling a program zsapmztst1 next slide shows the
zsapmztst1.
REPORT ZSAPMZTST .
DATA : ITAB TYPE I OCCURS 10,
NUM TYPE I.
SUBMIT ZSAPMZTST1 AND RETURN.
IMPORT ITAB FROM MEMORY ID 'HK'.
LOOP AT ITAB INTO NUM.
WRITE / NUM.
ENDLOOP.
WRITE 'REPORT 1'.
ULINE.
INTERACTIVE LISTS
REPORT ZSAPMZTST1 .
DATA : NUMBER TYPE I,
ITAB TYPE I OCCURS 10.
SET PF-STATUS 'MYBACK'.
DO 5 TIMES.
NUMBER = SY-INDEX.
APPEND NUMBER TO ITAB.
WRITE : 'NUMBER'.
ENDDO.
TOP-OF-PAGE.
WRITE 'REPORT 2'.
ULINE.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MYBACK'.
EXPORT ITAB TO MEMORY ID 'HK'.
LEAVE.
ENDCASE.
INTERACTIVE LISTS
INTERACTIVE LISTS
Called Report
INTERACTIVE LISTS
Exercise 1
Create an interactive list using hide technique based on tables ekko and
ekpo. Output the following field in the basic list.
EKKO-EBELN.
Based on the output of the basic list I.e., EKKO-EBELN, output the
following fields in the secondary list by passing the field EKKO-MATNR
by HIDE Technique.
EKPO-BUKRS
EKPO-WERKS
EKPO-LGORT
EKPO-MENGE
INTERACTIVE LISTS
Solution
TABLES: EKKO, EKPO.
DATA: BEGIN OF ITAB1 OCCURS 0,
EBELN LIKE EKKO-EBELN,
END OF ITAB1.
DATA : BEGIN OF ITAB2 OCCURS 0,
MATNR LIKE EKPO-MATNR,
BUKRS LIKE EKPO-BUKRS,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
MENGE LIKE EKPO-MENGE,
END OF ITAB2.
SELECT EBELN FROM EKKO INTO ITAB1-EBELN.
WRITE :/ ITAB1-EBELN HOTSPOT.
HIDE ITAB1-EBELN.
ENDSELECT.
INTERACTIVE LISTS
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE:/ 'MATERIAL' ,12 'COMPANY',18 'PLANT',28
'STORAGE',38'QUANTITY'.
AT LINE-SELECTION.
* Interactive event, details list
* Read data corresponding to the selection criteria and
* display
SELECT MATNR BUKRS WERKS LGORT MENGE FROM EKPO INTO
CORRESPONDING
FIELDS OF ITAB2 WHERE EBELN = ITAB1-EBELN.
WRITE: / ITAB2-MATNR, * Material Number
12 ITAB2-BUKRS, * Company code
18 ITAB2-WERKS, * Plant
28 ITAB2-LGORT, * Storage Location
38 ITAB2-MENGE. *Quantity
ENDSELECT.
INTERACTIVE LISTS
Exercise NO: 2
Task:
Create a list of all flight connections for each airline carrier.
Output the following fields:
SPFLI-CARRID, SPFLI-CONNID, SPFLI-CITYFROM,
SPFLI-CITYTO, SPFLI-DEPTIME, SPFLI-ARRTIME.
Define a selection screen on which the user can enter selections for the
airline carrier (SPFLI-CARRID) and the connection ID (SPFLI-CONNID).
Read the data from table SPFLI in accordance with this selection.
When the user selects a line, the system should display a secondary
showing the flights (table SFLIGHT) available for the flight connection
concerned (see example list). Output the selected line as the header of
the secondary list. Calculate and output the number of vacant seats for
each flight. Make sure that the program can handle invalid line
selection.
INTERACTIVE LISTS
Example list
AA 0017 NEW YORK SAN FRANCISCO 13:30:00 16:31:00
Date Price Seats
max. occupied free
10.29.1995 666.67 USD 660 10 650
11.11.1995 666.67 USD 660 20 640
11.16.1995 666.67 USD 660 38 622
INTERACTIVE LISTS
Solution
REPORT ZABCD00111 .
TABLES: SPFLI, SFLIGHT.
* Report defined selection criteria for airline and for
* connection id
SELECT-OPTIONS: SELCARR FOR SPFLI-CARRID,
SELCONN FOR SPFLI-CONNID.
* Auxiliary field: number of free seats
DATA: SFREE LIKE SFLIGHT-SEATSMAX.
START-OF-SELECTION.
* Read data corresponding to the selection criteria and
* display
SELECT * FROM SPFLI
WHERE CARRID IN SELCARR AND CONNID IN SELCONN.
WRITE: / SPFLI-CARRID,
SPFLI-CONNID,
SPFLI-CITYFROM,
SPFLI-CITYTO,
INTERACTIVE LISTS
SPFLI-DEPTIME,
SPFLI-ARRTIME.
HIDE: SPFLI-CARRID, SPFLI-CONNID.
ENDSELECT.
END-OF-SELECTION.
CLEAR SPFLI-CARRID.
"initialization
AT LINE-SELECTION.
* Interactive event, details list
CHECK NOT SPFLI-CARRID IS INITIAL.
* Display detail list only if valid line-selection
WRITE SY-LISEL.
WRITE: /5 TEXT-001, 29 TEXT-002, 49 TEXT-003,
/ TEXT-004 UNDER TEXT-003, 60 TEXT-005, 70 TEXT-006.
* D: TEXT-001: Date
* D: TEXT-002: Price
* D: TEXT-003: Seats
* D: TEXT-004: Max
* D: TEXT-005: occupied TEXT-006: free
INTERACTIVE LISTS
ULINE.
SELECT * FROM SFLIGHT WHERE CARRID EQ SPFLI-CARRID
AND CONNID EQ SPFLI-CONNID.
* Read data for details list using the hided key fields,
* list output
WRITE: /5 SFLIGHT-FLDATE,
SFLIGHT-PRICE,
SFLIGHT-CURRENCY.
SFREE = SFLIGHT-SEATSMAX - SFLIGHT-SEATSOCC.
WRITE: SFLIGHT-SEATSMAX,
SFLIGHT-SEATSOCC,
SFREE.
ENDSELECT.
CLEAR SPFLI-CARRID. "initialization
INTERACTIVE LISTS
Summary
Extract datasets :
An extract is a sequential dataset you can create with a report.Use
extracts if you want to process large amount of data as a whole several
times
Declaring Extract Records as Field Groups
Filling an Extract with Data
Reading an Extract
Sorting an Extract
Lists
Lists are the output medium for data from ABAP/4 report programs.
Each program can produce up to 21 lists: one basic list and 20
secondary lists.
INTERACTIVE LISTS
Structure and the options of a list are
The Standard List
The Self-Defined List
Lists with Several Pages
Interactive List
A list is an interactive list if the user interface allows actions that trigger
events and if the corresponding interactive event keywords occur in the
report.
Events for Interactive Lists
AT LINE-SELECTION
AT PF<nn>
AT USER-COMMAND

More Related Content

PDF
Abap reports
Milind Patil
 
PPT
Alv theory
Phani Kumar
 
PPT
ABAP Programming Overview
sapdocs. info
 
PPT
Internal tables
Jibu Jose
 
DOCX
Sap abap modularization interview questions
Pradipta Mohanty
 
DOCX
OOPS ABAP.docx
JayantaPatra16
 
PDF
SAP ABAP data dictionary
Revanth Nagaraju
 
PPTX
Dbms architecture
Shubham Dwivedi
 
Abap reports
Milind Patil
 
Alv theory
Phani Kumar
 
ABAP Programming Overview
sapdocs. info
 
Internal tables
Jibu Jose
 
Sap abap modularization interview questions
Pradipta Mohanty
 
OOPS ABAP.docx
JayantaPatra16
 
SAP ABAP data dictionary
Revanth Nagaraju
 
Dbms architecture
Shubham Dwivedi
 

What's hot (20)

PDF
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
IICT Chromepet
 
DOC
Sap abap interview questions
kssr99
 
PPT
Call transaction method
Kranthi Kumar
 
PPT
Module pool programming
Subhojit- Opekkhay
 
PPTX
SAP ABAP Interview questions
IT LearnMore
 
DOC
Badi document
hamisha_malik
 
PPT
abap list viewer (alv)
Kranthi Kumar
 
PDF
Sap Abap Reports
vbpc
 
PDF
05 internal tables
Brahmaiah Punati
 
PPTX
Object oriented approach to ALV Lists in ABAP
Noman Mohamed Hanif
 
PPT
SAP ABAP - Needed Notes
Akash Bhavsar
 
PPTX
Sap scripts
Jugul Crasta
 
PPTX
Reports
Jugul Crasta
 
PDF
Lsmw for master data upload simple explanation
Manoj Kumar
 
PPTX
Oops abap fundamental
biswajit2015
 
PDF
Smartforms interview questions with answers
Uttam Agrawal
 
PPT
ABAP Event-driven Programming &Selection Screen
sapdocs. info
 
PPTX
Slide 4 dbms users
Visakh V
 
DOCX
Field symbols
skumar_sap
 
DOC
Abap coding standards
surendra1579
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
IICT Chromepet
 
Sap abap interview questions
kssr99
 
Call transaction method
Kranthi Kumar
 
Module pool programming
Subhojit- Opekkhay
 
SAP ABAP Interview questions
IT LearnMore
 
Badi document
hamisha_malik
 
abap list viewer (alv)
Kranthi Kumar
 
Sap Abap Reports
vbpc
 
05 internal tables
Brahmaiah Punati
 
Object oriented approach to ALV Lists in ABAP
Noman Mohamed Hanif
 
SAP ABAP - Needed Notes
Akash Bhavsar
 
Sap scripts
Jugul Crasta
 
Reports
Jugul Crasta
 
Lsmw for master data upload simple explanation
Manoj Kumar
 
Oops abap fundamental
biswajit2015
 
Smartforms interview questions with answers
Uttam Agrawal
 
ABAP Event-driven Programming &Selection Screen
sapdocs. info
 
Slide 4 dbms users
Visakh V
 
Field symbols
skumar_sap
 
Abap coding standards
surendra1579
 
Ad

Similar to SAP-ABAP-List-Processing.ppt (20)

PPT
Hechsp 001 Chapter 2
Brian Kelly
 
PPTX
Report Generation by Quick Viewer-SQVI.pptx
MdRashidulAlam1
 
PPT
Oracle General Ledger GL FSG
Rizwan Ali Qumbrani
 
PPT
Sap abap training Overview
raviadm100
 
PDF
BAPI - Criação de Ordem de Manutenção
Roberto Fernandes Ferreira
 
PDF
Sap scripts
Kranthi Kumar
 
PPT
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
untellectualism
 
PPTX
Unit 2 web technologies
tamilmozhiyaltamilmo
 
PPT
Looking for best Sap abap training institute in Chennai
Raja AMEKS Infotech
 
PPT
Myth busters - performance tuning 101 2007
paulguerin
 
PPTX
Sap abap
nrj10
 
PDF
Enhancing statistical report capabilities using the clin plus report engine
Clin Plus
 
PPT
The ABAP Query
PeterHBrown
 
PPT
Data_Dictionary of sap abap known as DDIC.ppt
pagajal493
 
PPTX
Access ppt
VarunSanthosh2
 
DOC
Complete list of all sap abap keywords
Prakash Thirumoorthy
 
DOC
Report exchange designer
Bhushan Rajgure
 
PPTX
SAP ABAP Latest Interview Questions
piyushchawala
 
DOCX
Report exchange designer
rlsotto
 
PDF
Abap Questions
Kaustav Pyne
 
Hechsp 001 Chapter 2
Brian Kelly
 
Report Generation by Quick Viewer-SQVI.pptx
MdRashidulAlam1
 
Oracle General Ledger GL FSG
Rizwan Ali Qumbrani
 
Sap abap training Overview
raviadm100
 
BAPI - Criação de Ordem de Manutenção
Roberto Fernandes Ferreira
 
Sap scripts
Kranthi Kumar
 
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
untellectualism
 
Unit 2 web technologies
tamilmozhiyaltamilmo
 
Looking for best Sap abap training institute in Chennai
Raja AMEKS Infotech
 
Myth busters - performance tuning 101 2007
paulguerin
 
Sap abap
nrj10
 
Enhancing statistical report capabilities using the clin plus report engine
Clin Plus
 
The ABAP Query
PeterHBrown
 
Data_Dictionary of sap abap known as DDIC.ppt
pagajal493
 
Access ppt
VarunSanthosh2
 
Complete list of all sap abap keywords
Prakash Thirumoorthy
 
Report exchange designer
Bhushan Rajgure
 
SAP ABAP Latest Interview Questions
piyushchawala
 
Report exchange designer
rlsotto
 
Abap Questions
Kaustav Pyne
 
Ad

Recently uploaded (20)

PDF
Doc9.....................................
SofiaCollazos
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Doc9.....................................
SofiaCollazos
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 

SAP-ABAP-List-Processing.ppt

  • 2. LIST PROCESSING Objective Extract datasets Filling an extract with data Reading an extract Sorting an Extract Lists Standard list Self-Defined list List with several pages Interactive lists At line-selection At PF <nn> At User-command
  • 3. LIST PROCESSING . Refining Data A report must sort data,calculate totals,count item in lists and so on. you can read the data to be refined from database tables or from sequential files or u can create generic report. The refining process is independent of the process of retrieving data. Create data set Refine the data set
  • 4. LIST PROCESSING . Creating and Refining datasets: Abap/4 offers two methods of creating datasets in the storage Internal tables Extract datasets Internal tables : If you want the datasets to map the underlying data structures as closely as possible and if you want to access individual data directly. Extract datasets : An extract is a sequential dataset you can create with a report.Use extracts if you want to process large amount of data as a whole several times
  • 5. LIST PROCESSING . Refining data using EXTRACT DATASETS: An Extract is a sequential dataset in the report’s storage area.this means that you can access its data only within a loop. During the report’s run time,the system can create exactly one extract dataset. As for internal tables the size of the extract data set is principally unlimited,since the system rolls it out if necessary. In one extract dataset,you can store records of different length and structure one after the other.
  • 6. LIST PROCESSING . Declaring Extract Records as Field Groups An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement. Syntax FIELD-GROUPS <fg>.
  • 7. LIST PROCESSING . Filling an Extract with Data Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: Syntax EXTRACT <fg>. When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset
  • 8. LIST PROCESSING . Reading an Extract Like internal tables, you can read the data in an extract dataset using a loop. syntax LOOP. … [AT FIRST | AT <fgi> [WITH <fg j>] | AT LAST. ... ENDAT.] ... ENDLOOP.
  • 9. LIST PROCESSING . Sorting an Extract You can sort an extract dataset in much the same way as an internal table by using the following statement: syntax SORT [ASCENDING|DESCENDING] [AS TEXT] [STABLE] BY <f1> [ASCENDING|DESCENDING] [AS TEXT] ... <fn> [ASCENDING|DESCENDING] [AS TEXT].
  • 10. LIST PROCESSING . Processing Control Levels When you sort an extract dataset, control levels are defined in it. For general information about control levels, The control level hierarchy of an extract dataset corresponds to the sequence of the fields in the HEADER field group. After sorting, you can use the AT statement within a loop to program statement blocks that the system processes only at a control break, that is, when the control level changes. Syntax AT NEW <f> | AT END OF <f>. ... ENDAT.
  • 11. BASIC LISTS Lists Lists are the output medium for data from ABAP/4 report programs. Each program can produce up to 21 lists: one basic list and 20 secondary lists. Structure and the options of a list are The Standard List The Self-Defined List Lists with Several Pages
  • 12. BASIC LISTS The standard list If an ABAP/4 report makes use only of the WRITE, SKIP, and ULINE output statements .This list is called standard list. The standard list consists of: Standard Page Header Standard Page User Interface of the Standard List The next slide shows a standard list.
  • 14. BASIC LISTS The Self-Defined List Self-defined list is a list created by modifying the standard list by using options of the REPORT statement and using event keywords TOP-OF-PAGE and END-OF-PAGE. The possible modifications that can be performed in a standard list are : Page Header List Width Page Length Page Footer
  • 15. BASIC LISTS Page Header To layout a page header individually, you must define it in the processing block following the event keyword TOP-OF-PAGE: Syntax TOP-OF-PAGE. WRITE: .... The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list and before outputting the first line on a new page. Note : The self-defined page header appears beneath the standard page header. If you want to suppress the standard page header, use the NO STANDARD PAGE HEADING option of the REPORT statement.
  • 16. BASIC LISTS REPORT demo_list_page_heading NO STANDARD PAGE HEADING. TOP-OF-PAGE. WRITE: sy-title, 40 'Page', sy-pagno. ULINE. WRITE: / 'SAP AG', 29 'Walldorf, ',sy-datum, / 'Neurottstr. 16', / '69190 Walldorf/Baden'. ULINE. START-OF-SELECTION. DO 5 TIMES. WRITE / sy-index. ENDDO.
  • 18. BASIC LISTS List Width To determine the width of the output list, use the LINE-SIZE option of the REPORT statement. Syntax REPORT <rep> LINE-SIZE <width>. Note : •If you set <width> to 0, the system uses the width of the standardlist . •The system field SY-LINSZ contains the current line width
  • 19. BASIC LISTS Page Length To determine the page length of an output list, use the LINE-COUNT option of the REPORT statement. Syntax REPORT <rep> LINE-COUNT <length>[(<n>)]. <n> ---->The system reserves <n> lines of the page length for the page footer. Note : •If you set <length> to zero, the system uses the standard page length . •The system field SY-LINCT contains the current number of lines per page
  • 20. BASIC LISTS REPORT demo_list_line_count LINE-SIZE 40 LINE- COUNT 4. WRITE: 'SY-LINCT:', sy-linct. SKIP. DO 6 TIMES. WRITE / sy-index. ENDDO.
  • 22. BASIC LISTS Page Footer To define a page footer, use the END-OF-PAGE event. Syntax END-OF-PAGE. WRITE: .... This event occurs when the system reaches the lines reserved for the page footer, or if the RESERVE statement triggers a page break. Note : The system only processes the processing block following END-OF-PAGE if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement .
  • 23. BASIC LISTS REPORT demo_list_end_of_page LINE-SIZE 40 LINE-COUNT 6(2) NO STANDARD PAGE HEADING. TOP-OF-PAGE. WRITE: 'Page with Header and Footer'. ULINE AT /(27). END-OF-PAGE. ULINE. WRITE: /30 'Page', sy-pagno. START-OF-SELECTION. DO 6 TIMES. WRITE / sy-index. ENDDO.
  • 25. BASIC LISTS Lists with Several Pages If in your report has more number of lines than defined in the LINE- COUNT option of the REPORT statement, the system automatically creates a new page . Apart from automatic page breaks, you can use the NEW-PAGE and RESERVE statements to code page breaks explicitly.
  • 26. BASIC LISTS Page Break- Conditional To execute a page break under the condition that less than a certain number of lines is left on a page, use the RESERVE statement: Syntax RESERVE <n> LINES. This statement triggers a page break if less than <n> free lines are left on the current list page between the last output and the page footer. Before starting a new page, the system processes the END-OF-PAGE event.
  • 27. BASIC LISTS REPORT demo_list_reserve LINE-SIZE 40 LINE-COUNT 8(2). END-OF-PAGE. ULINE. START-OF-SELECTION. DO 4 TIMES. WRITE / sy-index. ENDDO. DO 2 TIMES. WRITE / sy-index. ENDDO. RESERVE 3 LINES. WRITE: / 'LINE 1', / 'LINE 2', / 'LINE 3'.
  • 29. BASIC LISTS Page Break- Unconditional Syntax NEW-PAGE. * Ends the current page. All other output appears on a new page. * The system then increases the SY-PAGNO system field by one. * Does not trigger the END-OF-PAGE event. Variants in NEW_PAGE are: NEW-PAGE [NO-TITLE|WITH-TITLE] NO-HEADING|WITH-HEADING]. NEW-PAGE LINE-COUNT <length>. NEW-PAGE LINE-SIZE <width>.
  • 30. BASIC LISTS REPORT demo_list_new_page LINE-SIZE 40. TOP-OF-PAGE. WRITE: 'TOP-OF-PAGE', sy-pagno. ULINE AT /(17). START-OF-SELECTION. DO 2 TIMES. WRITE / 'Loop:'. DO 3 TIMES. WRITE / sy-index. ENDDO. NEW-PAGE. ENDDO.
  • 32. BASIC LISTS Scrolling from within the Program From within the program, you can scroll through lists vertically and horizontally. The SCROLL statement allows you: Vertical Scrolling Scrolling Window by Window Scrolling by Pages Horizontal Scrolling Scrolling to the List's Margins Scrolling by Columns
  • 33. BASIC LISTS Scrolling Window by Window To scroll through a list vertically by the size of the current window use this statement: Syntax SCROLL LIST FORWARD|BACKWARD. This statement scrolls forward or backward through the current list by the size of the current window.
  • 34. BASIC LISTS REPORT demo_list_scroll_1 NO STANDARD PAGE HEADING LINE-SIZE 40. TOP-OF-PAGE. WRITE: 'Top of Page', sy-pagno, 'SY-SROWS:', sy-srows. ULINE. START-OF-SELECTION. DO 100 TIMES. WRITE / sy-index. ENDDO. DO 3 TIMES. SCROLL LIST FORWARD. ENDDO.
  • 36. BASIC LISTS Scrolling by Pages To scroll a list vertically depending on the page length, the SCROLL statement offers two options. Scrolling to Certain Pages Scrolling by a Certain Number of Pages
  • 37. BASIC LISTS Scrolling to Certain Pages To scroll to certain pages, use the TO option of the SCROLL statement: Syntax SCROLL LIST TO FIRST PAGE | LAST PAGE | PAGE <page> . This statement scrolls the current list to the first, to the last, or to the page numbered <page> .
  • 38. BASIC LISTS Scrolling by a Certain Number of Pages To scroll a list by a certain number of pages, use the following options of the SCROLL statement: Syntax SCROLL LIST FORWARD | BACKWARD <n> PAGES. This statement scrolls forward or backward <n> pages.
  • 39. BASIC LISTS Scrolling to the List's Margins To scroll horizontally to the left or right margin of a list, use the following options of the SCROLL statement: Syntax SCROLL LIST LEFT | RIGHT. This statement scrolls to the left or right margin of the currentlist.
  • 40. BASIC LISTS REPORT demo_list_scroll_3 NO STANDARD PAGE HEADING LINE-SIZE 200. TOP-OF-PAGE. WRITE: AT 161 'Top of Page', sy-pagno, 'SY-SCOLS:', sy-scols. ULINE. START-OF-SELECTION. DO 200 TIMES. WRITE sy-index. ENDDO. SCROLL LIST RIGHT.
  • 42. BASIC LISTS Scrolling by Columns To scroll a list horizontally by columns, the SCROLL statement offers two options. A column in this case means one character of the list line. •Scrolling to Certain Columns •Scrolling by a Certain Number of Columns
  • 43. BASIC LISTS Scrolling to Certain Columns To scroll to certain columns, use the TO COLUMN option of the SCROLL statement: Syntax SCROLL LIST TO COLUMN <colm> . This system displays the current list starting from column <colm>.
  • 44. BASIC LISTS Scrolling by a Certain Number of Columns To scroll a list by a certain number of columns, use the following option of the SCROLL statement: Syntax SCROLL LIST LEFT | RIGHT BY <n> PLACES. This system scrolls the current list to the left or right by <n> columns.
  • 45. BASIC LISTS REPORT demo_list_scroll_4 NO STANDARD PAGE HEADING LINE-SIZE 200. TOP-OF-PAGE. WRITE: AT 161 'Top of Page', sy-pagno, 'SY-SCOLS:', sy-scols. ULINE. START-OF-SELECTION. DO 200 TIMES. WRITE sy-index. ENDDO. SCROLL LIST TO COLUMN 178.
  • 47. BASIC LISTS Left Boundary for Horizontal Scrolling To determine the left boundary of the horizontally scrollable area, use: Syntax SET LEFT SCROLL-BOUNDARY [COLUMN <col>].
  • 48. BASIC LISTS Excluding Lines from Horizontal Scrolling To exclude a line (for example, a header or comment line) from horizontal scrolling, define the line feed for that line as follows: Syntax NEW-LINE NO-SCROLLING. The line following the statement cannot be scrolled horizontally. However, it can be scrolled vertically.
  • 49. INTERACTIVE LIST A list is an interactive list if the user interface allows actions that trigger events and if the corresponding interactive event keywords occur in the report. All lists created during an interactive list event are secondary lists. Interactive lists enhance the classical type of output list with dialog functionality,thus coming close to dialog programming. Interactive lists provide the user with so-called “interactive reporting” facility. Interactive reporting allows the user to participate actively in retrieving and presenting data during the the session. Instead of one extensive and detailed list,with interactive reporting you create a condensed basic list from which the user can call detailed information by positioning the cursor and entering commands. Interactive reporting thus reduces information retrieval to the data actually required. Detailed information is presented in secondary lists.
  • 51. INTERACTIVE LISTS Events for Interactive Lists •AT LINE-SELECTION •AT PF<nn> •AT USER-COMMAND
  • 52. INTERACTIVE LISTS Allowing Line Selection To allow the user to select a line from the list, define and write a processing block for the AT LINE-SELECTION event in your program: Syntax AT LINE-SELECTION. <statements>. In the predefined interface, Edit --> Choose and F2 are assigned to PICK.
  • 53. INTERACTIVE LISTS Page Headers for Secondary Lists On secondary lists, the system does not trigger the event TOP-OF-PAGE. To create page headers for secondary list: Syntax TOP-OF-PAGE DURING LINE-SELECTION. The system triggers this event for each secondary list.
  • 54. INTERACTIVE LISTS Program which shows At LINE-SELECTION & TOP-OF-PAGE DURING LINE-SELECTION. REPORT demo_list_interactive_3 . START-OF-SELECTION. WRITE 'Basic List'. AT LINE-SELECTION. WRITE 'Secondary List'. TOP-OF-PAGE DURING LINE-SELECTION. CASE sy-lsind. WHEN 1. WRITE 'First Secondary List'. WHEN 2. WRITE 'Second Secondary List'. WHEN OTHERS. WRITE: 'Secondary List, Level:', sy-lsind. ENDCASE. ULINE.
  • 55. INTERACTIVE LISTS This is the basic list Page Header in Basic List • When clicked on the basic list Event AT LINE-SELECTION is triggered. • Next Slide shows the modified Page Header and Text of the Secondary List
  • 56. INTERACTIVE LISTS This is the secondary list Changed Page Header in secondary list
  • 57. INTERACTIVE LISTS Allowing Function Key Selection To allow the user to select an action by pressing a function key, Syntax AT PF<nn>. <statements>. <nn> is a number between 1 and 24. SY-UCOMM returns the function code PF<nn>.
  • 58. INTERACTIVE LISTS START-OF-SELECTION. WRITE 'Basic List, Press PF5, PF6, PF7, or PF8'. AT pf5. PERFORM out. AT pf6. PERFORM out. AT pf7. PERFORM out. AT pf8. PERFORM out. FORM out. WRITE: 'Secondary List by PF-Key Selection', / 'SY-LSIND =', sy-lsind, / 'SY-UCOMM =', sy-ucomm. ENDFORM.
  • 59. INTERACTIVE LISTS If any function keys f5,f6,f7 & f8 are pressed it will take you to the relavent secondary list
  • 60. INTERACTIVE LISTS Secondary list when function key(f5) is pressed
  • 61. INTERACTIVE LISTS Setting a Status You set the status with the SET PF-STATUS statement, Syntax SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]. Note: For the Status type of interactive lists, choose List or List in dialog box. The system then automatically loads function codes predefined for list processing into the Menu Painter.
  • 62. INTERACTIVE LISTS The AT USER-COMMAND Event To allow your program to react to a user action triggering a self-defined function code Syntax AT USER-COMMAND. <statements>. The AT USER-COMMAND event occurs whenever the user selects a self- defined function code from a self-defined user interface. The event does not occur if the user selects function codes predefined for system functions or the function code PICK, which always triggers the AT LINE-SELECTION event.
  • 63. INTERACTIVE LISTS REPORT demo_list_at_user_command NO STANDARD PAGE HEADING. START-OF-SELECTION. WRITE: 'Basic List', / 'SY-LSIND:', sy-lsind. TOP-OF-PAGE. WRITE 'Top-of-Page'. ULINE. TOP-OF-PAGE DURING LINE-SELECTION. CASE sy-pfkey. WHEN 'TEST'. WRITE 'Self-defined GUI for Function Codes'. ULINE. ENDCASE. AT LINE-SELECTION. SET PF-STATUS 'TEST' EXCLUDING 'PICK'. PERFORM out. sy-lsind = sy-lsind - 1.
  • 64. INTERACTIVE LISTS When clicked on the Basic list AT LINE-SELECTION event is triggred and secondary list is displayed which has pf- status.
  • 65. INTERACTIVE LISTS At USER-COMMAND when any of the button in application tool bar are pressed it will take to relavent lists.
  • 66. INTERACTIVE LISTS Important System Fields for Secondary Lists SY-LSIND Index of the list 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-UCOMM Function code that triggered the event SY-PFKEY Status of the displayed list
  • 67. INTERACTIVE LISTS Messages in Lists: They are grouped by language, a two-character ID, and a three-digit number. From your program, you can send a message with different qualifications: A Abend; the current transaction is stopped E Error; the system waits for new input data I Information; after pressing ENTER, the system continues processing S Confirmation; the message appears on the next screen W Warning; you can change the input data or continue by pressing ENTER You must specify the MESSAGE-ID behind the REPORT statement of your program.
  • 68. INTERACTIVE LISTS REPORT demo_list_interactive_4 NO STANDARD PAGE HEADING. START-OF-SELECTION. WRITE 'Basic List'. MESSAGE s888(sabapdocu) WITH text-001. AT LINE-SELECTION. IF sy-lsind = 1. MESSAGE i888(sabapdocu) WITH text-002. ENDIF. IF sy-lsind = 2. MESSAGE e888(sabapdocu) WITH text-003 sy-lsind text-004. ENDIF. WRITE: 'Secondary List, SY-LSIND:', sy-lsind.
  • 69. INTERACTIVE LISTS Popup window showing the message in the lists
  • 70. INTERACTIVE LISTS Defining Titles for Interactive Lists By default, the system uses the program title as the title of the output screen of a report. To choose another title for the output screens, use this statement: Syntax SET TITLEBAR <tit> [WITH <g1> ... <g9>].
  • 71. INTERACTIVE LISTS Displaying Lists in Dialog Windows To display a secondary list in a dialog window use the WINDOW statement: Syntax WINDOW STARTING AT <left> <upper> [ENDING AT <right> <lower>]. The WINDOW statement takes effect only within the processing block of an interactive event, that is, only for secondary lists. Note: Dialog windows have no menu bar and no standard toolbar
  • 72. INTERACTIVE LISTS REPORT demo_list_window NO STANDARD PAGE HEADING. START-OF-SELECTION. SET PF-STATUS 'BASIC'. WRITE 'Select line for a demonstration of windows'. AT USER-COMMAND. CASE sy-ucomm. WHEN 'SELE'. IF sy-lsind = 1. SET PF-STATUS 'DIALOG'. SET TITLEBAR 'WI1'. WINDOW STARTING AT 5 3 ENDING AT 40 10. WRITE 'Select line for a second window'. ELSEIF sy-lsind = 2. SET PF-STATUS 'DIALOG' EXCLUDING 'SELE'. SET TITLEBAR 'WI2'. WINDOW STARTING AT 45 10 ENDING AT 60 12. WRITE 'Last window'. ENDIF. ENDCASE.
  • 74. INTERACTIVE LISTS Triggering Events from within the Program Instead of letting the user trigger an interactive event by an action on the output screen, you can yourself trigger events from within the program. Syntax SET USER-COMMAND <fc>. This statement takes effect after the current list is completed. Before the system displays the list, it triggers the event that corresponds to the function code stored in <fc>,independent of the applied user interface. Note: Function code PICK triggers an event only if the cursor is located on a list line .
  • 75. INTERACTIVE LISTS Passing data from list to report To effectively use interactive lists for interactive reporting, it is not sufficient for the program to react to events triggered by user actions on the output list. You must also be able to interpret the lines selected by the user and their contents. Following options are available: Passing data automatically using system fields Using statements in the program to fetch data
  • 76. INTERACTIVE LISTS Using SY-LISEL The SY-LISEL system field is a field of type C with a length of 255 characters. It contains the selected line as one single character string, thus making it difficult for you to retrieve the values of individual fields. To process certain parts of SY-LISEL, you must specify the corresponding offsets
  • 77. INTERACTIVE LISTS REPORT demo_list_sy_lisel NO STANDARD PAGE HEADING. DATA num TYPE i. SKIP. WRITE 'List of Quadratic Numbers between One and Hundred'. SKIP. WRITE 'List of Cubic Numbers between One and Hundred'. TOP-OF-PAGE. WRITE 'Choose a line!'. ULINE. TOP-OF-PAGE DURING LINE-SELECTION. WRITE sy-lisel. ULINE.
  • 78. INTERACTIVE LISTS AT LINE-SELECTION. IF sy-lisel(4) = 'List'. CASE sy-lilli. WHEN 4. DO 100 TIMES. num = sy-index ** 2. WRITE: / sy-index, num. ENDDO. WHEN 6. DO 100 TIMES. num = sy-index ** 3. WRITE: / sy-index, num. ENDDO. ENDCASE. ENDIF.
  • 81. INTERACTIVE LISTS Passing Data by Program Statements HIDE The moment you create a list level you can define which information to pass to the subsequent secondary lists. READ LINE Use the statements READ LINE and READ CURRENT LINE to explicitly read data from the lines of existing list levels. 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.
  • 82. INTERACTIVE LISTS The HIDE Technique You use the HIDE technique while creating a list level to store line- specific information for later use. Syntax HIDE <f>. This statement stores the contents of variable <f> in relation to the current output line (system field SY-LINNO) internally in the so-called HIDE area. The variable <f> need not necessarily appear on the current line. As soon as the user selects a line for which you stored HIDE fields, the system fills the variables in the program with the values stored.
  • 83. INTERACTIVE LISTS REPORT Z_HIDE1 . TABLES : SPFLI, SFLIGHT. SELECT-OPTIONS : CARR FOR SPFLI-CARRID. SELECT * FROM SPFLI WHERE CARRID IN CARR. WRITE :/ SPFLI-CARRID , SPFLI-CONNID. HIDE SPFLI-CARRID. ENDSELECT. AT LINE-SELECTION. CASE SY-LSIND. WHEN '1'. SELECT * FROM SFLIGHT WHERE CARRID = SPFLI-CARRID. WRITE :/ SFLIGHT-FLDATE, SFLIGHT-SEATSOCC. ENDSELECT. ENDCASE.
  • 87. INTERACTIVE LISTS Reading Lines from Lists To read a line from a list after an interactive list event occurred, use the READ LINE statement: Syntax READ LINE <lin> [INDEX <idx>] [FIELD VALUE <f1> [INTO <g1>] ... <fn> [INTO <gn>]]. The statement without any options stores the contents of line <lin> from the list on which the event was triggered (index SY-LILLI) in the SY-LISEL system field and fills all HIDE information stored for this line back into the corresponding fields .
  • 88. INTERACTIVE LISTS Reading Lists at the Cursor Position To retrieve information on the cursor position during an interactive event, use the GET CURSOR statement to refer to either the field or the line. Syntax GET CURSOR FIELD <f> [VALUE <val>] .
  • 89. INTERACTIVE LISTS REPORT demo_list_get_cursor NO STANDARD PAGE HEADING LINE-SIZE 40. DATA: hotspot(10) TYPE c VALUE 'Click me!', f(10) TYPE c, off TYPE i, lin TYPE i, val(40) TYPE c, len TYPE i. FIELD-SYMBOLS <fs> TYPE ANY. ASSIGN hotspot TO <fs>. WRITE 'Demonstration of GET CURSOR statement'. SKIP TO LINE 4. POSITION 20. WRITE <fs> HOTSPOT COLOR 5 INVERSE ON.
  • 90. INTERACTIVE LISTS AT LINE-SELECTION. WINDOW STARTING AT 5 6 ENDING AT 45 20. GET CURSOR FIELD f OFFSET off LINE lin VALUE val LENGTH len. WRITE: 'Result of GET CURSOR FIELD: '. ULINE AT /(28). WRITE: / 'Field: ', f, / 'Offset:', off, / 'Line: ', lin, / 'Value: ', (10) val, / 'Length:', len. SKIP. GET CURSOR LINE lin OFFSET off VALUE val LENGTH len. WRITE: 'Result of GET CURSOR LINE: '. ULINE AT /(27). WRITE: / 'Offset:', off, / 'Value: ', val, / 'Length:', len.
  • 92. INTERACTIVE LISTS Calling Reports To call a report from with in other report,use the SUBMIT statement. To set the name of the called program statically in the programcoding. Syntax : SUBMIT <rep> [AND RETURN] [<options>]. The first statement starts the report<rep>,the second statement starts the report whose name is stored in field<rep>.
  • 93. INTERACTIVE LISTS In this program we r calling a program zsapmztst1 next slide shows the zsapmztst1. REPORT ZSAPMZTST . DATA : ITAB TYPE I OCCURS 10, NUM TYPE I. SUBMIT ZSAPMZTST1 AND RETURN. IMPORT ITAB FROM MEMORY ID 'HK'. LOOP AT ITAB INTO NUM. WRITE / NUM. ENDLOOP. WRITE 'REPORT 1'. ULINE.
  • 94. INTERACTIVE LISTS REPORT ZSAPMZTST1 . DATA : NUMBER TYPE I, ITAB TYPE I OCCURS 10. SET PF-STATUS 'MYBACK'. DO 5 TIMES. NUMBER = SY-INDEX. APPEND NUMBER TO ITAB. WRITE : 'NUMBER'. ENDDO. TOP-OF-PAGE. WRITE 'REPORT 2'. ULINE. AT USER-COMMAND. CASE SY-UCOMM. WHEN 'MYBACK'. EXPORT ITAB TO MEMORY ID 'HK'. LEAVE. ENDCASE.
  • 97. INTERACTIVE LISTS Exercise 1 Create an interactive list using hide technique based on tables ekko and ekpo. Output the following field in the basic list. EKKO-EBELN. Based on the output of the basic list I.e., EKKO-EBELN, output the following fields in the secondary list by passing the field EKKO-MATNR by HIDE Technique. EKPO-BUKRS EKPO-WERKS EKPO-LGORT EKPO-MENGE
  • 98. INTERACTIVE LISTS Solution TABLES: EKKO, EKPO. DATA: BEGIN OF ITAB1 OCCURS 0, EBELN LIKE EKKO-EBELN, END OF ITAB1. DATA : BEGIN OF ITAB2 OCCURS 0, MATNR LIKE EKPO-MATNR, BUKRS LIKE EKPO-BUKRS, WERKS LIKE EKPO-WERKS, LGORT LIKE EKPO-LGORT, MENGE LIKE EKPO-MENGE, END OF ITAB2. SELECT EBELN FROM EKKO INTO ITAB1-EBELN. WRITE :/ ITAB1-EBELN HOTSPOT. HIDE ITAB1-EBELN. ENDSELECT.
  • 99. INTERACTIVE LISTS TOP-OF-PAGE DURING LINE-SELECTION. WRITE:/ 'MATERIAL' ,12 'COMPANY',18 'PLANT',28 'STORAGE',38'QUANTITY'. AT LINE-SELECTION. * Interactive event, details list * Read data corresponding to the selection criteria and * display SELECT MATNR BUKRS WERKS LGORT MENGE FROM EKPO INTO CORRESPONDING FIELDS OF ITAB2 WHERE EBELN = ITAB1-EBELN. WRITE: / ITAB2-MATNR, * Material Number 12 ITAB2-BUKRS, * Company code 18 ITAB2-WERKS, * Plant 28 ITAB2-LGORT, * Storage Location 38 ITAB2-MENGE. *Quantity ENDSELECT.
  • 100. INTERACTIVE LISTS Exercise NO: 2 Task: Create a list of all flight connections for each airline carrier. Output the following fields: SPFLI-CARRID, SPFLI-CONNID, SPFLI-CITYFROM, SPFLI-CITYTO, SPFLI-DEPTIME, SPFLI-ARRTIME. Define a selection screen on which the user can enter selections for the airline carrier (SPFLI-CARRID) and the connection ID (SPFLI-CONNID). Read the data from table SPFLI in accordance with this selection. When the user selects a line, the system should display a secondary showing the flights (table SFLIGHT) available for the flight connection concerned (see example list). Output the selected line as the header of the secondary list. Calculate and output the number of vacant seats for each flight. Make sure that the program can handle invalid line selection.
  • 101. INTERACTIVE LISTS Example list AA 0017 NEW YORK SAN FRANCISCO 13:30:00 16:31:00 Date Price Seats max. occupied free 10.29.1995 666.67 USD 660 10 650 11.11.1995 666.67 USD 660 20 640 11.16.1995 666.67 USD 660 38 622
  • 102. INTERACTIVE LISTS Solution REPORT ZABCD00111 . TABLES: SPFLI, SFLIGHT. * Report defined selection criteria for airline and for * connection id SELECT-OPTIONS: SELCARR FOR SPFLI-CARRID, SELCONN FOR SPFLI-CONNID. * Auxiliary field: number of free seats DATA: SFREE LIKE SFLIGHT-SEATSMAX. START-OF-SELECTION. * Read data corresponding to the selection criteria and * display SELECT * FROM SPFLI WHERE CARRID IN SELCARR AND CONNID IN SELCONN. WRITE: / SPFLI-CARRID, SPFLI-CONNID, SPFLI-CITYFROM, SPFLI-CITYTO,
  • 103. INTERACTIVE LISTS SPFLI-DEPTIME, SPFLI-ARRTIME. HIDE: SPFLI-CARRID, SPFLI-CONNID. ENDSELECT. END-OF-SELECTION. CLEAR SPFLI-CARRID. "initialization AT LINE-SELECTION. * Interactive event, details list CHECK NOT SPFLI-CARRID IS INITIAL. * Display detail list only if valid line-selection WRITE SY-LISEL. WRITE: /5 TEXT-001, 29 TEXT-002, 49 TEXT-003, / TEXT-004 UNDER TEXT-003, 60 TEXT-005, 70 TEXT-006. * D: TEXT-001: Date * D: TEXT-002: Price * D: TEXT-003: Seats * D: TEXT-004: Max * D: TEXT-005: occupied TEXT-006: free
  • 104. INTERACTIVE LISTS ULINE. SELECT * FROM SFLIGHT WHERE CARRID EQ SPFLI-CARRID AND CONNID EQ SPFLI-CONNID. * Read data for details list using the hided key fields, * list output WRITE: /5 SFLIGHT-FLDATE, SFLIGHT-PRICE, SFLIGHT-CURRENCY. SFREE = SFLIGHT-SEATSMAX - SFLIGHT-SEATSOCC. WRITE: SFLIGHT-SEATSMAX, SFLIGHT-SEATSOCC, SFREE. ENDSELECT. CLEAR SPFLI-CARRID. "initialization
  • 105. INTERACTIVE LISTS Summary Extract datasets : An extract is a sequential dataset you can create with a report.Use extracts if you want to process large amount of data as a whole several times Declaring Extract Records as Field Groups Filling an Extract with Data Reading an Extract Sorting an Extract Lists Lists are the output medium for data from ABAP/4 report programs. Each program can produce up to 21 lists: one basic list and 20 secondary lists.
  • 106. INTERACTIVE LISTS Structure and the options of a list are The Standard List The Self-Defined List Lists with Several Pages Interactive List A list is an interactive list if the user interface allows actions that trigger events and if the corresponding interactive event keywords occur in the report. Events for Interactive Lists AT LINE-SELECTION AT PF<nn> AT USER-COMMAND