04-10-2007 12:06 PM
hi friends,
Can anyone tell me how to create ALV HIERARCHY using oops ,
if you illustrate with an example that would be great
If you know any sample program pls furnish me detail .
Thnx in advance.
regards
Kannan
04-10-2007 4:51 PM
check the below link also may be useful for ya
Here is a tutorial on the Heirarchy Sequential List ALV using the ALV OM.
~~Guduri
04-10-2007 12:35 PM
Hi,
Check for this program..
BCALV_TEST_HIERSEQ_LIST....
Hope this help.. assign points...
raj
04-10-2007 12:47 PM
hi kannan
*:--- OOP-Definitionen
DATA: cnt_name_01 TYPE scrfname VALUE 'CNTRL_KOBE',
hnd_grid_01 TYPE REF TO cl_gui_alv_grid,
hnd_cont_01 TYPE REF TO cl_gui_custom_container.
*******************************************************************
CLASS lcl_event_receiver DEFINITION DEFERRED.
****************************************************************
*:--- LOCAL CLASSES: Definition
****************************************************************
*:--- Definition der Grid-Klasse
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
*:--- Methoden
CLASS-METHODS:
*:--- Toolbar (Standard buttons)
hnd_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
*:--- Rückgabecodes (Funktion)
hnd_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
*:--- Private Vereinbarungen
PRIVATE SECTION.
ENDCLASS.
*:--- Toolbar
METHOD hnd_toolbar.
LOOP AT gt_toolbar INTO gf_toolbar.
APPEND gf_toolbar TO e_object->mt_toolbar.
ENDLOOP.
ENDMETHOD.
*:--- User Command only if You have defined some
*********************************************
METHOD hnd_user_command.
CLEAR: gt_selline.
CLEAR: gt_seltab.
*:--- Selectierte Zeilen werden über Index zurückgeliefert
CALL METHOD hnd_grid_01->get_selected_rows
IMPORTING et_index_rows = gt_selline.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
*:--- add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = gs_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
*:--- Hier die ButtonMenüs prozessieren
CASE e_ucomm.
WHEN 'DO IT'
PERFORM doit.
ENDCASE.
CALL METHOD hnd_grid_01->refresh_table_display.
ENDMETHOD. "hnd_user_command
ENDCLASS.
points
if helpful04-10-2007 4:39 PM
hi ravish
I want to know how to create ALV HIERARCHY using oops send me hierarchy class methods and which call methods I want to use with passing parameters also some more detail Coding example
thanks
Regards
kannan
04-10-2007 12:48 PM
hi
*:--- OOP-Definitionen
DATA: cnt_name_01 TYPE scrfname VALUE 'CNTRL_KOBE',
hnd_grid_01 TYPE REF TO cl_gui_alv_grid,
hnd_cont_01 TYPE REF TO cl_gui_custom_container.
*******************************************************************
CLASS lcl_event_receiver DEFINITION DEFERRED.
****************************************************************
*:--- LOCAL CLASSES: Definition
****************************************************************
*:--- Definition der Grid-Klasse
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
*:--- Methoden
CLASS-METHODS:
*:--- Toolbar (Standard buttons)
hnd_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
*:--- Rückgabecodes (Funktion)
hnd_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
*:--- Private Vereinbarungen
PRIVATE SECTION.
ENDCLASS.
*:--- Toolbar
METHOD hnd_toolbar.
LOOP AT gt_toolbar INTO gf_toolbar.
APPEND gf_toolbar TO e_object->mt_toolbar.
ENDLOOP.
ENDMETHOD.
*:--- User Command only if You have defined some
*********************************************
METHOD hnd_user_command.
CLEAR: gt_selline.
CLEAR: gt_seltab.
*:--- Selectierte Zeilen werden über Index zurückgeliefert
CALL METHOD hnd_grid_01->get_selected_rows
IMPORTING et_index_rows = gt_selline.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
*:--- add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = gs_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
*:--- Hier die ButtonMenüs prozessieren
CASE e_ucomm.
WHEN 'DO IT'
PERFORM doit.
ENDCASE.
CALL METHOD hnd_grid_01->refresh_table_display.
ENDMETHOD. "hnd_user_command
ENDCLASS.
hope it will help u
regards
ravish
plz reward points if helpful
04-10-2007 4:51 PM
check the below link also may be useful for ya
Here is a tutorial on the Heirarchy Sequential List ALV using the ALV OM.
~~Guduri