Thursday, February 10, 2011

SAP ABAP Report Programming Questions 6

Interactive Reporting

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 .

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 [INDEX ]

[FIELD VALUE [INTO ]... [INTO ]]

[OF CURRENT PAGE|OF PAGE

].

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 [OFFSET ] [LINE ]

[VALUE ] [LENGTH ].

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 .

This statement sets the cursor to column of line 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

1 comment:

navya sree said...

This post is extremely radiant. I extremely like this post. It is outstanding amongst other posts that I’ve read in quite a while. Much obliged for this better than average post. I truly value it! sap traning in hyderabad

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites