Symptom
- When calling GET on API_MAINTENANCEORDER v2 entity to_MaintenanceOrderLongText, the response contains both the maintenance order description and the long text if the order’s long text has never been updated via API.
- After updating the maintenance order long text via API (PATCH), subsequent GET calls return only the long text, without the description.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Access Change Maintenance Order app, maintain both description and long text for maintenance order.
- Call GET /sap/opu/odata/sap/API_MAINTENANCEORDER;v=2/MaintenanceOrder('XXX')/to_MaintenanceOrderLongText and observe that the response includes description and long text.
- Call PATCH /sap/opu/odata/sap/API_MAINTENANCEORDER;v=2/MaintenanceOrderLongText(MaintenanceOrder='XXX',TextObjectType='KOPF',Language='E') to update maintenance order long text.
- Call the same GET again and observe that only the updated long text is returned.
Cause
In WebDynpro app, the description and long text are appened together and stored as a single text in backend database. This behaviour is consistent as long as user uses WebDynpro app to modify the values. But when user uses API to create or patch the order, the text that is passed in long text will be saved as is. Therefore, orders that have never been updated by API may return a combined description and long text, while orders updated via API return only the submitted long text.
Resolution
Standard behavior as per the technical design of the API.
Keywords
API_MAINTENANCEORDER, to_MaintenanceOrderLongText, maintenance order, long text, description appended, OData v2, GET response, PATCH long text, Web Dynpro app, Change Maintenance Order, text consistency. , KBA , PM-FIO-2CL , Fiori User Interface (UI) for PM (Public Cloud) , PM-WOC-MO-2CL , Maintenance Orders (Public Cloud) , Problem
SAP Knowledge Base Article - Public