cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine if a BO is read-only at runtime

Former Member
0 Kudos

Hi,

actually there is a problem within the AfterModify script of a BOs Item.

SAP told me that we are trying to modify a property, which is not allowed at this time.

I wonder why the AfterModify triggers, if it is not allowed to make any changes.

How can I check in ABSL if a property is writable?

Thanks

Best Regards

Erhan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Most of the SAP Business Objects have an Status (Mostly shown also in the UI) which defines if the content is read-only or not. In most of the cases the behavior of changing the BO from the ABSL is the same as trying to change the BO from the UI. If the field is read-only in an specific status in the UI it is unlikely that the value can be changed with ABSL code in the same Status.

You have to manually implement the status checks in your ABSL to reduce errors which could be thrown by the underlying SAP BO.

Best regards

Tobias

Former Member
0 Kudos

Hi,

thanks, yes that is exactly what I am looking for, the Status for SalesOrder which makes the SalesOrder readonly.

I can not see this Status in the UI.

Any suggestions for the Status Code of a Sales Order?

Thanks & Regards

Erhan

Former Member

Hi,

is the Status field not visible in your screens?

Best regards

Tobias Kuhn

Former Member
0 Kudos

Yes, it must be the "Finished"-State then.

Thank you for your help.

Regards

Erhan

Answers (1)

Answers (1)

former_member183363
Active Contributor
0 Kudos

You can check by trying to assign a value --- if, when you try to activate it, you get an error saying 'is not writeable' or something of the ilk then it's read-only. You can also look at the properties in the repository explorer, it'll tell you what's read-only and what isn't. Remember that the deployment unit of the solution can make a difference.

Former Member
0 Kudos

Hi Lewis,

thanks for your answer, but there is no error when activating. The error is thrown by the backend, if the SalesOrder is in a special state. My question now is, what state causes this readonly?

Regards

Erhan

former_member183363
Active Contributor
0 Kudos

If a sales order is completed or cancelled then it's read-only; besides that, generally it's writeable from the sales order itself. Attempts to write to a sales order from, say, a script on a purchase order will not work, I've tried.