Idoc acknowledgment for sender adapter in SAP PO 7.5 with ALEAUD Idoc
Recently, I received a requirement from one of my client where they wanted to update the IDOC status from 03 ( IDOC sent to external system) to SUCCESS or ERROR status so that their Functional/Business team can get the failed & successful Idoc list of SAP PO messages without looking into the SAP PO system.
Key Challenges encountered by customer:
- Once the IDOC is transmitted to SAP PO, it is updated with status 03 which doesn’t tell what happen with that IDOC in SAP PO.
- Business team needs to rely on SAP PO support team to get the list of failed messages.
- Turn around time from application support team was high when the number of failed messages were high in SAP PO.
To overcome this issue i enabled the standard configuration in Idoc sender adapter to receive acknowledgements from SAP PO back to ECC system from ALEAUD IDOC.
I couldn’t achieve all the required functionality with this configuration and it took a week to figure out whole situation. Hence tried to document the same so that it can help others.
Addition of ALEAUD to Inbound parameter of the Partner Profile.
After this configuration you will start getting acknowledgements for all messages those are successfully transmitted from SAP PO system to target receiver via ALEAUD Idoc, but SAP PO will not send back the acknowledgement for messages which are failed in System Error.
Reason for not getting Error Ack: IDOC sender sends the acknowledgement for messages those are in its final status. System Error is not considered as final state as these messages can be wither resent or cancelled.Once you cancel the message manually or through program you will get the acknowledgement back to SAP ECC.
We will be seeing below status for the Idoc:
Status 03 : Idoc is sent to external system ( SAP PO)
Status 41: Message is transmitted from SAP PO system.
Status 40 : Message can not be processed in SAP PO system.
Different Methods to get the Error Acknowledgements/Cancel failed messages:
- Cancel failed message manually in SAP PO- It will send the ALEAUD Idoc for the cancelled message as message can’t be processed further.
- Cancel failed messages through background Job – You can cancel the messages by configuring standard Job provided by SAP PO. You can put the filter on this job to handle the messages of specific scenario.
- Cancel failed messages through monitoring API – You can cancel the messages through monitoring API by fetching message Keys. This gives more filtering option than the background job.
Below are the details for cancelling the messages via Background Job and Monitoring API:
Cancel failed messages through background Job:
Create a cancel Job for your scenario:
Goto Monitoring -> Adapter Enging -> Background Job Process Monitor -> Adapter Engine Jobs
Click on Create Job and then create a cancel job with required parameters.
You can add parameter simulate only to check if your job is fetching correct number of intended messages. This will not take any action on the failed messages. No of messages read by the job can be seen in the log tab of the job.
Note : You can add more status in parameters followed by ;.
Currently i have put ICO ID in the rules tab. You can put more rules to ensure that you are cancelling correct messages.
After defining parameters click on Activate. This will enable the job and you need not to cancel the messages manually from system.
Cancel failed messages through monitoring API:
You can also cancel the messages from monitoring API provided by SAP. It provided three authentication mechanism ( Basic, Client Certificate and SSL binding).
For testing in SOAP UI, you can use Basic authentication.
You can cancel the messages by calling two endpoints.
- Get the message Keys of Failed messages by calling getMessageList endpoint:
You will get all the messages based on filter criteria:
Message Key = <Message ID>\<Direction>\<NodeID>\<QOS>\<SequenceNo>
Always put the statuses in camel case
<!–Zero or more repetitions:–>
- Cancel the messages by passing message key in the cancelMessages endpoint.
You can cancel the failed messages based on message Key.
By above two methods you can achieve mass cancellation in SAP PO to avoid manual interaction. You will also get the negative acknowledgement from IDOC sender adapter which indicates IDOC is not processed in SAP PO.
Below is the status of failed IDOC and status is changed to 40 from status 03:
Reference Note :
Any suggestion is most welcome and appreciated !!!