*&---------------------------------------------------------------------*
*& Report ZOOPS_INTERACTIVE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
**************************************************************************
* INTER ACTIVE REPORT DISPLAYS BASIC DATA IN FIRST SCREEN AND REMANING DATA
*IN THE SECOND SCREEN IN THIS OOPS ALV WE USED DOUBLE_CLICK EVENT OF
*CLASS CL_GUI_ALV_GRID
***************************************************************************
REPORT zoops_interactive.
********************************************************************
* INCLUDE FOR INTERNAL TABLE,WORK AREA AND OBJECTS DECLARATION
********************************************************************
INCLUDE zoops_interactive_top.
*&---------------------------------------------------------------------*
*& Include ZOOPS_INTERACTIVE_TOP
*&---------------------------------------------------------------------*
CLASS lcl_abap DEFINITION DEFERRED.
DATA: oops TYPE REF TO lcl_abap,
container1 TYPE REF TO cl_gui_custom_container,
display1 TYPE REF TO cl_gui_alv_grid,
container2 TYPE REF TO cl_gui_custom_container,
display2 TYPE REF TO cl_gui_alv_grid,
i_likp TYPE TABLE OF likp,
w_likp TYPE likp,
i_lips TYPE TABLE OF lips,
w_lips TYPE lips.
*********************************************************************
* SELECT-OPTIONS FOR LIKP TABLE
*********************************************************************
INCLUDE zoops_interactive_sel.
*&---------------------------------------------------------------------*
*& Include ZOOPS_INTERACTIVE_SEL
*&---------------------------------------------------------------------*
TABLES: LIKP,LIPS.
SELECT-OPTIONS SO_VBELN FOR LIKP-VBELN.
*********************************************************************
* CLASS DEFINITION
*********************************************************************
CLASS lcl_abap DEFINITION.
PUBLIC SECTION.
METHODS likp_method FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row.
ENDCLASS.
START-OF-SELECTION.
*********************************************************************
" HERE WE NEED TO CREATE A SCREEN THAT SHOULD HAVE
" 1 CONTAINER FOR LIKP THAT HOLDS(HEADER DATA)
********************************************************************
CALL SCREEN 525.
*&---------------------------------------------------------------------*
*& Module STATUS_0525 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0525 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
PERFORM create_objects_likp.
PERFORM get_likp.
PERFORM display_likp.
CREATE OBJECT oops.
SET HANDLER oops->likp_method FOR display1.
ENDMODULE. " STATUS_0525 OUTPUT
*&---------------------------------------------------------------------*
*& Form CREATE_OBJECTS_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_objects_likp .
CREATE OBJECT container1
EXPORTING
container_name = 'CONTAINER1'.
CREATE OBJECT display1
EXPORTING
i_parent = container1. " GIVE CONTAINER NAME HERE
ENDFORM. " CREATE_OBJECTS_LIKP
*&---------------------------------------------------------------------*
*& Form GET_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_likp .
SELECT * FROM likp
INTO TABLE i_likp
WHERE vbeln IN so_vbeln.
ENDFORM. " GET_LIKP
*&---------------------------------------------------------------------*
*& Form DISPLAY_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_likp .
CALL METHOD display1->set_table_for_first_display
EXPORTING
i_structure_name = 'LIKP'
CHANGING
it_outtab = i_likp.
ENDFORM. " DISPLAY_LIKP
CLASS lcl_abap IMPLEMENTATION.
METHOD likp_method.
CLEAR w_likp.
READ TABLE i_likp INTO w_likp INDEX e_row-index.
SELECT * FROM
lips INTO CORRESPONDING FIELDS OF TABLE
i_lips WHERE vbeln = w_likp-vbeln.
******************************************************************
" CREATE SCREEN 527 FOR ANOTHER CONTAINER2
"THAT HOLDS DATA OF LIP (ITEM DATA)
******************************************************************
CALL SCREEN 527.
ENDMETHOD.
ENDCLASS.
*&---------------------------------------------------------------------*
*& Module STATUS_0527 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0527 OUTPUT.
SET PF-STATUS 'BACK'. " CRAETING BACK BUTTON JUST DOUBLE CLICK ON BACK
* SET TITLEBAR 'xxx'.
PERFORM create_objects_lips.
PERFORM display_lips.
ENDMODULE. " STATUS_0527 OUTPUT
*&---------------------------------------------------------------------*
*& Form CREATE_OBJECTS_LIPS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_objects_lips .
IF display2 IS INITIAL.
CREATE OBJECT container2
EXPORTING
container_name = 'CONTAINER2'.
CREATE OBJECT display2
EXPORTING
i_parent = container2. "GIVE CONTAINER NAME
ENDIF.
ENDFORM. " CREATE_OBJECTS_LIPS
*&---------------------------------------------------------------------*
*& Form DISPLAY_LIPS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_lips .
CALL METHOD display2->set_table_for_first_display
EXPORTING
* i_buffer_active =
* i_bypassing_buffer =
* i_consistency_check =
i_structure_name = 'LIPS'
* is_variant =
* i_save =
* i_default = 'X'
* is_layout =
* is_print =
* it_special_groups =
* it_toolbar_excluding =
* it_hyperlink =
* it_alv_graphics =
* it_except_qinfo =
* ir_salv_adapter =
CHANGING
it_outtab = i_lips
* it_fieldcatalog =
* it_sort =
* it_filter =
* EXCEPTIONS
* invalid_parameter_combination = 1
* program_error = 2
* too_many_lines = 3
* others = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM. " DISPLAY_LIPS
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0527 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0527 INPUT.
IF sy-ucomm = 'BACK'.
LEAVE TO SCREEN 525.
ENDIF.
ENDMODULE. " USER_COMMAND_0527 INPUT
**************************************************************************
FOR THIS REPORT WE HAVE USED DOUBLE_CLICK EVENT IN THE CLASS (CL_GUI_ALV_GRID).
*****************************************************************************
OUTPUT
*& Report ZOOPS_INTERACTIVE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
**************************************************************************
* INTER ACTIVE REPORT DISPLAYS BASIC DATA IN FIRST SCREEN AND REMANING DATA
*IN THE SECOND SCREEN IN THIS OOPS ALV WE USED DOUBLE_CLICK EVENT OF
*CLASS CL_GUI_ALV_GRID
***************************************************************************
REPORT zoops_interactive.
********************************************************************
* INCLUDE FOR INTERNAL TABLE,WORK AREA AND OBJECTS DECLARATION
********************************************************************
INCLUDE zoops_interactive_top.
*&---------------------------------------------------------------------*
*& Include ZOOPS_INTERACTIVE_TOP
*&---------------------------------------------------------------------*
CLASS lcl_abap DEFINITION DEFERRED.
DATA: oops TYPE REF TO lcl_abap,
container1 TYPE REF TO cl_gui_custom_container,
display1 TYPE REF TO cl_gui_alv_grid,
container2 TYPE REF TO cl_gui_custom_container,
display2 TYPE REF TO cl_gui_alv_grid,
i_likp TYPE TABLE OF likp,
w_likp TYPE likp,
i_lips TYPE TABLE OF lips,
w_lips TYPE lips.
*********************************************************************
* SELECT-OPTIONS FOR LIKP TABLE
*********************************************************************
INCLUDE zoops_interactive_sel.
*&---------------------------------------------------------------------*
*& Include ZOOPS_INTERACTIVE_SEL
*&---------------------------------------------------------------------*
TABLES: LIKP,LIPS.
SELECT-OPTIONS SO_VBELN FOR LIKP-VBELN.
*********************************************************************
* CLASS DEFINITION
*********************************************************************
CLASS lcl_abap DEFINITION.
PUBLIC SECTION.
METHODS likp_method FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row.
ENDCLASS.
START-OF-SELECTION.
*********************************************************************
" HERE WE NEED TO CREATE A SCREEN THAT SHOULD HAVE
" 1 CONTAINER FOR LIKP THAT HOLDS(HEADER DATA)
********************************************************************
CALL SCREEN 525.
*&---------------------------------------------------------------------*
*& Module STATUS_0525 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0525 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
PERFORM create_objects_likp.
PERFORM get_likp.
PERFORM display_likp.
CREATE OBJECT oops.
SET HANDLER oops->likp_method FOR display1.
ENDMODULE. " STATUS_0525 OUTPUT
*&---------------------------------------------------------------------*
*& Form CREATE_OBJECTS_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_objects_likp .
CREATE OBJECT container1
EXPORTING
container_name = 'CONTAINER1'.
CREATE OBJECT display1
EXPORTING
i_parent = container1. " GIVE CONTAINER NAME HERE
ENDFORM. " CREATE_OBJECTS_LIKP
*&---------------------------------------------------------------------*
*& Form GET_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_likp .
SELECT * FROM likp
INTO TABLE i_likp
WHERE vbeln IN so_vbeln.
ENDFORM. " GET_LIKP
*&---------------------------------------------------------------------*
*& Form DISPLAY_LIKP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_likp .
CALL METHOD display1->set_table_for_first_display
EXPORTING
i_structure_name = 'LIKP'
CHANGING
it_outtab = i_likp.
ENDFORM. " DISPLAY_LIKP
CLASS lcl_abap IMPLEMENTATION.
METHOD likp_method.
CLEAR w_likp.
READ TABLE i_likp INTO w_likp INDEX e_row-index.
SELECT * FROM
lips INTO CORRESPONDING FIELDS OF TABLE
i_lips WHERE vbeln = w_likp-vbeln.
******************************************************************
" CREATE SCREEN 527 FOR ANOTHER CONTAINER2
"THAT HOLDS DATA OF LIP (ITEM DATA)
******************************************************************
CALL SCREEN 527.
ENDMETHOD.
ENDCLASS.
*&---------------------------------------------------------------------*
*& Module STATUS_0527 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0527 OUTPUT.
SET PF-STATUS 'BACK'. " CRAETING BACK BUTTON JUST DOUBLE CLICK ON BACK
* SET TITLEBAR 'xxx'.
PERFORM create_objects_lips.
PERFORM display_lips.
ENDMODULE. " STATUS_0527 OUTPUT
*&---------------------------------------------------------------------*
*& Form CREATE_OBJECTS_LIPS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_objects_lips .
IF display2 IS INITIAL.
CREATE OBJECT container2
EXPORTING
container_name = 'CONTAINER2'.
CREATE OBJECT display2
EXPORTING
i_parent = container2. "GIVE CONTAINER NAME
ENDIF.
ENDFORM. " CREATE_OBJECTS_LIPS
*&---------------------------------------------------------------------*
*& Form DISPLAY_LIPS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_lips .
CALL METHOD display2->set_table_for_first_display
EXPORTING
* i_buffer_active =
* i_bypassing_buffer =
* i_consistency_check =
i_structure_name = 'LIPS'
* is_variant =
* i_save =
* i_default = 'X'
* is_layout =
* is_print =
* it_special_groups =
* it_toolbar_excluding =
* it_hyperlink =
* it_alv_graphics =
* it_except_qinfo =
* ir_salv_adapter =
CHANGING
it_outtab = i_lips
* it_fieldcatalog =
* it_sort =
* it_filter =
* EXCEPTIONS
* invalid_parameter_combination = 1
* program_error = 2
* too_many_lines = 3
* others = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM. " DISPLAY_LIPS
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0527 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0527 INPUT.
IF sy-ucomm = 'BACK'.
LEAVE TO SCREEN 525.
ENDIF.
ENDMODULE. " USER_COMMAND_0527 INPUT
**************************************************************************
FOR THIS REPORT WE HAVE USED DOUBLE_CLICK EVENT IN THE CLASS (CL_GUI_ALV_GRID).
*****************************************************************************
OUTPUT
" HERE I JUST DOUBLE CLICKED ON VBELN NO 80003371