cancel
Showing results for 
Search instead for 
Did you mean: 

Make rows as non editable in ALV

former_member197475
Active Contributor
0 Kudos

Hi Experts,

I have a standard ALV table where records are fetched from backend table. Here I have a field Approved as check box.

My requirement is I need to make all the rows as non editable, if the Approved checkbox is checked. How can I achieve this.

I went through the below discussion, but still am not clear of how to achieve it.

I know to set a field as non editable in WD, but don't know how to set some specific rows as non editable in alv.

Please help me.

With Regards,

Ramakrishnan M

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Create an Attribute in the Context say READ_ONLY of type wdy_boolean and bind the read only of cell editor to that attribute using set_read_only_fieldname( ) method. Then set the value of attribute READ_ONLY to abap_true/abap_false based on check box value.

check this wiki for reference: How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki

Hope this helps u,

Regards,

Kiran

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi RK,

You can achieve your requirement as below


  • Let us say the field "approved/not approved" status is available as a column "STATUS"
  • Now, loop over each column and get the editor and set the read only field name to the column name "STATUS"  by using method SET_READ_ONLY_FIELDNAME( 'STATUS' )
  • As status column holds the approval state as true/false, it decides which row to be in editable/ non-editable

Hope this helps you.

Regards,

Rama

former_member197475
Active Contributor
0 Kudos

Hi Rama,

My context node has a Dictionary Structure and it's not possible to add a boolean type attribute to it.

So I thought of creating an attribute at context level. But how can i bind it to the ALV Data node? Is there any other possibility??

Please let me know.

With Regards,

RAM

ramakrishnappa
Active Contributor
0 Kudos

Hi RK,

You can add a field into the Z structure and then you can update context node for updated attributes.

Or,

You can delete the z Structure name from the NODE binding. So, that you can add an attribute directly into context node.

Regards,

Rama