cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic tables cell editor

Former Member
0 Kudos

Greetings everyone,

to continue what i started in my previous Q here

now i have the tables but i want to set the columns to be editable , inputfield instead of textview , but i wasn't successful so far.

Also how to set the coloring for each column or row .

Appreciate ur help

Thanks,

Mohammed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When you are done with the dynmiac Table UI element generation, you might have used Binding method for that table right..

You need to get the column references of this TABLE and loop through the columns and using the create the Input field objetcs and using the set cell editor method passthis input field to this cell editor.....

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Have a look at sample Web Dynpro Component - DEMODYNAMIC in package SWDP_DEMO

it shows how to create context at runtime, create table at runtime and binding it to the newly generated context.

All the coding is done inside Assistance Class methods - you can simply copy paste the required methods and tweak it to ur purpose.

Assistance Class Used is - CL_WD_DEMO_DYN_MODEL and method used to create table dynamically is CREATE_TABLE_FROM_NODE.

In this method they are creating textviews for each column but using the same type of coding you can create Input fields instead of text views. Only the type of UI element will change.

Required code will be something like this-

DATA inputi type REF TO cl_wd_input_field.
  data: coli type ref to cl_wd_table_column.
*    create column
    coli =
     cl_wd_table_column=>new_table_column(
       view = view
       id   = col_id
      visible = visible_mode ).
      CALL METHOD CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD
        EXPORTING
          BIND_VALUE = attr_path
*         TOOLTIP    =
          VIEW       = view
          VISIBLE    = visible_mode
*         WIDTH      =
        RECEIVING
          CONTROL    = inputi.

      coli->set_table_cell_editor( inputi ).

Hope you get a clue, from this code snippet..

Regards

Manas Dua

Former Member
0 Kudos

hi ,

go thru this article :

Conditionally Assigning Colors and Input Enable to ALV Columns in Web Dynpro ABAP

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0625002-596c-2b10-46af-91cb31b71393

regards,

amit