Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

what are interactive report

laxman_sankhla3
Participant
0 Kudos

hi

what are interactive report.

thanks.

1 ACCEPTED SOLUTION

Former Member

hi,

It helps you to create easy-to-read lists. You can display an overview list first that contains general information and provide the user with the possibility of choosing detailed information that you display on further lists.

What are the uses of interactive reporting?

The user can actively control data retrieval and display during the session. Instead of an extensive and detailed list, you create a basic list with condensed information from which the user can switch to detailed displays by positioning the cursor and entering commands. The detailed information appears in secondary lists.

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 Moment during list processing of a

LINE-SELECTION secondary list at which a new page starts.

What is secondary list?

It allows 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. 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, active the status of the basic list using the statement: SET PF-STATUS ‘STATUS’.

What is interactive reporting?

A classical non-interactive report consists of one program that creates a single list. Instead of one extensive and detailed list, with interactive reporting you create 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.

Can we call reports and transactions from interactive reporting lists?

Yes. It 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 of change the database table whose data is displayed in the list.

What are 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-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-CPAGE Page number of the first displayed page of the list from which the event was triggered.

SY-STARO Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1). Possibly, a page header occupies this line.

SY-STACO Number of the first column displayed in the list from which the event was triggered (counting starts with 1).

SY-UCOMM Function code that triggered the event.

SY-PFKEY Status of the displayed 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 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).

How to use messages in lists?

ABAP/4 allows you to react to incorrect or doubtful user input by displaying messages that influence the program flow depending on how serious the error was. Handling messages is mainly a topic of dialog programming. You store and maintain messages in Table T100. Messages are sorted by language, by a two-character ID, and by a three-digit number. You can assign different message types to each message you output. The influence of a message on the program flow depends on the message type. In our program, use the MESSAGE statement to output messages statically or dynamically and to determine the message type.

Syntax:REPORT <rep> MESSAGE-ID <id>.

What are the types of messages?

A message can have five different types. These message types have the following effects during list processing:

.A (=Abend):

.E (=Error) or W (=Warning):

.I (=Information):

.S (=Success):

What are the user interfaces of interactive lists?

If you want the user to communicate with the system during list display, the list must be interactive. You can define specific interactive possibilities in the status of the list’s user interface (GUI). To define the statuses of interfaces in the R/3 system, use the Menu Painter tool. In the Menu Painter, assign function codes to certain interactive functions. After an user action occurs on the completed interface, the ABAP/4 processor checks the function code and, if valid, triggers the corresponding event.

What are the drill-down features provided by ABAP/4 in interactive lists?

ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list.

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?

A 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.

What is the length of function code at user-command?

Each menu function, push button, or function key has an associated function code of length FOUR (for example, FREE), which is available in the system field SYUCOMM after the user action.

Can we create a gui status in a program from the object browser?

Yes. You can create a GUI STATUS in a program using SET PF-STATUS.

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.

Can we display a list in a pop-up screen other than full-size stacked list?

Yes, we can display a list in a pop-up screen using the command WINDOW with the additions starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1 y1 and x2 y2 are the coordinates.

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 are restored from the HIDE AREA.

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 can you display frames (horizontal and vertical lines) in lists?

You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the system field SY-VLINE. The corners arising at the intersection of horizontal and vertical lines are automatically drawn by the system.

What are the events used for page headers and footers?

The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers.

How can you access the function code from menu painter?

From within the program, you can use the SY-UCOMM system field to access the function code. You can define individual interfaces for your report and assign them in the report to any list level. If you do not specify self-defined interfaces in the report but use at least one of the three interactive event keywords. AT LINE-SELECTION, AT PF<nn>, OR AT USER-COMMAND in the program, the system automatically uses appropriate predefined standard interfaces. These standard interfaces provide the same functions as the standard list described under the standard list.

How the at-user command serves mainly in lists?

The AT USER-COMMAND event serves mainly to handle own function codes. In this case, you should create an individual interface with the Menu Painter and define such function codes.

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 can you manipulate the presentation and attributes of interactive lists?

---Scrolling through Interactive Lists.

---Setting the Cursor from within the Program.

---Modifying List Lines.

How to call other programs?

Report Transaction

Call and return SUBMIT AND RETURN CALL TRANSACTION

Call without return SUBMIT LEAVE TO TRANSACTION

You can use these statements in any ABAP/4 program.

What will exactly the hide statement do?

For displaying the details on secondary lists requires that you have previously stored the contents of the selected line from within the program. To do this, ABAP/4 provides the HIDE statement. This statement stores the current field contents for the current list line. 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. Interactive lists provide the user with the so-called ‘INTERACTIVE REPORTING’ facility. For background processing the only possible method of picking the relevant data is through ‘NON INTERACTIVE REPORT’ . After starting a background job, there is no way of influencing the program. But whereas for dialog sessions there are no such restrictions.

How many lists can a program can produce?

Each program can produce up to 21 lists: one basic list and 20 secondary lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. Only one list is active, and that is always the most recently created list.

FALSE.

&----


*& Report ZLAXMI_REPORT6 *

*& *

&----


*& *

*& *

&----


REPORT ZLAXMI_REPORT6 .

tables: mara,

makt,

marc,

mard.

data: begin of it_mara occurs 0,

matnr like mara-matnr,

end of it_mara.

data: begin of it_makt occurs 0,

maktx like makt-maktx,

matnr like makt-matnr,

end of it_makt.

data: begin of it_marc occurs 0,

werks like marc-werks,

matnr like marc-matnr,

end of it_marc.

data: begin of it_mard occurs 0,

lgort like mard-lgort,

labst like mard-labst,

speme like mard-speme,

matnr like mard-matnr,

end of it_mard.

data: begin of it_final occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

werks like marc-werks,

lgort like mard-lgort,

labst like mard-labst,

speme like mard-speme,

end of it_final.

selection-screen: begin of block b1 with frame title text-001.

select-options: s_matnr for mara-matnr.

selection-screen: end of block b1 .

start-of-selection.

perform get-data.

perform write_data.

end-of-selection.

at line-selection.

perform sec_list.

&----


*& Form get-data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get-data .

select matnr

from mara

into table it_mara

where matnr in s_matnr.

if sy-subrc = 0.

select maktx

matnr from makt

into table it_makt

for all entries in it_mara

where matnr = it_mara-matnr.

endif.

ENDFORM. " get-data

&----


*& Form write_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM write_data .

loop at it_makt.

write:/ it_makt-matnr, it_makt-maktx.

endloop.

ENDFORM. " write_data

&----


*& Form sec_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sec_list .

case sy-lsind.

when '1'.

perform basic_1.

endcase.

ENDFORM. " sec_list

&----


*& Form basic_1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM basic_1 .

select werks

matnr

from marc

into table it_marc

for all entries in it_makt

where matnr = it_makt-matnr.

if sy-subrc = 0.

select lgort

labst

speme

matnr

from mard

into table it_mard

for all entries in it_makt

where matnr = it_makt-matnr.

endif.

*clear it_makt.

*clear it_mard.

read table it_marc with key matnr = it_mara-matnr binary search.

read table it_mard with key matnr = it_mara-matnr binary search.

clear it_marc.

clear it_mard.

move:it_makt-matnr to it_final-matnr,

it_makt-maktx to it_final-maktx.

move: it_marc-werks to it_final-werks,

it_mard-lgort to it_final-lgort,

it_mard-labst to it_final-labst,

it_mard-speme to it_final-speme.

append it_final.

*loop at it_final.

write:/ it_final-matnr, it_final-maktx,

it_final-werks,

it_final-labst, it_final-speme.

*endloop.

ENDFORM. " basic_1

6 REPLIES 6

Former Member

hi,

It helps you to create easy-to-read lists. You can display an overview list first that contains general information and provide the user with the possibility of choosing detailed information that you display on further lists.

What are the uses of interactive reporting?

The user can actively control data retrieval and display during the session. Instead of an extensive and detailed list, you create a basic list with condensed information from which the user can switch to detailed displays by positioning the cursor and entering commands. The detailed information appears in secondary lists.

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 Moment during list processing of a

LINE-SELECTION secondary list at which a new page starts.

What is secondary list?

It allows 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. 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, active the status of the basic list using the statement: SET PF-STATUS ‘STATUS’.

What is interactive reporting?

A classical non-interactive report consists of one program that creates a single list. Instead of one extensive and detailed list, with interactive reporting you create 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.

Can we call reports and transactions from interactive reporting lists?

Yes. It 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 of change the database table whose data is displayed in the list.

What are 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-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-CPAGE Page number of the first displayed page of the list from which the event was triggered.

SY-STARO Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1). Possibly, a page header occupies this line.

SY-STACO Number of the first column displayed in the list from which the event was triggered (counting starts with 1).

SY-UCOMM Function code that triggered the event.

SY-PFKEY Status of the displayed 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 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).

How to use messages in lists?

ABAP/4 allows you to react to incorrect or doubtful user input by displaying messages that influence the program flow depending on how serious the error was. Handling messages is mainly a topic of dialog programming. You store and maintain messages in Table T100. Messages are sorted by language, by a two-character ID, and by a three-digit number. You can assign different message types to each message you output. The influence of a message on the program flow depends on the message type. In our program, use the MESSAGE statement to output messages statically or dynamically and to determine the message type.

Syntax:REPORT <rep> MESSAGE-ID <id>.

What are the types of messages?

A message can have five different types. These message types have the following effects during list processing:

.A (=Abend):

.E (=Error) or W (=Warning):

.I (=Information):

.S (=Success):

What are the user interfaces of interactive lists?

If you want the user to communicate with the system during list display, the list must be interactive. You can define specific interactive possibilities in the status of the list’s user interface (GUI). To define the statuses of interfaces in the R/3 system, use the Menu Painter tool. In the Menu Painter, assign function codes to certain interactive functions. After an user action occurs on the completed interface, the ABAP/4 processor checks the function code and, if valid, triggers the corresponding event.

What are the drill-down features provided by ABAP/4 in interactive lists?

ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list.

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?

A 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.

What is the length of function code at user-command?

Each menu function, push button, or function key has an associated function code of length FOUR (for example, FREE), which is available in the system field SYUCOMM after the user action.

Can we create a gui status in a program from the object browser?

Yes. You can create a GUI STATUS in a program using SET PF-STATUS.

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.

Can we display a list in a pop-up screen other than full-size stacked list?

Yes, we can display a list in a pop-up screen using the command WINDOW with the additions starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1 y1 and x2 y2 are the coordinates.

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 are restored from the HIDE AREA.

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 can you display frames (horizontal and vertical lines) in lists?

You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the system field SY-VLINE. The corners arising at the intersection of horizontal and vertical lines are automatically drawn by the system.

What are the events used for page headers and footers?

The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers.

How can you access the function code from menu painter?

From within the program, you can use the SY-UCOMM system field to access the function code. You can define individual interfaces for your report and assign them in the report to any list level. If you do not specify self-defined interfaces in the report but use at least one of the three interactive event keywords. AT LINE-SELECTION, AT PF<nn>, OR AT USER-COMMAND in the program, the system automatically uses appropriate predefined standard interfaces. These standard interfaces provide the same functions as the standard list described under the standard list.

How the at-user command serves mainly in lists?

The AT USER-COMMAND event serves mainly to handle own function codes. In this case, you should create an individual interface with the Menu Painter and define such function codes.

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 can you manipulate the presentation and attributes of interactive lists?

---Scrolling through Interactive Lists.

---Setting the Cursor from within the Program.

---Modifying List Lines.

How to call other programs?

Report Transaction

Call and return SUBMIT AND RETURN CALL TRANSACTION

Call without return SUBMIT LEAVE TO TRANSACTION

You can use these statements in any ABAP/4 program.

What will exactly the hide statement do?

For displaying the details on secondary lists requires that you have previously stored the contents of the selected line from within the program. To do this, ABAP/4 provides the HIDE statement. This statement stores the current field contents for the current list line. 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. Interactive lists provide the user with the so-called ‘INTERACTIVE REPORTING’ facility. For background processing the only possible method of picking the relevant data is through ‘NON INTERACTIVE REPORT’ . After starting a background job, there is no way of influencing the program. But whereas for dialog sessions there are no such restrictions.

How many lists can a program can produce?

Each program can produce up to 21 lists: one basic list and 20 secondary lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. Only one list is active, and that is always the most recently created list.

FALSE.

&----


*& Report ZLAXMI_REPORT6 *

*& *

&----


*& *

*& *

&----


REPORT ZLAXMI_REPORT6 .

tables: mara,

makt,

marc,

mard.

data: begin of it_mara occurs 0,

matnr like mara-matnr,

end of it_mara.

data: begin of it_makt occurs 0,

maktx like makt-maktx,

matnr like makt-matnr,

end of it_makt.

data: begin of it_marc occurs 0,

werks like marc-werks,

matnr like marc-matnr,

end of it_marc.

data: begin of it_mard occurs 0,

lgort like mard-lgort,

labst like mard-labst,

speme like mard-speme,

matnr like mard-matnr,

end of it_mard.

data: begin of it_final occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

werks like marc-werks,

lgort like mard-lgort,

labst like mard-labst,

speme like mard-speme,

end of it_final.

selection-screen: begin of block b1 with frame title text-001.

select-options: s_matnr for mara-matnr.

selection-screen: end of block b1 .

start-of-selection.

perform get-data.

perform write_data.

end-of-selection.

at line-selection.

perform sec_list.

&----


*& Form get-data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get-data .

select matnr

from mara

into table it_mara

where matnr in s_matnr.

if sy-subrc = 0.

select maktx

matnr from makt

into table it_makt

for all entries in it_mara

where matnr = it_mara-matnr.

endif.

ENDFORM. " get-data

&----


*& Form write_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM write_data .

loop at it_makt.

write:/ it_makt-matnr, it_makt-maktx.

endloop.

ENDFORM. " write_data

&----


*& Form sec_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sec_list .

case sy-lsind.

when '1'.

perform basic_1.

endcase.

ENDFORM. " sec_list

&----


*& Form basic_1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM basic_1 .

select werks

matnr

from marc

into table it_marc

for all entries in it_makt

where matnr = it_makt-matnr.

if sy-subrc = 0.

select lgort

labst

speme

matnr

from mard

into table it_mard

for all entries in it_makt

where matnr = it_makt-matnr.

endif.

*clear it_makt.

*clear it_mard.

read table it_marc with key matnr = it_mara-matnr binary search.

read table it_mard with key matnr = it_mara-matnr binary search.

clear it_marc.

clear it_mard.

move:it_makt-matnr to it_final-matnr,

it_makt-maktx to it_final-maktx.

move: it_marc-werks to it_final-werks,

it_mard-lgort to it_final-lgort,

it_mard-labst to it_final-labst,

it_mard-speme to it_final-speme.

append it_final.

*loop at it_final.

write:/ it_final-matnr, it_final-maktx,

it_final-werks,

it_final-labst, it_final-speme.

*endloop.

ENDFORM. " basic_1

Former Member
0 Kudos

hi



/* ABAP Interactive ALV Program*/  *&---------------------------------------------------------------------*
*& Report  ZZ_22038_22098_002                                          *
*&                                                                     *
*&---------------------------------------------------------------------*
*& This is an Interactive ALV report, where on line slection we can see
*&  the secondry list
*&
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
MESSAGE-ID ZZ_9838                      .

TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
       EBELN LIKE EKKO-EBELN,
       AEDAT LIKE EKKO-AEDAT,
       BUKRS LIKE EKKO-BUKRS,
       BSART LIKE EKKO-BSART,
       LIFNR LIKE EKKO-LIFNR,
       END OF I_EKKO.

DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
      WA_EKKO TYPE I_EKKO.

*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
       EBELN LIKE EKPO-EBELN,
       EBELP LIKE EKPO-EBELP,
       MATNR LIKE EKPO-MATNR,
       MENGE LIKE EKPO-MENGE,
       MEINS LIKE EKPO-MEINS,
       NETPR LIKE EKPO-NETPR,
       END OF I_EKPO.

DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
      WA_EKPO TYPE I_EKPO .

*variable for Report ID
DATA: V_REPID LIKE SY-REPID .

*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.


DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.

* declaration for events table where user comand or set PF status will
* be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
      WA_EVENT TYPE SLIS_ALV_EVENT.

* declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.

* declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
      I_VARIANT1 TYPE DISVARIANT,
      I_SAVE(1) TYPE C.

*PARAMETERS : p_var TYPE disvariant-variant.

*Title displayed when the alv list is displayed
DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.

INITIALIZATION.
  V_REPID = SY-REPID.
  PERFORM BUILD_FIELDCATLOG.
  PERFORM EVENT_CALL.
  PERFORM POPULATE_EVENT.

START-OF-SELECTION.
  PERFORM DATA_RETRIEVAL.
  PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
  PERFORM DISPLAY_ALV_REPORT.

*&--------------------------------------------------------------------*
*&      Form  BUILD_FIELDCATLOG
*&--------------------------------------------------------------------*
*       Fieldcatalog has all the field details from ekko
*---------------------------------------------------------------------*
FORM BUILD_FIELDCATLOG.
  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'EBELN'.
  WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'AEDAT'.
  WA_FIELDCAT-SELTEXT_M = 'DATE.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

  WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'BUKRS'.
  WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'BUKRS'.
  WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'IT_EKKO'.
  WA_FIELDCAT-FIELDNAME = 'LIFNR'.
  WA_FIELDCAT-NO_OUT    = 'X'.
  WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.


ENDFORM.                    "BUILD_FIELDCATLOG

*&--------------------------------------------------------------------*
*&      Form  EVENT_CALL
*&--------------------------------------------------------------------*
*   we get all events - TOP OF PAGE or USER COMMAND in table v_events
*---------------------------------------------------------------------*
FORM EVENT_CALL.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
   IMPORTING
     ET_EVENTS             = V_EVENTS
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    "EVENT_CALL

*&--------------------------------------------------------------------*
*&      Form  POPULATE_EVENT
*&--------------------------------------------------------------------*
*      Events populated for TOP OF PAGE & USER COMAND
*---------------------------------------------------------------------*
FORM POPULATE_EVENT.
  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
  ENDIF.

  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'USER_COMMAND'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
  ENDIF.
ENDFORM.                    "POPULATE_EVENT


*&--------------------------------------------------------------------*
*&      Form  data_retrieval
*&--------------------------------------------------------------------*
*   retreiving values from the database table ekko
*---------------------------------------------------------------------*
FORM DATA_RETRIEVAL.
  SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.

ENDFORM.                    "data_retrieval
*&--------------------------------------------------------------------*
*&      Form  bUild_listheader
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->I_LISTHEADEtext
*---------------------------------------------------------------------*
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
  DATA HLINE TYPE SLIS_LISTHEADER.
  HLINE-INFO = 'this is my first alv pgm'.
  HLINE-TYP = 'H'.
ENDFORM.                    "build_listheader

*&--------------------------------------------------------------------*
*&      Form  display_alv_report
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM DISPLAY_ALV_REPORT.
  V_REPID = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = V_REPID
     I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
     I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
     I_GRID_TITLE                      = I_TITLE_EKKO
     IT_FIELDCAT                       = I_FIELDCAT[]
     I_SAVE                            = 'A'
     IT_EVENTS                         = V_EVENTS
    TABLES
      T_OUTTAB                          = IT_EKKO

            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    "display_alv_report




*&--------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY       = IT_LISTHEADER
            .

ENDFORM.                    "TOP_OF_PAGE

*&--------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->R_UCOMM    text
*      -->,          text
*      -->RS_SLEFIELDtext
*---------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE R_UCOMM.
    WHEN '&IC1'.
      READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
      PERFORM BUILD_FIELDCATLOG_EKPO.
      PERFORM EVENT_CALL_EKPO.
      PERFORM POPULATE_EVENT_EKPO.
      PERFORM DATA_RETRIEVAL_EKPO.
      PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_EKPO.
  ENDCASE.
ENDFORM.                    "user_command
*&--------------------------------------------------------------------*
*&      Form  BUILD_FIELDCATLOG_EKPO
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM BUILD_FIELDCATLOG_EKPO.

  WA_FIELDCAT-TABNAME = 'IT_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'EBELN'.
  WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'IT_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'EBELP'.
  WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MATNR'.
  WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MENGE'.
  WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'MEINS'.
  WA_FIELDCAT-SELTEXT_M = 'UOM'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'I_EKPO'.
  WA_FIELDCAT-FIELDNAME = 'NETPR'.
  WA_FIELDCAT-SELTEXT_M = 'PRICE'.
  APPEND WA_FIELDCAT TO I_FIELDCAT.
  CLEAR WA_FIELDCAT.


ENDFORM.                    "BUILD_FIELDCATLOG_EKPO

*&--------------------------------------------------------------------*
*&      Form  event_call_ekpo
*&--------------------------------------------------------------------*
*   we get all events - TOP OF PAGE or USER COMMAND in table v_events
*---------------------------------------------------------------------*
FORM EVENT_CALL_EKPO.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
   EXPORTING
     I_LIST_TYPE           = 0
   IMPORTING
     ET_EVENTS             = V_EVENTS

            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    "event_call_ekpo


*&--------------------------------------------------------------------*
*&      Form  POPULATE_EVENT
*&--------------------------------------------------------------------*
*        Events populated for TOP OF PAGE & USER COMAND
*---------------------------------------------------------------------*
FORM POPULATE_EVENT_EKPO.
  READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
  IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
  ENDIF.

  ENDFORM.                    "POPULATE_EVENT

*&--------------------------------------------------------------------*
*&      Form  TOP_OF_PAGE
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
FORM F_TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY       = IT_LISTHEADER
            .

ENDFORM.                    "TOP_OF_PAGE

*&--------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->R_UCOMM    text
*      -->,          text
*      -->RS_SLEFIELDtext
*---------------------------------------------------------------------*

*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.

FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.


FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   I_CALLBACK_PROGRAM                = V_REPID
   I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
   I_GRID_TITLE                      = I_TITLE_EKPO
   IT_FIELDCAT                       = I_FIELDCAT[]
   I_SAVE                            = 'A'
   IT_EVENTS                         = V_EVENTS
  TABLES
    T_OUTTAB                          = IT_EKPO
 EXCEPTIONS
   PROGRAM_ERROR                     = 1
   OTHERS                            = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.

regards

ravish

<b>plz dont forget to reward if useful</b>

Former Member
0 Kudos

<b>Interactive Reports</b>

As the name suggests, the user can Interact with the report. We can have a drill down into the report data. For example, Column one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can HIDE that data under those material numbers.

And when the user clicks the material number, another report (actually sub report/secondary list) which displays the vendor details will be displayed.

We can have a basic list (number starts from 0) and 20 secondary lists (1 to 21).

Events associated with Interactive Reports are:

1. AT LINE-SELECTION

2. AT USER-COMMAND

3. AT PF<key>

4. TOP-OF-PAGE DURING LINE-SELECTION.

HIDE statement holds the data to be displayed in the secondary list.

sy-lisel : contains data of the selected line.

sy-lsind : contains the level of report (from 0 to 21)

Interactive Report Events:

  • AT LINE-SELECTION : This Event triggers when we double click a line on the list, when the event is triggered a new sublist is going to be generated. Under this event what ever the statements that are been return will be displayed on newly generated sublist.

  • AT PFn: For predefined function keys...

  • AT USER-COMMAND : It provides user functions keys.

  • TOP-OF-PAGE DURING LINE-SELECTION :top of page event for secondary list.

<b>Check this example</b>

report zmjud001 no standard page heading line-size 85 line-count 50.

  • DATA /TABLES DECLARATION*

tables: eban.

data: prog_nam(8).

data: begin of pur_req occurs 100,

ekgrp like eban-ekgrp,

werks like eban-werks,

banfn like eban-banfn,

bnfpo like eban-bnfpo,

bsart like eban-bsart,

estkz like eban-estkz,

matnr like eban-matnr,

menge like eban-menge,

meins like eban-meins,

numb(3) type n.

data: end of pur_req.

  • THE REPORT HEADER

prog_nam = sy-repid.

top-of-page.

perform header_write.

  • SELECTION

start-of-selection.

pur_req-numb = 1.

  • SELECT ONLY THOSE FIELDS THAT WILL BE USED FROM THE TABLE EBAN, AND ONLY

*THE FIRST100 RECORDS OF THE THE PLANT 'PL01'

select banfn bnfpo bsart ekgrp matnr werks menge meins frgdt estkz

into corresponding fields of eban from eban up to 100 rows

where bsart = 'NB' "document type 'NB' = purchase requisition

and werks = 'PL01'

and statu = 'N' "processing status

and loekz = ' '. "deletion indicator

  • THE SELECTED RECORDS SHOULD BE APPENDED TO INTERNAL TABLE 'PUR_REQ'

pur_req-banfn = eban-banfn.

pur_req-matnr = eban-matnr.

pur_req-werks = eban-werks.

pur_req-ekgrp = eban-ekgrp.

pur_req-bnfpo = eban-bnfpo.

pur_req-bsart = eban-bsart.

pur_req-menge = eban-menge.

pur_req-meins = eban-meins.

pur_req-estkz = eban-estkz.

append pur_req.

pur_req-numb = pur_req-numb + 1.

endselect.

  • CHECK WHETHER THE TABLE EBAN CONTAINS ANY PURCHASE REQUISITIONS

if sy-subrc ne 0.

write: / 'No Purchase Requisition found.'.

endif.

  • PROCESS THE INTERNAL TABLE; WRITE OUT THE REQUIRED FIELDS AND HIDE THE

*FIELDS YOU ARE GOING TO USE LATER

loop at pur_req.

write: /1 pur_req-numb, 9 pur_req-banfn, 21 pur_req-bnfpo, 31 pur_req-bsart, 41 pur_req-matnr,

61 pur_req-menge unit pur_req-meins, 82 pur_req-meins.

hide: pur_req-matnr, pur_req-werks, pur_req-banfn.

endloop.

clear pur_req-banfn. clear pur_req-matnr. clear pur_req-werks.

  • IN THE MENU PAINTER (SE41) CREATE A STATUS TO YOUR PROGRAM. HERE YOU CAN

*DEFINE THE PUSH-BUTTON

set pf-status 'basic'.

  • CHOOSE A REQUISITION (WITH DOUBLE CLICKING OR PUSH-BUTTON) IN THE LIST! THE

*PURCHASE REQUISITION IS GOING TO COME UP

at line-selection.

if pur_req-banfn <> space.

set parameter id 'BAN' field pur_req-banfn. " parameter id for pruchase req. number

call transaction 'ME52' and skip first screen. "trans. code 'ME52': Change Purchase Requis.

clear pur_req-banfn. clear pur_req-matnr.

clear pur_req-werks.

endif.

  • FORM THE HEADER

form header_write.

write: / prog_nam, 32 'FUN-FACTORY',

/ 'Purch.Gr.:', pur_req-ekgrp, 26 'Purchase Requisition List',

61 'As Of Date:', 75 sy-datum,

/ 'Plant:', pur_req-werks, 61 'Page:', 75 sy-pagno.

uline.

write: / text-001,

/ text-002.

uline.

endform.

Regards,

Pavan

0 Kudos

HI

When the system processes event blocks that are not assigned to interactive list events, and when processing dialog modules, the ABAP program writes its list output to the basic list.

The ABAP system field SY-LSIND contains the index of the list currently being created. While the basic list is being created, SY-LSIND is zero.

By default, the basic list has a standard list status and a standard page header. The TOP-OF-PAGE and END-OF-PAGE events can occur while the basic list is being created. All output in these events is placed in the page header or footer of the basic list. In executable programs, the basic list is automatically sent to the list processor and displayed at the end of the END-OF-SELECTION event. Otherwise, it is displayed after the PAI processing block on the screen from which the LEAVE TO LIST-PROCESSING statement occurred.

Creating Detail Lists

Each time the user executes an action on a list, the runtime environment checks whether there is an event block defined that corresponds to the function code. If there is, SY-LSIND is automatically increased by one, and the relevant event block is executed. Any list output arising during this event block places its data into a new list (list level) with the index SY-LSIND. In order to create a new list level, the GUI status of the basic list must allow user actions, and the relevant event blocks must be defined in the program.

All lists created during an interactive list event are detail lists. Each interactive list event creates a new detail list. With one ABAP program, you can maintain one basic list and up to 20 detail lists. If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. The user can interact with whichever list is currently displayed.
The system displays this list after processing the entire processing block of the event keyword or after leaving the processing block due to EXIT or CHECK. By default, the new list overlays the previous list completely. However, you can display a list in a dialog box. If no other dialog status is set in the event block for the detail list, the system uses the status from the previous list level. However, there is no standard page header for detail lists (see below).

Consequences of Event Control

The fact that you program detail lists in event blocks has important consequences. You cannot nest processing blocks (see Structure of an ABAP Program). Therefore, you cannot process other events within the processing blocks of interactive lists.

Especially, you cannot



• use separate processing blocks to process further interactive events. A certain user action always triggers the same processing block in your program. You must use control statements (IF, CASE) within the processing block to make sure that the system processes the desired statements. There is a range of system field that you can use for this.
• use the event TOP-OF-PAGE to influence the list structure of secondary lists. To layout the page headers of the secondary lists, you must use the event TOP-OF-PAGE DURING LINE-SELECTION (see below). However, the system does process the event END-OF-PAGE in secondary lists.
• use events such as GET and GET LATE to retrieve data for secondary lists, but must use SELECT statements. You can use the logical database assigned to the executable program (report) only for the basic list. If you want to use a logical database during interactive events, you must either call another executable program using SUMIT, or (better) call the logical database using a function module.

Navigating in Lists:
To return from a high list level to the next-lower level (SY-LSIND), the user can choose back from a detail list. The system releases the last list to have been displayed, and returns to the previous list level. The system deletes the contents of the released list.
To determine the list level in which the output from an event block will be displayed, you can change the value of the system fields SY-LSIND. This is one of the few exceptions to the rule that states that you must never overwrite ABAP system fields. 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.
When you change SY-LSIND, the change only takes effect at the end of the corresponding event. If you work with statements that access the list with index SY-LSIND (using the INDEX addition - for example, SCROLL), you should set the new value of SY-LISND after these statements. The best place to set it is in the last statement of the event block.

System Fields for Details Lists
After each user action on a list, the following ABAP system fields will be set in the corresponding event block:
System field
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-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-CPAGE Page number of the first displayed page of the list from which the event was triggered
SY-STARO Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1). This line may contain the page header.
SY-STACO Number of the first column displayed in the list from which the event was triggered (counting starts with 1)
SY-UCOMM Function code that triggered the event
SY-PFKEY Status of the list currently being displayed.

Page Headers for Detail Lists
On detail 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 detail list, you must use a different TOP-OF-PAGE event:
TOP-OF-PAGE DURING LINE-SELECTION.
The system triggers this event for each detail 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).
As on the basic list, the page header of a detail list remains displayed even when you scroll vertically.

Messages on Detail Lists
ABAP allows you to react to incorrect or possibly-incorrect user input by displaying messages. The seriousness of the error determines how program processing continues.
In list processing, the message processing for the individual message types is as follows:
A (=Abend): Termination
The system displays the message in a dialog box. After the user confirms the message using ENTER , the system terminates the entire transaction (for example SE38).
E (=Error) or W (=Warning):
The system displays the message in the status bar. Once the user has confirmed the error by pressing ENTER, the current event block is terminated and the previous list level remains displayed. If you use an error or warning message while creating the basic list, the entire program is terminated.
I (=Information):
The system displays the message in a dialog box. Once the user has confirmed the message (ENTER), the program continues processing after the MESSAGE statement.
S (= status)
The system displays the message in the status bar of the current list.
X (= Exit) Runtime error:
This message type triggers a runtime error and generates a short dump.

Using Detail Lists
A classic report is a program that generates a single list, which must contain all of the required detail information. This procedure may result in extensive lists from which the user has to pick the relevant data. For background processing, this is the only possible method. After starting a background job, there is no way of influencing the program. The desired selections must be made beforehand and the list must provide detailed information.
For dialog sessions, there are no such restrictions. The user is present during the execution of the program and can control and manipulate the program flow directly. To be able to use all advantages of the online environment, classical reporting was developed into 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. Detailed information is presented in detail lists.
Apart from creating detail lists, interactive reporting also allows you to call transactions or other executable programs (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.


AT LINE-SELECTION : This Event triggers when we double click a line on the list, when the event is triggered a new sublist is going to be generated. Under this event what ever the statements that are been return will be displayed on newly generated sublist.

START-OF-SELECTION.
 
  WRITE: 'Basic List, SY-LSIND =', sy-lsind.
 
AT LINE-SELECTION.
 
  WRITE: 'Secondary List, SY-LSIND =', sy-lsind.
 




How to call a screen from a list...

REPORT demo_call_screen_from_list.
 
NODES  spfli.
TABLES demo_conn.
 
DATA: ok_code TYPE sy-ucomm,
      save_ok TYPE sy-ucomm.
 
TOP-OF-PAGE.
  WRITE 'Liste von Flügen'(001) COLOR COL_HEADING.
  ULINE.
 
GET spfli FIELDS carrid connid.
  WRITE: / spfli-carrid, spfli-connid.
  HIDE:    spfli-carrid, spfli-connid.
 
END-OF-SELECTION.
  CLEAR:   spfli-carrid, spfli-connid.
 
AT LINE-SELECTION.
  CHECK NOT spfli-carrid IS INITIAL.
  demo_conn-carrid = spfli-carrid.
  demo_conn-connid = spfli-connid.
  CALL SCREEN 100.
  CLEAR: spfli-carrid, spfli-connid.
 
MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.
 
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
 
MODULE user_command_0100 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    WHEN OTHERS.
      SELECT  SINGLE *
        FROM  sflight
        INTO  CORRESPONDING FIELDS OF demo_conn
        WHERE carrid = demo_conn-carrid AND
              connid = demo_conn-connid AND
              fldate = demo_conn-fldate.
      IF sy-subrc NE 0.
        MESSAGE e047(sabapdocu).
      ELSE.
        SET SCREEN 200.
      ENDIF.
  ENDCASE.
ENDMODULE.
 
MODULE status_0200 OUTPUT.
  SET PF-STATUS 'SCREEN_200'.
ENDMODULE.
 
MODULE user_command_0200 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE  save_ok.
    WHEN 'BACK'.
      LEAVE TO SCREEN 100.
    WHEN 'SAVE'.
      ...                              "e.g. update records in database
      MESSAGE i888(sabapdocu) WITH text-002.
      SET SCREEN 0.
  ENDCASE.
ENDMODULE.


Check this link

http://www.sap-img.com/abap/a-sample-hide-get-cursor-in-interactive-programming.htm

Reward all helpfull answers

Regards

Pavan

Former Member
0 Kudos

Hi,

Classical reports are those which we cannot interact with the will just display the output.

Interactive reports in other hand will aloow to interact with the out put. it will allow us to create secondary lists.so when we select an item in the output and double click it or press F2 after selection it will give u the detailed list.

Just go thru the following link

http://wiki.ittoolbox.com/index.php/How_many_types_of_reports_are_there_in_ABAP_and_what_is_the_diff...

Regards,

Prajith

Former Member
0 Kudos

hi

i will give u a sample code for drill down report.. it is a three level interactive report.

DATA: IT_LFA1 TYPE TABLE OF LFA1,

WA_LFA1 TYPE LFA1,

IT_EKKO TYPE TABLE OF EKKO,

WA_EKKO TYPE EKKO,

IT_EKPO TYPE TABLE OF EKPO,

WA_EKPO TYPE EKPO.

SELECT-OPTIONS ACCNO FOR WA_LFA1-LIFNR.

START-OF-SELECTION.

SELECT * FROM LFA1 INTO TABLE IT_LFA1 WHERE LIFNR IN ACCNO.

END-OF-SELECTION.

WRITE : /70 'VENDOR Report' COLOR COL_HEADING .

ULINE.

WRITE : /10 'ACCOUNT NO ', 57 'NAME'.

LOOP AT IT_LFA1 INTO WA_LFA1.

WRITE: /10 WA_LFA1-LIFNR, WA_LFA1-NAME1, WA_LFA1-ORT01.

hide WA_LFA1-LIFNR.

ENDLOOP.

clear WA_LFA1-LIFNR.

AT LINE-SELECTION.

**write / sy-LILLI.

IF SY-LSIND = 1.

SELECT * FROM EKKO INTO TABLE IT_EKKO WHERE LIFNR = WA_LFA1-LIFNR.

WRITE : / 'PUR DOC NO',20 'COMP CODE',30 'PUR DOC TYPE'.

LOOP AT IT_EKKO INTO WA_EKKO.

WRITE: /10 WA_EKKO-EBELN, WA_EKKO-BUKRS,

WA_EKKO-BSART.

HIDE WA_EKKO-EBELN.

ENDLOOP.

ENDIF.

IF SY-LSIND = 2.

SELECT * FROM EKPO INTO TABLE IT_EKPO WHERE EBELN = WA_EKKO-EBELN.

WRITE: / 'MATERIAL NO','PLANT','STORAGE LOCATION'.

LOOP AT IT_EKPO INTO WA_EKPO.

WRITE: /10 WA_EKPO-MATNR, WA_EKPO-WERKS,

WA_EKPO-LGORT.

HIDE WA_EKPO-MATNR.

ENDLOOP.

ENDIF.

IF SY-LSIND = 3.

SET PARAMETER ID 'DFD' FIELD WA_EKPO-MATNR.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

endif.

reward if useful