Skip to Content
avatar image
Former Member

Get message ID using reference IDoc number in SAP PO

Hello Experts ,

We are having one scenario in which data will be sent from third party to PO and from PO to SAP ECC (IDoc) to create the opportunity in ECC.

Once opportunity is created successfully in SAP ECC, it will send the success confirmation data to third party(ECC-PO-third party). But in case of technical error in ECC while creating the IDoc, IDoc is having very limited data in it. So we are not able to get the required field (third party opportunity ID) in that IDoc.That field we need to send back to third party so that they can understand the error is for which opportunity ID. The same field is available in first interface (ie third party-PO-ECC)

     so we have decided to use the payload of first interface to parse it and to get the required data(third party opportunity ID) from it.The flow will be like technical error IDoc will be having reference IDoc number of first interface from which we will find the messageID. From messageID we will find the messageKey and from messageKey, payload. Referring below link.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/04/13/pixi-how-to-get-a-pi-message-from-java-stack-aae-in-pi-711-from-abap

But we are not able to find message ID from IDoc reference number in SAP PO. Do we have any APIs to retrieve the same. Can anyone please help us with the same.

Regards ,

Nikhil Save

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 29, 2016 at 02:11 PM

    Hello Nikhil,

    Try using beans as per the below discussion

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Nikhli,

      what is ur Database?is that oracle?

      Install Oracle drivers and do a normal JDBC scenario,But ensure ur using only select statement as it is not recommended to modify these tables.

  • Jun 29, 2016 at 02:30 PM

    Hi Nikhil,

    Better solution would be when you receive the first IDoc in ECC you must save opportunity ID some where in the ECC itself and if any error during processing of the first IDoc then send the opportunity ID in the second IDoc from ECC to PI.

    Regards,

    Praveen.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Praveen Gandepalli

      Hi Praveen ,

      I am completely agree with you. But business wants to go by that way. So we are also not having any option.

      Kindly let me know if you are having any idea regarding querying PO database table XI_IDOC_OUT_MSG by writing UDF .

      Regards ,

      Nikhil Save

  • Jul 01, 2016 at 12:21 PM

    Hi Nikhil,

    Another approach you can use is create a proxy and using proxy post the idoc and then check the status of idoc after posting and log according to status in ECC in some table and then in second scenario read that table and send data to third party.

    Regards

    GB

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi GB ,

      As per the requirement, we have to use IDoc only and not proxies 😔.

      Regards ,

      Nikhil Save