Symptom
While trying to create maintenance plan using API_MAINTENANCEPLAN, got error message 'You have no authorization to execute action for the document'. Communication arrangement already created based on communication scenario SAP_COM_0396.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
1. Check communication arrangement created based on communication scenario SAP_COM_0396, communication user which assigned to the arrangement is API_USER.
2. Use Postman or https://api.sap.com/api/API_MAINTENANCEPLAN/tryout to call API_MAINTENANCEPLAN with POST request, example payload as below:
*Be noted below payload data can only be used as example.
{
"MaintenancePlanDesc": "maintenance plan example, test api",
"SchedulingDuration": "365",
"SchedulingDurationUnit": "DAY",
"CycleModificationRatio": "1.00",
"MaintPlanSchedgIndicator": "0",
"CallHorizonPercent": "80",
"MaintenanceCall": 0,
"MaintenancePlanCategory": "SO",
"SchedulingStartDate": "2024-01-01T00:00:00",
"LateCompletionShiftInPercent": "100",
"LateCompletionTolerancePercent": "10",
"EarlyCompletionShiftInPercent": "100",
"EarlyCompletionTolerancePct": "10",
"SchedulingEndDate": "2025-01-01T00:00:00",
"MaintenancePlanCallObject": "12",
"to_MaintenanceCycle": [{
"MaintPlanCycRcrrcIntervalQty": "1",
"MaintPlanCycRcrrcIntervalUnit": "MON",
"MaintPlanCycleDesc": "test cycle"
}
],
"to_Item": [{
"MaintenanceItemDescription": "maintenance item, test api",
"MaintenancePlanCategory": "SO",
"Equipment": "EQUI_DEMO",
"ServiceDocumentType": "SVO1",
"ServiceContract": "1000000001",
"ServiceContractItem": "100",
"ServiceOrderTemplate": "2000000001",
"ServiceDocumentPriority": "1"
}
]
}
3. Execute and see the error message 'You have no authorization to execute action for the document'.
Cause
Communication user does not have authorization while creating maintenance plan with category 'SO' (Service Order).
Communication scenario SAP_COM_0396 only grants Communication user to be able to create maintenance plan with category 'PM' (Maintenance Order) & 'YM' (Maintenance Request).
Resolution
Create another communication arrangement based on communication scenario SAP_COM_0350 (Service Order OData Integration), and assign the same communication user API_USER to the new arrangement.
Now the communication user should get enough authorization from both scenario SAP_COM_0350 and SAP_COM_0396.
See Also
Keywords
Maintenance Plan, API_MAINTENANCEPLAN, Service Order, SAP_COM_0396, SAP_COM_0350 , KBA , PM-PRM-MP-2CL , Maintenance Plans (Public Cloud) , Problem