cancel
Showing results for 
Search instead for 
Did you mean: 

Editable columns in table control?

Former Member
0 Kudos

Hi Gurus,

I am using table control. When I click one button(Add Structure ) i am creating table rows with data, example it creates 3 rows everytime on click on this button. But coming to colmns, for first row i want first 2 columns are in edit mode, in 2nd row 3, 4th colms are in edit and in 3rd row last 2 cols are in edit mode.

For this i searched in this form i got some solution, i applied that but i am getting first row all columns in edit mode.

I tried like this ... I created 3 attributes INV1, INV2,INV3 of type wdy_boolean in node. binded with enable property first 2 cols to INV1 like that. and on ADD_STRUCT button action code like this.

DATA lo_nd_structure TYPE REF TO if_wd_context_node.

DATA lo_el_structure TYPE REF TO if_wd_context_element.

DATA ls_structure TYPE wd_this->Element_structure.

data lt_structure type wd_this->Elements_structure.

  • navigate from <CONTEXT> to <STRUCTURE> via lead selection

lo_nd_structure = wd_context->get_child_node( name = wd_this->wdctx_structure ).

ls_structure-month1 = First Month.

APPEND ls_structure TO lt_structure.

ls_structure-month2 = Sec Month.

APPEND ls_structure TO lt_structure.

ls_structure-month3 = Third Month.

APPEND ls_structure TO lt_structure.

lo_nd_structure->bind_table( new_items = lt_structure set_initial_elements = abap_false ).

DATA DIS1 TYPE WDY_BOOLEAN.

DATA DIS2 TYPE WDY_BOOLEAN.

DATA DIS3 TYPE WDY_BOOLEAN.

DIS1 = ABAP_TRUE.

DIS2 = ABAP_FALSE.

DIS3 = ABAP_FALSE.

lo_nd_structure->set_attribute(

name = `INV1`

value = DIS1 ).

DIS1 = ABAP_FALSE.

DIS2 = ABAP_TRUE.

DIS3 = ABAP_FALSE.

lo_nd_structure->set_attribute(

name = `INV2`

value = DIS2 ).

DIS1 = ABAP_FALSE.

DIS2 = ABAP_FALSE.

DIS3 = ABAP_TRUE.

lo_nd_structure->set_attribute(

name = `INV3`

value = DIS3 ).

ENDMETHOD.

Thanks,

Madhan.

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

Hey Madhan,

Try is like below.

..
DATA lo_nd_structure TYPE REF TO if_wd_context_node.
DATA lo_el_structure TYPE REF TO if_wd_context_element.
DATA ls_structure TYPE wd_this->Element_structure.

data lt_structure type wd_this->Elements_structure.

* navigate from <CONTEXT> to <STRUCTURE> via lead selection
lo_nd_structure = wd_context->get_child_node( name = wd_this->wdctx_structure ).

ls_structure-month1 = First Month.
ls_structure-INV1 = ABAP_TRUE.
ls_structure-INV2 = ABAP_FALSE.
ls_structure-INV3 = ABAP_FALSE.

APPEND ls_structure TO lt_structure.

ls_structure-month2 = Sec Month.
ls_structure-INV1 = ABAP_FALSE.
ls_structure-INV2 = ABAP_TRUE.
ls_structure-INV3 = ABAP_FALSE.

APPEND ls_structure TO lt_structure.

ls_structure-month3 = Third Month.
ls_structure-INV1 = ABAP_FALSE.
ls_structure-INV2 = ABAP_FALSE.
ls_structure-INV3 = ABAP_TRUE.

APPEND ls_structure TO lt_structure.

lo_nd_structure->bind_table( new_items = lt_structure set_initial_elements = abap_false ).




ENDMETHOD.



.

Thanks

sarbjeet singh

Former Member
0 Kudos

Hey Thanks alot sabjeet,

Madhan.

Answers (0)