cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Tree shows graphic with table by mistake

Former Member
0 Kudos

Hi everyone!

I'm trying to use an ALV Tree in webdynpro, but when i use the code to configure the ALV into Tree, a graphic appears below the table:

This is the code I've been using:

*---------------------------------------------------------------------------------------------------------------

  DATA l_ref_cmp_usage           TYPE REF TO if_wd_component_usage.

  DATA lo_nd_nodo_alv            TYPE REF TO if_wd_context_node.

  DATA lo_alv_config             TYPE REF TO cl_salv_wd_config_table.

  DATA lo_header                 TYPE REF TO cl_salv_wd_header.

  DATA l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

  DATA lr_field                  TYPE REF TO cl_salv_wd_field.

  DATA lr_column                 TYPE REF TO cl_salv_wd_column.

  DATA lr_column_header          TYPE REF TO cl_salv_wd_column_header.

* navigate from <CONTEXT> to <NODO_ALV> via lead selection

  lo_nd_nodo_alv = wd_context->get_child_node( name = wd_this->wdctx_nodo_alv ).

* Instantiate ALV component

  l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).

  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

    l_ref_cmp_usage->create_component( ).

  ENDIF.

*   Pass context node to ALV

  l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

  l_ref_interfacecontroller->set_data( lo_nd_nodo_alv ).

  lo_alv_config ?= l_ref_interfacecontroller->get_model( ).

  lo_alv_config->if_salv_wd_table_settings~set_display_as(

    if_salv_wd_c_table_settings=>display_type_hierarchy ).

  lo_alv_config->if_salv_wd_std_functions~set_hierarchy_allowed( abap_true ).

*  cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(

*    lo_alv_config ).

  lo_header = lo_alv_config->if_salv_wd_table_settings~get_header( ).

  lo_header->set_text( value = 'Report' ).

  lr_column = lo_alv_config->if_salv_wd_column_settings~get_column( 'WAID' ).

  lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

  lr_column = lo_alv_config->if_salv_wd_column_settings~get_column(

    'PARENT_WAID' ).

  lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

*---------------------------------------------------------------------------------------------------------------

How can a get rid of this graphic on the screen?

I think is a problem with the constant:  if_salv_wd_c_table_settings=>display_type_hierarchy which has the same value as if_salv_wd_c_table_settings=>>display_as_table_graphic.

We are using SAP ECC 6.0 EHP5.

Thanks,

Luis Ayala

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

*---------------------------------------------------------------------------------------------------------------

  DATA l_ref_cmp_usage           TYPE REF TO if_wd_component_usage.

  DATA lo_nd_nodo_alv            TYPE REF TO if_wd_context_node.

  DATA lo_alv_config             TYPE REF TO cl_salv_wd_config_table.

  DATA lo_header                 TYPE REF TO cl_salv_wd_header.

  DATA l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

  DATA lr_field                  TYPE REF TO cl_salv_wd_field.

  DATA lr_column                 TYPE REF TO cl_salv_wd_column.

  DATA lr_column_header          TYPE REF TO cl_salv_wd_column_header.

* navigate from <CONTEXT> to <NODO_ALV> via lead selection

  lo_nd_nodo_alv = wd_context->get_child_node( name = wd_this->wdctx_nodo_alv ).

* Instantiate ALV component

  l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).

  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.

    l_ref_cmp_usage->create_component( ).

  ENDIF.

*   Pass context node to ALV

  l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

  l_ref_interfacecontroller->set_data( lo_nd_nodo_alv ).

  lo_alv_config ?= l_ref_interfacecontroller->get_model( ).

"ADD THIS

*------------------------------------------------------------------------------------------------------------------------

  DATA lr_table_settings TYPE REF TO if_salv_wd_table_settings.

   lr_table_settings ?= lo_alv_config .

   lr_table_settings->set_display_type( if_salv_wd_c_table_settings=>display_type_hierarchy ).

*... init FunctionSettings

   cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(

     r_model = lo_alv_config ).

*--------------------------------------------------------------------------------------------------------------------------

"COMMENT THIS

*------------------------------------------------------------------------------------------------------------

"  lo_alv_config->if_salv_wd_table_settings~set_display_as(

"   if_salv_wd_c_table_settings=>display_type_hierarchy ).

  lo_alv_config->if_salv_wd_std_functions~set_hierarchy_allowed( abap_true ).

*-------------------------------------------------------------------------------------------------------------

*  cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(

*    lo_alv_config ).

  lo_header = lo_alv_config->if_salv_wd_table_settings~get_header( ).

  lo_header->set_text( value = 'Report' ).

  lr_column = lo_alv_config->if_salv_wd_column_settings~get_column( 'WAID' ).

  lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

  lr_column = lo_alv_config->if_salv_wd_column_settings~get_column(

    'PARENT_WAID' ).

  lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

*---------------------------------------------------------------------------------------------------------------

Former Member
0 Kudos

Thanks Upendra, that's what I needed.

Atte.

Luis Ayala

Former Member
0 Kudos

Hi Upendra!

I used your suggestion and it worked...

But know we got another problem with the same ALV as a tree, the information on the other columns is only showed at the leaf line.

What can be done to show the information in every line?

Atte.

Luis Ayala

Answers (0)