cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ALV grid size...

Former Member
0 Kudos

Hi All,

I am using ALV table (SALV_WD_TABLE) in my WDA application. I am displaying 4 columns in that ALV grid.

I am not able to do these three requirements.

1) " How to fit this ALV grid's Width to 100%?"

2) "How to give table header for that ALV grid?"

3) "How to change the column headers?

Can anyone Please help me regarding this.

Thanks in Advance...!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you!

Former Member
0 Kudos

Check the following code for setting ALV header and column headings.

* Instantiate the used component
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
 
  lo_cmp_usage =   wd_this->wd_cpuse_usg_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
 
* Get Model
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller =   wd_this->wd_cpifc_usg_alv( ).
 
  DATA lo_value TYPE REF TO cl_salv_wd_config_table.
  lo_value = lo_interfacecontroller->get_model(
  ).
 
*---------- ALV table settings.
  DATA: l_table_settings TYPE REF TO if_salv_wd_table_settings .
  l_table_settings ?= lo_value.
  wd_this->l_table =  l_table_settings .
 
* Set the Editable property to true
  l_table_settings->set_read_only( abap_false ).
* Set table header
  DATA: l_header TYPE REF TO cl_salv_wd_header.
  l_header = l_table_settings->get_header( ).
" table header
  l_header->set_text( 'Sales Orders' ).
 
*---------- Column settings
  DATA: l_column_settings TYPE REF TO if_salv_wd_column_settings.
  l_column_settings ?= lo_value.
 
* Get columns
  DATA: lt_columns TYPE salv_wd_t_column_ref ,
        ls_columns TYPE salv_wd_s_column_ref .
 
  DATA: l_column_header  TYPE REF TO cl_salv_wd_column_header .
 
  lt_columns = l_column_settings->get_columns( )              .
 
  LOOP AT lt_columns INTO ls_columns                          .
    CASE ls_columns-id                                        .
      WHEN 'VBELN'                                            .
        l_column_header = ls_columns-r_column->get_header( )  .
        l_column_header->set_ddic_binding_field(
           if_salv_wd_c_column_settings=>ddic_bind_none )     .
" column heading
         l_column_header->set_text( 'Sales Order' )            . 
      WHEN' ATTR2'.
........
       WHEN OTHERS.
........
 
ENDLOOP.
Your 1st Qs. is not quite clear to me. Can you be more clear. Regards, Radhika

Former Member
0 Kudos

Thanks for your reply Radhika.

My first question is " How to set the width of ALV table to 100%?" . In case of normal table we will set the Width property to 100%...like that how we will set the width for ALV table?

I pasted your code, and after deploying my application, i got the headers and some buttons like CHECK,APPEND LINE,INSERTLINE AND DELETE LINE....

But I don't want these buttons....How to delete these buttons from ALV grid.

Can you please help me.

Former Member
0 Kudos

Hi,

DATA
  lo_value  type ref to cl_salv_wd_config_table,
  lr_tabset type ref to if_salv_wd_table_settings.

lr_tabset ?= lo_value.

*   Set the width of alv display
      CALL METHOD lr_tabset->set_width
        EXPORTING
          value = '100%'.

Are these standard buttons you are refering to?.

If yes,

lo_value->if_salv_wd_std_functions~set_edit_append_row_allowed( abap_false ).
lo_value->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
lo_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).
lo_value->if_salv_wd_std_functions~SET_EDIT_CHECK_AVAILABLE( abap_false ).

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

I tried with your code, But there is no change in my ALV table size.....

Can you please help me.

Thanks in Advance!

Former Member
0 Kudos

Hi,

First use the transpoarent conatiner and set the width to 100% for the Matrix layout and inside this have the view container UI element for the ALV.

Regards,

Lekha.