Symptom
An error message is shown when trying to update a ticket status e.g. from "Open" to "In Process" or from "Pending" to "Completed".
- Inconsistency in status management between system status and status
Environment
- SAP Cloud for Customer
- SAP Cloud Applications Studio
Reproducing the Issue
- Open any ticket.
- Change the ticket status.
- Save the changes.
Cause
One possible cause for this issue is that a PDI script, most likely a BeforeSave Event on the Ticket BO (ServiceRequest), is performing a query with the Query Execute() function and fetching the same ticket being edited on the UI.
The query Execute() function does not consider data that has been created or changed during the session, so this means that if the field "Status.ServiceRequestLifeCycleStatusCode" buffer value (e.g. In Process) is not present in the database (e.g. Open) before the query Execute() was called, and one of the instances returned as part of the query result is the current instance being processed, the values for the current instance are overwritten by the query result and this causes an inconsistency when comparing the Status.ServiceRequestLifeCycleStatusCode and ServiceTerms.ServiceRequestUserLifeCycleStatusCode.
Resolution
To resolve the issue, you can consider replacing the query Execute() function with ExecuteDataOnly(), as per explained in SAP help documentation: Query Execution (Business Logic)
This ExecuteDataOnly() function does not produce any unwanted side effects by overwriting unsaved modifications.
Note: Please test this thoroughly in the test system before deploying to production.
See Also
The field ServiceTerms.ServiceRequestUserLifeCycleStatusCode is the Status field present on the UI, this will have the standard Statuses (1 - Open, 2 - In Process) as well as custom Status (Z1 - Pending etc).
The field Status.ServiceRequestLifeCycleStatusCode is an internal field which is used for consistency checks and validations.
Keywords
PDI, SDK, Inconsistency in status management between system status and status , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , LOD-CRM-SRP , Service Request Processing , Problem
SAP Knowledge Base Article - Public