cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a web dynpro table line read only?

former_member195355
Participant
0 Kudos

Hiya,

I have a screen that has a table (not ALV) with a 'save' button.

The user enters values into the table - some lines they leave blank becasue they want a rest and would like to fill them in later.

The user presses the 'save' button and the lines with values are saved to the database.

However I'd also like these lines, with values, to now be read only - so the user can't edit them.

Now, I know how to make the whole table read only via:

But how would you do it for specific table rows?

Any thoughts would be much appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Create an attribute of type wdy_boolean and bind the cell editor read only property of table columns to that attribute. Then in onAction Save, loop the table and set the attribute value to abap_true to make it disabled.

Check this document for reference: . In this I have demoed for single column, you can do the same for all columns.

Hope this helps u,

Regards,

Kiran

Answers (2)

Answers (2)

ramakrishnappa
Active Contributor
0 Kudos

Hi Robert,

We can make table cells as editable / non-editable based on cell value by using property binding "READ_ONLY" of ui element.

I have created a document, please refer the below link

Hope this meets your requirement.

Regards,

Rama

nishantbansal91
Active Contributor
0 Kudos

HI Robert,

Whlie binding the table set the read only property of the table Select this Radio buttin" BInd to the property of the selected attribute. ' in the POPUP while binding and then set and get attribute of the specific field.

Nishant

TudorRiscutia
Active Participant
0 Kudos

Hello Robert,

Even though Nishant's solution is more elegant, the easiest way to achieve this is to add an extra hidden (it's not visible in the UI) attribute to your context structure (preferably type WDY_BOOLEAN) and bind each table cell's read-only property to that attribute. Afterwards, depending on which table line you want to make read-only, you set the property of that attribute to abap_true.

Hope this was helpful!

Tudor