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: 

interactive

Former Member
0 Kudos

can any one guide me how to do this Interactive Report for displaying Vendor Information based on the Selection made the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along with the secondary list.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

pls check this code. this will gide you to get the vendor list.

REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE

HEADING.

*TABLES DECLARATION

TABLES : KNA1, VBAK, VBAP.

*SELECT OPTIONS

SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.

*INITIALIZATION

INITIALIZATION.

CUST_NO-LOW = '01'.

CUST_NO-HIGH = '5000'.

CUST_NO-SIGN = 'I'.

CUST_NO-OPTION = 'BT'.

APPEND CUST_NO.

*SELECTION SCREEN VALIDATION

AT SELECTION-SCREEN ON CUST_NO.

LOOP AT SCREEN.

IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.

MESSAGE E001(ZTJ1).

ENDIF.

ENDLOOP.

*BASIC LIST SELECTION

START-OF-SELECTION.

SELECT KUNNR NAME1 ORT01 LAND1 INTO

(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)

FROM KNA1

WHERE KUNNR IN CUST_NO.

WRITE:/1 SY-VLINE,

KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,

16 SY-VLINE,

KNA1-NAME1 UNDER 'NAME',

61 SY-VLINE,

KNA1-ORT01 UNDER 'CITY',

86 SY-VLINE,

KNA1-LAND1 UNDER 'COUNTRY',

103 SY-VLINE.

HIDE: KNA1-KUNNR.

ENDSELECT.

ULINE.

*SECONDARY LIST ACCESS

AT user-command.

IF SY-UCOMM = 'IONE'.

PERFORM SALES_ORD.

ENDIF.

IF SY-UCOMM = 'ITWO'.

PERFORM ITEM_DET.

ENDIF.

*TOP OF PAGE

TOP-OF-PAGE.

FORMAT COLOR 1.

WRITE : 'CUSTOMER DETAILS'.

FORMAT COLOR 1 OFF.

ULINE.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'CUSTOMER NO.',

16 SY-VLINE,

18 'NAME',

61 SY-VLINE,

63 'CITY',

86 SY-VLINE,

88 'COUNTRY',

103 SY-VLINE.

ULINE.

FORMAT COLOR 3 OFF.

*TOP OF PAGE FOR SECONDARY LISTS

TOP-OF-PAGE DURING LINE-SELECTION.

*TOP OF PAGE FOR 1ST SECONDARY LIST

IF SY-UCOMM = 'IONE'.

ULINE.

FORMAT COLOR 1.

WRITE : 'SALES ORDER DETAILS'.

ULINE.

FORMAT COLOR 1 OFF.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'CUSTOMER NO.',

16 SY-VLINE,

18 'SALES ORDER NO.',

40 SY-VLINE,

42 'DATE',

60 SY-VLINE,

62 'CREATOR',

85 SY-VLINE,

87 'DOC DATE',

103 SY-VLINE.

ULINE.

ENDIF.

FORMAT COLOR 3 OFF.

*TOP OF PAGE FOR 2ND SECONDARY LIST

IF SY-UCOMM = 'ITWO'.

ULINE.

FORMAT COLOR 1.

WRITE : 'ITEM DETAILS'.

ULINE.

FORMAT COLOR 1 OFF.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'SALES ORDER NO.',

40 SY-VLINE,

42 'SALES ITEM NO.',

60 SY-VLINE,

62 'ORDER QUANTITY',

103 SY-VLINE.

ULINE.

ENDIF.

FORMAT COLOR 3 OFF.

*END OF PAGE

END-OF-PAGE.

ULINE.

WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',

SY-PAGNO.

SKIP.

&----


*& Form SALES_ORD

*&

*& FIRST SECONDARY LIST FORM

&----


FORM SALES_ORD .

SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO

(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)

FROM VBAK

WHERE KUNNR = KNA1-KUNNR.

WRITE:/1 SY-VLINE,

VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,

16 SY-VLINE,

VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,

40 SY-VLINE,

VBAK-ERDAT UNDER 'DATE',

60 SY-VLINE,

VBAK-ERNAM UNDER 'CREATOR',

85 SY-VLINE,

VBAK-AUDAT UNDER 'DOC DATE',

103 SY-VLINE.

HIDE : VBAK-VBELN.

ENDSELECT.

ULINE.

ENDFORM. " SALES_ORD

&----


*& Form ITEM_DET

*&

*& SECOND SECONDARY LIST FORM

&----


FORM ITEM_DET .

SELECT VBELN POSNR KWMENG INTO

(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)

FROM VBAP

WHERE VBELN = VBAK-VBELN.

WRITE : /1 SY-VLINE,

VBAP-VBELN UNDER 'SALES ORDER NO.',

40 SY-VLINE,

VBAP-POSNR UNDER 'SALES ITEM NO.',

60 SY-VLINE,

VBAP-KWMENG UNDER 'ORDER QUANTITY',

103 SY-VLINE.

ENDSELECT.

ULINE.

ENDFORM. " ITEM_DET

************************************************************************

REPORT demo_list_at_pf.

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.

After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:

Secondary List by PF-Key Selection

SY-LSIND = 14

SY-UCOMM = PF06

Example for AT USER-COMMAND.

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.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'FC1'.

PERFORM out.

WRITE / 'Button FUN 1 was pressed'.

WHEN 'FC2'.

PERFORM out.

WRITE / 'Button FUN 2 was pressed'.

WHEN 'FC3'.

PERFORM out.

WRITE / 'Button FUN 3 was pressed'.

WHEN 'FC4'.

PERFORM out.

WRITE / 'Button FUN 4 was pressed'.

WHEN 'FC5'.

PERFORM out.

WRITE / 'Button FUN 5 was pressed'.

ENDCASE.

sy-lsind = sy-lsind - 1.

FORM out.

WRITE: 'Secondary List',

/ 'SY-LSIND:', sy-lsind,

/ 'SY-PFKEY:', sy-pfkey.

ENDFORM.

When you run the program, the system displays the following basic list with a the page header defined in the program:

You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status.

Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton.

For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1.

with regards,

Hema.

pls reward if helpful.

4 REPLIES 4

Former Member
0 Kudos

if u want to display basic list as well as secondary list at the same time then u need to go for hierarchial not interactive.

In case of interactive if click on basic list then it will move to secondary list

In ur case hierarchial is suggestable

Madhavi

Former Member
0 Kudos

Check the links below:

http://www.itcserver.com/blog/2006/06/29/interactive-reports-in-abap/

Reward points if useful..

Former Member
0 Kudos

hi,

pls check this code. this will gide you to get the vendor list.

REPORT ZTEJ_INTAB1 LINE-SIZE 103 LINE-COUNT 35(5) NO STANDARD PAGE

HEADING.

*TABLES DECLARATION

TABLES : KNA1, VBAK, VBAP.

*SELECT OPTIONS

SELECT-OPTIONS: CUST_NO FOR KNA1-KUNNR.

*INITIALIZATION

INITIALIZATION.

CUST_NO-LOW = '01'.

CUST_NO-HIGH = '5000'.

CUST_NO-SIGN = 'I'.

CUST_NO-OPTION = 'BT'.

APPEND CUST_NO.

*SELECTION SCREEN VALIDATION

AT SELECTION-SCREEN ON CUST_NO.

LOOP AT SCREEN.

IF CUST_NO-LOW < 1 OR CUST_NO-HIGH > 5000.

MESSAGE E001(ZTJ1).

ENDIF.

ENDLOOP.

*BASIC LIST SELECTION

START-OF-SELECTION.

SELECT KUNNR NAME1 ORT01 LAND1 INTO

(KNA1-KUNNR, KNA1-NAME1,KNA1-ORT01,KNA1-LAND1)

FROM KNA1

WHERE KUNNR IN CUST_NO.

WRITE:/1 SY-VLINE,

KNA1-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,

16 SY-VLINE,

KNA1-NAME1 UNDER 'NAME',

61 SY-VLINE,

KNA1-ORT01 UNDER 'CITY',

86 SY-VLINE,

KNA1-LAND1 UNDER 'COUNTRY',

103 SY-VLINE.

HIDE: KNA1-KUNNR.

ENDSELECT.

ULINE.

*SECONDARY LIST ACCESS

AT user-command.

IF SY-UCOMM = 'IONE'.

PERFORM SALES_ORD.

ENDIF.

IF SY-UCOMM = 'ITWO'.

PERFORM ITEM_DET.

ENDIF.

*TOP OF PAGE

TOP-OF-PAGE.

FORMAT COLOR 1.

WRITE : 'CUSTOMER DETAILS'.

FORMAT COLOR 1 OFF.

ULINE.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'CUSTOMER NO.',

16 SY-VLINE,

18 'NAME',

61 SY-VLINE,

63 'CITY',

86 SY-VLINE,

88 'COUNTRY',

103 SY-VLINE.

ULINE.

FORMAT COLOR 3 OFF.

*TOP OF PAGE FOR SECONDARY LISTS

TOP-OF-PAGE DURING LINE-SELECTION.

*TOP OF PAGE FOR 1ST SECONDARY LIST

IF SY-UCOMM = 'IONE'.

ULINE.

FORMAT COLOR 1.

WRITE : 'SALES ORDER DETAILS'.

ULINE.

FORMAT COLOR 1 OFF.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'CUSTOMER NO.',

16 SY-VLINE,

18 'SALES ORDER NO.',

40 SY-VLINE,

42 'DATE',

60 SY-VLINE,

62 'CREATOR',

85 SY-VLINE,

87 'DOC DATE',

103 SY-VLINE.

ULINE.

ENDIF.

FORMAT COLOR 3 OFF.

*TOP OF PAGE FOR 2ND SECONDARY LIST

IF SY-UCOMM = 'ITWO'.

ULINE.

FORMAT COLOR 1.

WRITE : 'ITEM DETAILS'.

ULINE.

FORMAT COLOR 1 OFF.

FORMAT COLOR 3.

WRITE : 1 SY-VLINE,

3 'SALES ORDER NO.',

40 SY-VLINE,

42 'SALES ITEM NO.',

60 SY-VLINE,

62 'ORDER QUANTITY',

103 SY-VLINE.

ULINE.

ENDIF.

FORMAT COLOR 3 OFF.

*END OF PAGE

END-OF-PAGE.

ULINE.

WRITE :'USER :',SY-UNAME,/,'DATE :', SY-DATUM, 85 'END OF PAGE:',

SY-PAGNO.

SKIP.

&----


*& Form SALES_ORD

*&

*& FIRST SECONDARY LIST FORM

&----


FORM SALES_ORD .

SELECT KUNNR VBELN ERDAT ERNAM AUDAT INTO

(VBAK-KUNNR, VBAK-VBELN, VBAK-ERDAT, VBAK-ERNAM, VBAK-AUDAT)

FROM VBAK

WHERE KUNNR = KNA1-KUNNR.

WRITE:/1 SY-VLINE,

VBAK-KUNNR UNDER 'CUSTOMER NO.' HOTSPOT ON,

16 SY-VLINE,

VBAK-VBELN UNDER 'SALES ORDER NO.' HOTSPOT ON,

40 SY-VLINE,

VBAK-ERDAT UNDER 'DATE',

60 SY-VLINE,

VBAK-ERNAM UNDER 'CREATOR',

85 SY-VLINE,

VBAK-AUDAT UNDER 'DOC DATE',

103 SY-VLINE.

HIDE : VBAK-VBELN.

ENDSELECT.

ULINE.

ENDFORM. " SALES_ORD

&----


*& Form ITEM_DET

*&

*& SECOND SECONDARY LIST FORM

&----


FORM ITEM_DET .

SELECT VBELN POSNR KWMENG INTO

(VBAP-VBELN, VBAP-POSNR, VBAP-KWMENG)

FROM VBAP

WHERE VBELN = VBAK-VBELN.

WRITE : /1 SY-VLINE,

VBAP-VBELN UNDER 'SALES ORDER NO.',

40 SY-VLINE,

VBAP-POSNR UNDER 'SALES ITEM NO.',

60 SY-VLINE,

VBAP-KWMENG UNDER 'ORDER QUANTITY',

103 SY-VLINE.

ENDSELECT.

ULINE.

ENDFORM. " ITEM_DET

************************************************************************

REPORT demo_list_at_pf.

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.

After executing the program, the system displays the basic list. The user can press the function keys F5 , F6 , F7 , and F8 to create secondary lists. If, for example, the 14th key the user presses is F6 , the output on the displayed secondary list looks as follows:

Secondary List by PF-Key Selection

SY-LSIND = 14

SY-UCOMM = PF06

Example for AT USER-COMMAND.

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.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'FC1'.

PERFORM out.

WRITE / 'Button FUN 1 was pressed'.

WHEN 'FC2'.

PERFORM out.

WRITE / 'Button FUN 2 was pressed'.

WHEN 'FC3'.

PERFORM out.

WRITE / 'Button FUN 3 was pressed'.

WHEN 'FC4'.

PERFORM out.

WRITE / 'Button FUN 4 was pressed'.

WHEN 'FC5'.

PERFORM out.

WRITE / 'Button FUN 5 was pressed'.

ENDCASE.

sy-lsind = sy-lsind - 1.

FORM out.

WRITE: 'Secondary List',

/ 'SY-LSIND:', sy-lsind,

/ 'SY-PFKEY:', sy-pfkey.

ENDFORM.

When you run the program, the system displays the following basic list with a the page header defined in the program:

You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status.

Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton.

For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1.

with regards,

Hema.

pls reward if helpful.

Former Member
0 Kudos

Also this will help u.

Creating Detail Lists

REPORT demo_list_interactive_1.

START-OF-SELECTION.

WRITE: 'Basic List, SY-LSIND =', sy-lsind.

AT LINE-SELECTION.

WRITE: 'Secondary List, SY-LSIND =', sy-lsind.

When you run the program, the basic list appears. The GUI status automatically permits the function Choose (F2). When you choose a list line, the system triggers the AT LINE-SELECTION event, and the first detail list overlays the basic list. This list has no standard page header. It also inherits the GUI status of the basic list. By choosing Choose, the user can now create up to 19 of these lists. Trying to produce more than 19 lists results in a runtime error. Using Back , the user can return to previous lists.

Navigation in detail lists.

REPORT demo_list_interactive_2.

START-OF-SELECTION.

WRITE: 'Basic List, SY-LSIND =', sy-lsind.

AT LINE-SELECTION.

IF sy-lsind = 3.

sy-lsind = 0.

ENDIF.

WRITE: 'Secondary List, SY-LSIND =', sy-lsind.

When you run the program, the basic list appears:

Basic List, SY-LSIND = 0

The GUI status automatically permits the function Choose (F2). If the user positions the cursor on the list line and chooses Choose to trigger the AT LINE-SELECTION event, the system displays a detail list that contains the following line:

Secondary List, SY-LSIND = 1

Choosing Choose again produces:

Secondary List, SY-LSIND = 2

Back leads to the previous list level. Choosing Choose for the third time produces a detail list that contains the following line (because of the IF condition):

Secondary List, SY-LSIND = 0

The system deletes list levels 1 and 2. Choosing Back returns to the point at which the list processing started. If you choose Choose, the system creates a detail list with index 1. However, the list on level 0 is no longer a basic list (no page header), but is itself a detail list.

Page Headers for Detail Lists

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.

When you run the program, the basic list appears. The user can choose Choose to create detail lists. The detail lists have page headers that are set according to the value of SY-LSIND.

Messages on Detail Lists

REPORT demo_list_interactive_4 NO STANDARD PAGE HEADING.

AT LINE-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.

When the program runs, the system displays the basic list and the success message 100 in the status line. A single click triggers the AT-LINE-SELECTION event. When the system creates the first detail list, it displays a dialog box with the information message 100. You cannot create the second detail list, because the message 200 has message type E:

with regrads,

Hema.