01-25-2008 4:28 PM
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?
a®
01-25-2008 4:47 PM
hi
good
check this link
http://help.sap.com/saphelp_sm32/helpdata/en/a9/e6eb40c4f8712ae10000000a155106/content.htm
thanks
mrutyun^
01-25-2008 4:47 PM
hi
good
check this link
http://help.sap.com/saphelp_sm32/helpdata/en/a9/e6eb40c4f8712ae10000000a155106/content.htm
thanks
mrutyun^
01-25-2008 4:52 PM
Hi mrutyun^,
Thanks for info. I have already checked this before posting this question.
a®
01-25-2008 5:10 PM
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
01-25-2008 5:18 PM
Thanks Rich,
Now its working. I can able to create check box for parent entries and also able to capture the checked entries
a®