cancel
Showing results for 
Search instead for 
Did you mean: 

How can I turn an input field in a table editable?

Former Member
0 Kudos

Hello,

I have a table with 5 fields, where 4 are dropdowns and 1 an input field.

I did the 4 dropdowns editables field, but the input field I didn't.

How can I turn an input field in a table editable?

Follow below the code used to turn the dropdowns editables, but didn't work for the input field.

do 41 times.

append ls_idioma to lt_idioma.

enddo.

lo_nd_idioma->bind_table(

new_items = lt_idioma

set_initial_elements = abap_false ).

LOOP AT lt_idioma into ls_idioma.

lr_element = lo_nd_idioma->get_element( sy-tabix ).

lr_child_node = lr_element->get_child_node( 'LEITURA' ).

lr_child_node->bind_table( new_items = lt_leitura

set_initial_elements = abap_false ).

lr_child_node = lr_element->get_child_node( 'ESCRITA' ).

lr_child_node->bind_table( new_items = lt_escrita

set_initial_elements = abap_false ).

lr_child_node = lr_element->get_child_node( 'CONVERSACAO' ).

lr_child_node->bind_table( new_items = lt_conversacao

set_initial_elements = abap_false ).

lr_child_node = lr_element->get_child_node( 'CERTIFICADO' ).

lr_child_node->bind_table( new_items = lt_certificado

set_initial_elements = abap_false ).

ENDLOOP.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you for your help, but I'm not using an ALV table.

Former Member
0 Kudos

Hi Santos,

To make the coloumn of the input field editable try using this code.

*To get the column reference

data: lr_column type ref to cl_salv_wd_column,

lr_input type ref to cl_salv_wd_uie_input_field.

*GET THE COLUMN REFERENCE

lr_column = lo_value->if_salv_wd_column_settings~get_column( 'Column name' ).

**CREATING THE INPUT FIELD

create object lr_input

exporting

value_fieldname = 'nmae ofthe coloumn'.

.

*MAKE COLUMN EDITABLE

*

call method lr_column->set_cell_editor

exporting

value = lr_input.

Hope u can solve the problem.

Goodday!.

Regards,

Sana.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You should consider just data binding the enabled property of your inputfield (and your DDLBs as well) to an attribute in your context. That way you can just flip the value of this attribute at each element and the editable ability will open up.

As as I look at how you are populating your DDLBs, this seems really inefficent. You binding the exact same children tables for each element. That's going to create a huge context. Unless you need different values at each element, you should really consider using a Drop Down by Key and populating the allowed values at the attribute value set level using IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET. Your performance and session size will be much better:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm