cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Webdynrpo - issues

Former Member
0 Kudos

Hi,

I have created a ALV webdynrpo and have following questions.

1- I have created a zstructure and used in my webdynpro.I don't want to display one of the column.How do we hide that?

2- How can we re-arrange columns sequence in the output view ?

3- I have 2 views(SEARCHVIEW & OUTPUTVIEW) and I was able to hide COPY/RESET buttons which comes on screen defaultly in SEARCHVIEW by using following code in WDDOINIT method

wd_this->m_handler->set_global_options( i_display_btn_cancel  = abap_false
                                                              i_display_btn_check   = abap_false
                                                              i_display_btn_reset     = abap_false
                                                              i_display_btn_execute = abap_false ).

When I run the report it is using OUTPUTVIEW and these(COPY/RESET) are comming back again.I tried using same code in WDDOINT of OUTPUTVIEW but I am getting an error.

Access via 'NULL' object reference not possible.

4- How do we add Checkbox to the one of the output Column.Just need to enable or disable based on variable.

Rgds

Vara

Edited by: Vara K on Jan 15, 2009 6:19 PM

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

That is a lot of questions for one thread. In general you will need to access the component usage interface of the ALV and then you can gain access to the model class of the alv. I often do this functionality in the WDDOINIT of my component controller.

data: l_ref_cmp_usage type ref to if_wd_component_usage.
  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.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).

Throught the model object (cl_salv_wd_config_table) you can do most everything you describe in code. Also consider that with the settings button you can do most of these things at runtime and save the settings as views.

1- I have created a zstructure and used in my webdynpro.I don't want to display one of the column.How do we hide that?

data l_column type ref to cl_salv_wd_column.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'CLIENT' ).
  l_column->set_visible( cl_wd_uielement=>e_visible-none ).

2- How can we re-arrange columns sequence in the output view ?

l_column = l_table->if_salv_wd_column_settings~get_column( 'BUYER_GUID' ).
  l_column->set_position( 2 ).

3- I have 2 views(SEARCHVIEW & OUTPUTVIEW) and I was able to hide COPY/RESET buttons which comes on screen defaultly in SEARCHVIEW by using following code in WDDOINIT method

Are you sure you are talking about ALV here. This code sample looks like Select-Options and not ALV. Reset and Execute definitely sounds like Select-Options as ALV has no such standard buttons.

4- How do we add Checkbox to the one of the output Column.Just need to enable or disable based on variable

data checkbox type ref to cl_salv_wd_uie_checkbox.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'ADD_PARTICIPANTS' ).
  create object checkbox.
  checkbox->set_checked_fieldname( 'ADD_PARTICIPANTS' ).
  checkbox->set_enabled_fieldname( 'ADD_PART_ENABLED' ).
  l_column->set_cell_editor( checkbox ).

Former Member
0 Kudos

Thomas,

Sorry for long list of questions.

I was able to resolve first 2 issues.

On the 4th one i am trying to put that code in ONACTIONSEARCH method becasue that's where I get my varaible value.I am getting a dump saying

Runtime Errors OBJECTS_OBJREF_NOT_ASSIGNED

Exception CX_SY_REF_IS_INITIAL

in st22 it is pointing like below.

loop at it_status assigning <fs_status>.

        if <fs_status>-STAT = 'E0001'.

          <fs_proj>-ZCBOA = 'X'.


          data l_table type ref to cl_salv_wd_config_table.
data l_salv_wd_table type ref to iwci_salv_wd_table.
 data l_column type ref to cl_salv_wd_column.
  data l_header type ref to cl_salv_wd_column_header.


data checkbox type ref to cl_salv_wd_uie_checkbox.
dump at this line--- l_column = l_table->if_salv_wd_column_settings~get_column( 'ZCBOA' ).
*  create object checkbox.
  checkbox->set_checked_fieldname( 'ZCBOA' ).
  checkbox->set_enabled_fieldname( 'VARIABLE' ).
  l_column->set_cell_editor( checkbox ).

Any idea what I am doing wrong?

Rgds

Vara

Edited by: Vara K on Jan 15, 2009 8:10 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You don't have any code to fill l_table. You have to repeate the code from WDDOINIT (see below) or save away the l_table reference variable for later usage.

data: l_ref_cmp_usage type ref to if_wd_component_usage.
  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.
 
  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).

Former Member
0 Kudos

Thank you Thomas.

I have resolved all 4 issues.I am awarding full points .

rgds

Vara

Answers (0)