cancel
Showing results for 
Search instead for 
Did you mean: 

webdynpro table rows - display

Former Member
0 Kudos

Hello,

I am displaying the webdynpro table in the UI.

Based on some conditions,I would like to make one or two rows(not columns) in the table as display only.other rows should be editale.

I am NOT using ALV for display.

Is it possible in webdynpro?

regards

John

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi John,

Which particular row of the table do you want to set as editable? That would be important for formulating the way in which you should code.

Suppose you are displaying the data of MARA using a table and want to make editable only rows in which the unit of measurement is equal to "CCM" then you can proceed as below.

Create a context node (say MARA) with desired fields as attributes. (Cardinality 0..n, Selection 0..1, Initialize lead selection) In addition create an attribute (say READONLY) of type WDY_BOOLEAN under the same node (MARA) which you are using for binding to the table.

First of all take all the cell editors of the table as type, "InputField" to make the entire table as editable. Then go to the each cell editor (TABLE_MATNR_EDITOR, TABLE_ERSDA_EDITOR,...) and bind the readOnly property of the cell to the attribute created earlier. (READONLY)

Below is the coding in WDDOINIT through which you set the desired functionality

METHOD wddoinit .
  DATA: lv_node TYPE REF TO if_wd_context_node,
        lt_mara TYPE ig_componentcontroller=>elements_mara,
        wa_mara TYPE ig_componentcontroller=>element_mara.

  SELECT matnr
         ersda
         ernam
         mtart
         matkl
         meins FROM mara INTO CORRESPONDING FIELDS OF TABLE lt_mara
                                 WHERE meins = 'GM' OR meins = 'CCM'.
  SORT lt_mara BY meins.

  lv_node = wd_context->get_child_node( name = wd_this->wdctx_mara ).
  LOOP AT lt_mara INTO wa_mara.
    IF wa_mara-meins = 'GM'.
      wa_mara-readonly = 'X'.
    ELSE.
      wa_mara-readonly = ' '.
    ENDIF.
    MODIFY lt_mara FROM wa_mara TRANSPORTING readonly.
  ENDLOOP.
  lv_node->bind_table( new_items = lt_mara ).
ENDMETHOD.

Regards,

Uday

Former Member
0 Kudos

This was great help.. thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks uday..excellent..

it was quick.

regards

John