cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Inputfield in ALV

former_member574468
Participant
0 Kudos

Hi All,

I ve 3 columns and 5 rows.

say,

c1 c2 c3

r1 ac1 ac2 ac3

r2 bc1 bc2 bc3

r3 cc1 cc2 cc3

r4 dc1 dc2 dc3

r5 ec1 ec2 ec3

now all fields in column c1 and c3 are coming as display mode and c2 coming as input mode.

In c2 column I want bc2 only should show as a display field.

how to set the display mode for a single column in a table?

Plz help me out....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To achieve this scenario, follw the below steps;

1.Create an attribute 'READONLY' type BOOLEAN under the same node that is bound to your table.

2.Bind this attribute with the readonly property of Column 2's input field cell editor.

Now pass abap_true to disable the cell and abap_false to enable the cell.

For your scenario, if you want to disable bc2 you need to just modify your internal table as follows;

" lt_data has the contents of your table 
  loop at lt_data into ls_data.
   if sy-tabix eq 2.
    ls_data-readonly = abap_true. " disable the cell in second row ( column will be 2 as we have bound the attribute to col2's cell editor )
    modify lt_data from ls_data index sy-tabix.
   endif.
  endloop.
"rebind the modfied table
l_node->bind_table( lt_data ).

Based on your requirement you can modify the above code. just pass abap_true/abap_false to the readonly field to disable/enable the input field.

Check this wiki too [How to edit conditionally row of a ALV table in Web Dynpro for ABAP |https://wiki.sdn.sap.com/wiki/display/WDABAP/How%20to%20edit%20conditionally%20row%20of%20a%20ALV%20table%20in%20Web%20Dynpro%20for%20ABAP]

Regards,

Radhika.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vimal raj,

This is very simple follow the article below written by me.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71...