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: 

ALV HIERARCHY using class

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

check the below link also may be useful for ya

Here is a tutorial on the Heirarchy Sequential List ALV using the ALV OM.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/alv%20object%...

~~Guduri

5 REPLIES 5

Former Member
0 Kudos

Hi,

Check for this program..

BCALV_TEST_HIERSEQ_LIST....

Hope this help.. assign points...

raj

Former Member
0 Kudos

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.




hope it will clear ur doubt

regards
ravish
plz reward

points

if helpful

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

check the below link also may be useful for ya

Here is a tutorial on the Heirarchy Sequential List ALV using the ALV OM.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/alv%20object%...

~~Guduri