Lecture09 abap on line

12
Lecture 9 Reporting – Interactive (A) BCO5647 Applications Programming Techniques (ABAP)

description

 

Transcript of Lecture09 abap on line

Page 1: Lecture09 abap on line

Lecture 9Reporting – Interactive (A)

BCO5647 Applications Programming Techniques (ABAP)

Page 2: Lecture09 abap on line

2BCO5647

Readings & Objectives

Readings

Keller & Keller Chapter 7Section 7.3.6 & 7.3.7

Objectives

This lecture will

Introduce basic concepts of interactive reporting

Introduce interactive event statements

Examine AT LINE-SELECTION event statement in reference to interactivereports

Introduce the HIDE command and examine how it is used in interactivereports

Examine techniques to ensure valid line selection in interactive reports

Page 3: Lecture09 abap on line

3BCO5647

Interactive Reporting: Overview

A simple list can have an interactive or “drill-down” capability added wheremore detail can be displayed related to a line on the original list.

LH 0012 BERLIN NEW YORK

LH 0023 LONDON BERLIN

Flights Dates Available

for LH 0023

29.10.2006

12.11.2006

11.12.2006

12 SEATS AVAILABLE

for LH 0023 on 12.11.2006

Drill-Down

Drill-Down

Page 4: Lecture09 abap on line

4BCO5647

Interactive Reporting: Overview

Interactive reporting allows you to create secondary lists and windows. Todisplay these on the screen you use function keys, pushbuttons anddouble-clicks.

Using function keys the user can also branch to a transaction or anotherreport program.

Page 5: Lecture09 abap on line

5BCO5647

Events

ABAP is an event-driven programming language.

Event statements are markers in your program code that define when thecode associated with an event should run.

New Event statement

LOAD-OF-PROGRAM

Page 6: Lecture09 abap on line

6BCO5647

Using the AT LINE-SELECTION event

Simple Example:

report lec701a.

start-of-selection. write: / ‘basic list’. write: / sy-lsind.

at line-selection. write: / ‘secondary list after double-click’. write: / sy-lsind color 4.

Page 7: Lecture09 abap on line

7BCO5647

Using the AT LINE-SELECTION event

Page 8: Lecture09 abap on line

8BCO5647

Example: Interactive Report

Page 9: Lecture09 abap on line

9BCO5647

Using the AT LINE-SELECTION event

Page 10: Lecture09 abap on line

10BCO5647

The HIDE area

The Hide statement allows you to store the field contents for a particular listline in a special memory area.

For each field in the Hide statement, the system stores the field name andvalue.

Page 11: Lecture09 abap on line

11BCO5647

Using the AT LINE-SELECTION event

As soon as the user selects a line by double-clicking, the system passes the values stored for this line in the HIDE area back into the original fields.

Page 12: Lecture09 abap on line

12BCO5647

Valid Line Selection

In the example above, one field (spfli-carrid) whose contents is stored in the Hide areais set to the initial value.

When the user selects an invalid line, the system cannot find a corresponding value inthe Hide area.

When the CHECK statement produces a negative result, the system leaves the currentprocessing block without producing a secondary list.