cancel
Showing results for 
Search instead for 
Did you mean: 

ALV make read only at runtime

Former Member
0 Kudos

Hi,

I have 2 internal tables that the RFC returns at runtime.

Both have the same structure.

First one contains data.

The second one contains boolean value (flag value) if the corresponding field in the first table is editable or readonly.

Am using an alv to apply this.

How do i go about the concept?

Thanks & regards,

Ronita

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hI,

DATA:

lr_comp_alv TYPE REF TO if_wd_component_usage,

lr_comp_if_alv TYPE REF TO iwci_salv_wd_table,

lr_config TYPE REF TO cl_salv_wd_config_table,

lr_column TYPE REF TO cl_salv_wd_column,

ls_column TYPE salv_wd_s_column_ref,

lt_columns TYPE salv_wd_t_column_ref.

data: lr_link type ref to CL_SALV_WD_UIE_input_field.

*... ALV Component Usage

lr_comp_alv = wd_this->wd_cpuse_alv( ).

IF lr_comp_alv->has_active_component( ) IS INITIAL.

lr_comp_alv->create_component( ).

ENDIF.

lr_comp_if_alv = wd_this->wd_cpifc_alv( ).

*... Configure ALV

lr_config = lr_comp_if_alv->get_model( ).

  • Display link in column object id

lr_column = lr_config->if_salv_wd_column_settings~get_column('OBJID' ).

CREATE OBJECT lr_link.

lr_link->set_text_fieldname( 'OBJID' ).

lr_column->set_cell_editor( lr_link ).

lr_column->set_read_only('x').

Former Member
0 Kudos

Hi Ronita,

You will have to programatically code this in the following manner.

While configuring the ALV, you would have set a UI element as the cell editor type for the column you are interested in.

Say for example, you have set the cell editor type as an INPUT field - CL_WD_INPUT_FIELD

So in a loop, you will have to get a reference to the UI element type (after getting the ALV model), and then use the SET_READ_ONLY of CL_WD_INPUT_FIELD to set the field as readonly or edit mode.

OR

Which configuring the ALV for the first time, when you set the cell editor type to refer to an instance of CL_WD_INPUT_FIELD, use the BIND_READ_ONLY method to bind a context attribute to the READ_ONLY property of the UI element.

Hope this helps,

Regards

Wenonah

Former Member
0 Kudos

i have implemented the syntax. That isnt a problem.