cancel
Showing results for 
Search instead for 
Did you mean: 

Input Enabled in ALV table

farooq_basha
Active Participant
0 Kudos

Hi,

I tried to make the alv cells as editable cells using below coding.

DATA:LR_INF1 TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD.

DATA: LO_COLUMN2 TYPE REF TO CL_SALV_WD_COLUMN.

LO_COLUMN2 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'ATYPEOFEXPENSE' ).

CREATE OBJECT LR_INF1

EXPORTING

VALUE_FIELDNAME = 'ATYPEOFEXPENSE'

.

LO_COLUMN2->SET_CELL_EDITOR( LR_INF1 ).

But still the alv cell is non editable.

pls suggest me....

Regards,

Farooq

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Farooq,

By default itself ALV is display all fields in edit mode only.

You can try this..

DATA: l_ref_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
l_ref_INTERFACECONTROLLER = wd_This->wd_CpIfc_Alv( ).
data:
l_VALUE type ref to Cl_Salv_Wd_Config_Table.
l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model( ).

* set read only mode to false (and display edit toolbar)

data: lr_table_settings type ref to 
if_salv_wd_table_settings.

lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false ).

* set cell editor for input fields (~make colum editable)

DATA: lr_column TYPE REF TO cl_salv_wd_column.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'SAMPLE' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname =
'SAMPLE'.
lr_column->set_cell_editor( lr_input_field ).

Cheers,

Kris.

farooq_basha
Active Participant
0 Kudos

But i am unable to enter the Values in ALV table Cells

FYI

CARDINALITY OF ALV TABLE BINDED NODE IS ........

Collection cardinality 1:n

selection cardinality 0:n

Thanks and Regards,

Farooq

Former Member
0 Kudos

Hi,

Try above code and let me know.

Cheers,

Kris.

farooq_basha
Active Participant
0 Kudos

By default ALV is non-editable only

Now i set read only property to ABAP_FALSE then table become editable.

Thanks for ur Coding

farooq_basha
Active Participant
0 Kudos

Hi Kissnas,

What about for Normal Table.

Regards,

Farooq

Former Member
0 Kudos

Hi,

You can do this by creating one attribute of type WDY_BOOLEAN and bind it to table column read only property.

Based on certain condition make it edit and non-edit. OR

You can also acieve this by using CELL VARIANTS.

Cheers,

Kris.