cancel
Showing results for 
Search instead for 
Did you mean: 

Enable Inputfield in the table column even though the column is empty

former_member206441
Contributor
0 Kudos

Dear Experts

How to enable or disable a table column(it is an inputfield) dynamically.

I done this and strugling to proceed from this point

DATA lr_container TYPE REF TO cl_wd_uielement_container.

DATA lr_table TYPE REF TO cl_wd_table.

DATA lr_view TYPE REF TO if_wd_view.

DATA lr_child TYPE REF TO cl_wd_uielement.

data : lr_col TYPE REF TO CL_WD_TABLE_COLUMN.

data : lr_inp TYPE REF TO cl_wd_input_field .

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lt_children = lr_container->get_children( ).

CALL METHOD lr_container->get_child

EXPORTING

id = 'ITEMS_TABLE'

index = 1

RECEIVING

the_child = lr_child.

lr_table ?= lr_child.

CALL METHOD lr_table->get_column

EXPORTING

id = 'ZVPN_IT_INP'

index = '6'

receiving

the_column = lr_col.

Upto this the code is working fine as per the requirement .Now the thing is in that in column we r having an input field which should be enabled dynamically

Regards

Arun

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arun.,

For enabling and disabiling any field on the view, there is only procedure.

1. Make an attribute of type 'ABAP_BOOL' in the context.

2. Bind the enable property of the UI element to this attribute.

3. Enable or Disable the UI element in the code.

So for your question you can follow :

1. Make an attribute 'ENABLE' in the context node bound to the table. Type ABAP BOOL.

2. Bind 'ENABLE' property of the desired input field with this attribute.

3. In WDDOMODIFYVIEW check your condition and based on the condition use set_attribute method of if_wd_context_node to change the value to 00 - None or 01 - Enabled.

I hope your question is answered.