on 12-29-2011 1:48 PM
Hi ,
I have an requirement where I have to send the Idoc number in MDN which is sent as an acknowledgement after AS2 system has received an INVOIC Idoc .
Scenario is like below:
Part I: R/3(Invoic idoc)>PI>(Idoc xml)AS2
R/3 system will send an Idoc to PI. PI will do the mapping and sent to AS2 system with the Idoc number in AS2 subject. This is done by an udf. Part I is working fine.
Part II: AS2(MDN)>PI>R/3(ALEAUD Idoc)
After receiving the idoc xml, AS2 system will send an MDN. This MDN does not contain idoc # which has been processed successfully in the part I. PI is receiving the MDN message like below
-
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <DtReport xmlns="http://uri.seeburger.com/dt/master/schema">
<clientId>000</clientId>
<correlationId>dbeb6ed9-2cbe-11e1-c7f1-000007ec0f66</correlationId>
<category>DeliveryReport</category>
<state>SUCCESS</state>
<finalReport>true</finalReport>
- <specificData>
<key>messageID</key>
<value><186989715515267382041324573406247.SEEBURGER.dxiadm@26.91.24.10></value>
</specificData>
- <specificData>
<key>subject</key>
<value>Message Disposition Notification</value>
</specificData>
- <specificData>
<key>channelID</key>
<value></value>
</specificData>
- <specificData>
<key>channel</key>
<value>CC_SND_AS2_MDN_XX_PKI</value>
</specificData>
- <specificData>
<key>originalchannel</key>
<value>CC_RCV_AS2_XXX_EDI_SEEBURGER_INVOIC_PKI</value>
</specificData>
- <specificData>
<key>to</key>
<value>PARTY_XX</value>
</specificData>
- <specificData>
<key>from</key>
<value>PARTY_YY</value>
</specificData>
- <reportAttachment refID="dffd66c0-2cbe-11e1-9654-af0c1a5b180a">
<ns1:objectInfo charset="binary" creation="2011-12-22T17:03:31.116+00:00" location="MEMORY" size="3391" type="INLINE" xmlns:ns1="http://uri.seeburger.com/bisas/message/schema" />
</reportAttachment>
</DtReport>
-
Can anyone please let me know how can I get the idoc number in received MDN from AS2? So that we can easily identify which has been received the MDN and processed successfully.
Thanks,
Arivarasu S
Arivarasu,
When PI receives XML for AS2, does it contain the IDoc number??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
Sorry either I did not understand your answer or you did not understand my question. Can you please explain little bit?
Actually MDN is getting generated whenever an INVOIC02 idoc is reached in AS2. As an acknowledgement it is generated by AS2. So the MDN should contain the Idoc # when it is sent as an Acknowledgement from AS2 then only I can map it to the ALEAUD idoc.
Thanks,
Arivarasu S
>> So the MDN should contain the Idoc # when it is sent as an Acknowledgement from AS2
This is not possible in standard way. And my guess is, it is not possible even with customization.
The only solution I see is: check the DtReport content and see if it contains message id of the original message. If yes, then you may first store the message ID and corresponding in the first flow and then when you receive DtReport, make a lookup in the table to get the Idoc number and pass it further to SAP.
Regards,
Prateek Raj Srivastava
Hi Prateek and Kiran,
Thanks for your very valuable and useful answers. Finally I managed to get the output what I wanted to get. except the exception from RFC.
Steps what I did
1. I have created a new RFC program to pick idoc number from msg id.
2. Actually MDN is containing the Correlation Id which is actually the original message id with some '-' in between.
3. mapped this ID to RFC input after removing - . It is working now :-).
But the problem is if I run the interface end to end or test through test tab, RFCLOOKUP is giving the exception
<rfc:ZPI_PICK_IDOC_NUM.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>INVALID_DATA</Name><Text>Invalid data</Text><Message><ID>null</ID><Number>000</Number></Message></rfc:ZPI_PICK_IDOC_NUM.Exception>
If i enter the same message Id in se37 it is giving the idoc number. But I dont understand why is it giving the exception through RFCLOOKUP.
Can anybody let me know how can i rectify this exception.
Thanks,
Arivarasu S
Can somebody please let me know what is the reason for the exception in RFCLOOKUP.
Thanks,
Arivarasu S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prateek,
This is my code:
FUNCTION ZPI_PICK_IDOC_NUM .
*"----
""Local Interface:
*" IMPORTING
*" VALUE(IN_GUID) TYPE SXMSMGUID
*" EXPORTING
*" VALUE(IDOC_NUM) TYPE EDI_DOCNUM
*" EXCEPTIONS
*" KEYSTRING_EMPTY
*" RETURNFIELD_EMPTY
*" KEYFIELD_DOES_NOT_EXIST
*" INVALID_DATA
*"----
TYPES: BEGIN OF ty_itab,
GUID type SXMSMGUID,
IDOCNUMBER type EDI_DOCNUM,
END OF ty_itab.
DATA: it_itab TYPE TABLE OF ty_itab,
wa_itab type ty_itab.
SELECT GUID IDOCNUMBER FROM IDXSNDPOR INTO table it_ITAB
WHERE GUID = IN_GUID.
IF sy-subrc EQ 0.
loop at it_itab into wa_itab.
move wa_itab-IDOCNUMBER to IDOC_NUM.
exit.
endloop.
ELSE.
RAISE invalid_data.
ENDIF.
ENDFUNCTION.
I guess this is giving one of the exception which I have added in exception tab.
Thanks,
Arivarasu
when you trigger the invoice idoc, you get its xml format in xi moni. As the idoc number already exist in XML file. for the part II you have to map the DOCNUM field in the AS2(MDN)>PI>R/3(ALEAUD Idoc) flow to get the idoc number from ACK MDN.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.