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: 

Object Model -> cl_salv_hierseq_table Check box in the parent entry

former_member194669
Active Contributor
0 Kudos

Hi,

I am doing a report with cl_salv_hierseq_table (Object Model) , in that i need to put a check box in the t_table_level1 level. I know that SALV is not have an option to edit.

My requirement is from the list user select multiple parent entries (ie t_table_level1 ) and selected entries must be converted to web template and send to HTML repository.

Currently i am struck up with creating a check box in HIERSEQ list

Any Info?

1 ACCEPTED SOLUTION

Former Member
4 REPLIES 4

Former Member

0 Kudos

Hi mrutyun^,

Thanks for info. I have already checked this before posting this question.

0 Kudos

Hi aRs. You need to use the class CL_SALV_SELECTIONS for this. See here,





DATA: gt_parent TYPE TABLE OF scarr.
DATA: gt_child TYPE TABLE OF sflight.
DATA: gr_table  TYPE REF TO cl_salv_hierseq_table.
DATA: gr_selections TYPE REF TO cl_salv_selections.

DATA: lt_binding TYPE salv_t_hierseq_binding.
DATA: ls_binding TYPE salv_s_hierseq_binding.

SELECT * FROM scarr INTO CORRESPONDING FIELDS OF TABLE gt_parent.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_child.

ls_binding-master = 'CARRID'.
ls_binding-slave  = 'CARRID'.
APPEND ls_binding TO lt_binding.

CALL METHOD cl_salv_hierseq_table=>factory
  EXPORTING
    t_binding_level1_level2 = lt_binding
  IMPORTING
    r_hierseq               = gr_table
  CHANGING
    t_table_level1          = gt_parent
    t_table_level2          = gt_child.

gr_selections = gr_table->get_selections( level = 1 ).
gr_selections->set_selection_mode( cl_salv_selections=>if_salv_c_selection_mode~multiple ).

gr_table->display( ).

This will give you the checkboxes in the parent level, you still need to write the code to get the selected rows.

Regards.

Rich Heilman

0 Kudos

Thanks Rich,

Now its working. I can able to create check box for parent entries and also able to capture the checked entries