Posted: Tue Apr 09, 2013 12:53 pm Post subject: ALV to another Drilldown ALV
Code:
REPORT z_drilldown_alv_oo.
DATA: it_carr TYPE TABLE OF scarr,
it_flight TYPE TABLE OF sflight.
DATA: grid1 TYPE REF TO cl_gui_alv_grid,
grid2 TYPE REF TO cl_gui_alv_grid,
con1 TYPE REF TO cl_gui_custom_container,
con2 TYPE REF TO cl_gui_custom_container.
DATA: layout1 TYPE lvc_s_layo,
layout2 TYPE lvc_s_layo.
*----------------------------------------------------------------------*
* CLASS cl_defintion
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS cl_one DEFINITION.
PUBLIC SECTION.
METHODS:
double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
ENDCLASS. "cl_defintion
*----------------------------------------------------------------------*
* CLASS cl_implemenatation
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS cl_one IMPLEMENTATION.
METHOD double_click.
DATA: wa_carr TYPE scarr.
READ TABLE it_carr INTO wa_carr INDEX e_row-index.
IF sy-subrc EQ 0.
SELECT * FROM sflight
INTO TABLE it_flight
WHERE carrid EQ wa_carr-carrid.
CALL SCREEN 200.
ENDIF.
ENDMETHOD. "double_click
ENDCLASS. "cl_implemenatation
START-OF-SELECTION.
DATA: obj TYPE REF TO cl_one.
SELECT * FROM scarr
INTO TABLE it_carr.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'CARR'.
IF con1 IS INITIAL.
CREATE OBJECT con1
EXPORTING
container_name = 'CAR'.
CREATE OBJECT grid1
EXPORTING
i_parent = con1.
layout1-grid_title = 'Carrid data'.
layout1-smalltitle = 'X'.
layout1-sel_mode = 'A'.
layout1-cwidth_opt = 'X'.
layout1-zebra = 'X'.
grid1->set_table_for_first_display(
EXPORTING
i_structure_name = 'SCARR'
is_layout = layout1
CHANGING
it_outtab = it_carr
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
).
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT obj.
SET HANDLER obj->double_click FOR grid1.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0200 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0200 OUTPUT.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.