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: 

How to hide fields in Hierarchical display whn using CL_SALV_HIERQSEQ_TABL

Former Member
0 Kudos
148

Hi all,

I am using class CL_SALV_HIERQSEQ_TABLE for hierarchical display.Can i hide the fields in slave(child) which are there in binding .

As my requirement is not to display same fields again in child records.

Any inputs to this will be helpful .

Thanks and Regards,

Taranam

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
54

Sure, if you look at the examples, which start with SALV, like the one that I mentioned in your other post, you can see how to do it. I think you can either set as technical, or you can use the SET_VISIBLE method.

*... *** SLAVE Settings ***
  try.
      lr_columns = gr_hierseq->get_columns( 2 ).
    catch cx_salv_not_found.
  endtry.

*... §4.1 set exception column
  try.
      lr_column ?= lr_columns->get_column( 'EXCEPTION' ).
      lr_column->set_technical( ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.

or




*... *** SLAVE Settings ***
  try.
      lr_columns = gr_hierseq->get_columns( 2 ).
    catch cx_salv_not_found.
  endtry.

*... §4.1 set exception column
  try.
      lr_column ?= lr_columns->get_column( 'EXCEPTION' ).
      lr_column->set_visible( ). 
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.

Regards,

RIch Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
55

Sure, if you look at the examples, which start with SALV, like the one that I mentioned in your other post, you can see how to do it. I think you can either set as technical, or you can use the SET_VISIBLE method.

*... *** SLAVE Settings ***
  try.
      lr_columns = gr_hierseq->get_columns( 2 ).
    catch cx_salv_not_found.
  endtry.

*... §4.1 set exception column
  try.
      lr_column ?= lr_columns->get_column( 'EXCEPTION' ).
      lr_column->set_technical( ).
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.

or




*... *** SLAVE Settings ***
  try.
      lr_columns = gr_hierseq->get_columns( 2 ).
    catch cx_salv_not_found.
  endtry.

*... §4.1 set exception column
  try.
      lr_column ?= lr_columns->get_column( 'EXCEPTION' ).
      lr_column->set_visible( ). 
    catch cx_salv_not_found.                            "#EC NO_HANDLER
  endtry.

Regards,

RIch Heilman

0 Kudos
54

Hi Rich,

Thanks once again. Will try it . Just a question , you have used get_columns(2). Is it possible that can i have slave records at level 3 also as shown below.

Where xx,yy etc are representing field names. If i can have at 3 level where we define 3 level fields.

Eg. Parent XXXX YYY ZZ

Slave XXXX A B C

D E

Regards,

Taranam

0 Kudos
54

No, the hierarchical sequential list ALV tool is limited to exactly two levels, the master and the slave, levels 1 and 2. So the "2" in that method call GET_COLUMNS referrs to the level which you want to get the column object, in this case, level 2 or the slave.

REgards,

RIch Heilman

0 Kudos
54

Thanks a lot .

Regards,

Taranam