cancel
Showing results for 
Search instead for 
Did you mean: 

how to send PI captured message ID back to SAP system

Former Member
0 Kudos

Hi Experts,

I have a requirement that.. I have to capture the message id of message in PI system which is sent by SAP and that message ID I have to send back to SAP system again and the main target (third party system) also.

SAP >PI>SOAP

SAP>PI>SAP.

How to solve this requirement. Please guide me how to do this.

Thanks & Regards,

Satish Kumar P.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member854360
Active Contributor
0 Kudos

Hi

,

Please use this Wiki to read the message ID and map it to IDOC unused field under EDI_DC40 segment.

http://wiki.sdn.sap.com/wiki/display/Snippets/UDFtoReadMessageIDofaPIMessage

Former Member
0 Kudos

Hi,

I have to send the message id to two receivers at the same time. If I use the UDF it will send the same message id to both target systems.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Hi Satish,

If you want to send message ID to SOAP Client, please refer SAP Note "SAP Note 856597 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 SOAP".

Also in case of SAP systems, SAP PI message id is already getting passed.

For example: In case of Proxy communication, same message ID will be used to create mesage in SAP ECC.

In case of IDOC communication, IDOC control record will capture SAP PI message ID.

Or do you wish to pass the message ID in some field in structure? If yes, do you have separate mapping program for each receiver?

Regards,

Gouri

Former Member
0 Kudos

Hi,

Yes I have to map the message id to target structures. I have created the different mappings for both receivers and i have tested. It's sending two different message id's to two receivers. But the parent message id is common for both.

But my requirement is i have to send same message id to both systems.

Source structure is common and we have two different target structure.

In 1 first mapping (SAP->SOAP) I have mapped all the fields and udf to message id field

In 2 mapping (SAP->SAP) i have mapped some field and udf to message id field.

please guide me if i did any wrong.

thanks & regards,

Satish Kumar P.

Former Member
0 Kudos

Hi,

I assume you want to send the parent message ID to both targets. Correct me if I am wrong.

Also share the UDF code that you have written.

Regards,

Gouri

Former Member
0 Kudos

Hi,

Exactly, I have to send parent message id to both systems.

And this is the udf code I am using.

public String getMessageID(Container container) throws StreamTransformationException{

String MessageID;

java.util.Map param = container.getTransformationParameters();

MessageID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);

MessageID = MessageID.toLowerCase();

String String1 = MessageID.substring(0,8);

String1 = String1+"-";

String String2 = MessageID.substring(8,12);

String2 = String2+"-";

String String3 = MessageID.substring(12,16);

String3 = String3+"-";

String String4 = MessageID.substring(16,20);

String4 = String4+"-";

String String5 = MessageID.substring(20,32);

MessageID = String1String2String3String4String5;

return MessageID;

}

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

R you on PI 7.1?

Why dont you use multi mapping and then variable in target structure??

So that first you pass the parent message ID to varible in target structure and then you can pass the variable value to any field in target structure.

Regards,

Gouri

Former Member
0 Kudos

Hi,

Yes I am using PI 7.1.

Can you tell me how to trigger the parent message id and what are the steps for multimapping.

First time I am working these type of multiple receivers scenarios.

I will appreciate your help on this.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Hi Satish,

Try using the 1:n Multi Mapping scenario.

This will have on Sender and multiple receviers.

Regards,

Anudeep

Former Member
0 Kudos

In the current message mapping, go to signature tab where you can add different target structures. You will find some blogs on SDN for multimapping. Let me check if I can get something for you.

Once you create your multimapping, you can right click on target structure. You will get add variable option. Whatever value you will pass to this variable, it will hold during runtime. You can map this variable to required target field.

I think the UDF that you have written will give you parent message ID at runtime. But I need to check this. I will try to develop a sample scenario and get back. Mean while plz work on multimapping.

Thanks,

Gouri

Former Member
0 Kudos

Hi Gouri,

What is Add Variable. What variable I have to pass.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Please check this blog for Add variable.

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8638] [original link is broken] [original link is broken] [original link is broken];

Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

I have done the mapping with add variable option. What are the I.D. steps i have to configure.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Use Enhanced Interface Determination.

There is a blog by Jin Shin on "Multi-Mapping without BPM - Yes, itu2019s possible!". You can refer that.

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3115] [original link is broken] [original link is broken] [original link is broken];

Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

I have done the scenario and tested. Still PI is sending different sub message id's. For your reference find the below messge id's taken from sxmb_moni

XML Original Message Msg ID = 9AD6574E0F60BD5BE10000000A428A70

. Subnode Msg ID = 00505695440A1EE0B6A678AB1535DF97

. Subnode Msg ID = 00505695440A1EE0B6A678AB1535FF97

Thanks & Regards,

Satish Kumar P.

former_member854360
Active Contributor
0 Kudos

Only possible solution

You cant use this in case of a message split.

If you need the parent message for a split message you can do a RFC Lookup to PI server and get it. In the RFC select the parent message id (PARENTMSG) from SXMSPMAST table by passing the current message id (child message id) as MSGGUID.

In your case

If you select PARENTMSG from SXMSPMAST table by passing MSGGUID as 00505695440A1EE0B6A678AB1535DF97

then it will return 9AD6574E0F60BD5BE10000000A428A70

XML Original Message Msg ID = 9AD6574E0F60BD5BE10000000A428A70

. Subnode Msg ID = 00505695440A1EE0B6A678AB1535DF97

. Subnode Msg ID = 00505695440A1EE0B6A678AB1535FF97

Former Member
0 Kudos

Sub Node will have different message ID. When you are creating two different messages in PI (One for SOAP and one for SAP), they will definately have two different message IDs as message ID is unique per message.

Do you mean you want to create message with same message ID for SOAP and SAP??? If yes, then it is not possible as you are having two different messages.

I thought messages will get created with different message ID, but you want same parent message ID to be passed to some field in structure.

Plz clarify.

Regards,

Gouri

Former Member
0 Kudos

Hi,

The RFC LookUp, I need to do this in PI system or in SAP R/3 system.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Hi Gouri,

Yes I need to pass the parent message ID to some field in target structures. In my case source structure is same and target structures are different.

Thanks & Regards,

Satish Kumar P.

former_member854360
Active Contributor
0 Kudos

Hi,

This simple Custom RFC you need to create in PI ABAP stack.

In ABAP code you need to select PARENTMSG from SXMSPMAST table by passing MSGGUID

Any good ABAP resource can create it in 1 hour.

Former Member
0 Kudos

Hi Debashish Roy,

can you elaborate this. I don't know how to do this.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Refer below blog for RFC look Up.

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8650] [original link is broken] [original link is broken] [original link is broken];

Link: SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups

Regards,

Gouri

former_member854360
Active Contributor
0 Kudos

Hi,

Consult to your ABAP Team about the RFC creattion

Tell them In ABAP code you need to select PARENTMSG from SXMSPMAST table by passing MSGGUID In PI ABAP stack.

And for uusing this RFC in Mapping you can refer the blog mentioned by Gouri.

Former Member
0 Kudos

Hi Gouri,

I will try to do that, What are the I.D. steps I have to do. In that MultiMapping Blog in Interface Determination there is a option Enhanced Interface Determination. But I don't find that option in Interface Determination.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

In PI 7.1, once you select occourance 0 to unbounded in Operational Mapping, it will reflect in Multicity Option of Interface determination.

This you will see in front of operation mapping in interface determination.

Regards,

Gouri

Former Member
0 Kudos

Hi,

How Many Interface Determinations and How many receiver agreements and how many receiver determinations I have to do.

I am getting the error " Problem occurred in receiver agreement for ".

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

1 Receiver Determination with Sender SAP and two Receivers SAP and SOAP.

1 Interface Determination with Multimapping.

2 Receiver Agreements. 1 for SAP and 1 for SOAP.

Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

The same steps i have created but I am getting the same error.

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Have you given the correct Interface names while creating Receiver agreement?

Also try testing the scenario in ID using Test Configuration option from Receiver Determination.

Please paste complete error description.

Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

I have assigned the correct interfaces in receiver agreement.

I have tested in ID. I am getting the error at Interface Determination level.

The error is

Operation Mapping

GoodsMovementInventoryUpdateReq_SAP_To_CSL_In

 

Runtime error

Mapping program is not available in runtime cache:

 

Former Member
0 Kudos

Plz chk below things.

1. Cache is refreshed.

2. Your mapping program is active and correct mapping program is selected in Operational Mapping.

3. After updating Oprational Mapping with occourance 0 to Unbounded, Same is selected in Interface Determination to make Multicity 1 to Unbounded. Activated the interface determination after doing this change.

4. Cache status in ID at environment-cache status overview.

Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

I tried that, I am getting the below error in sxmb_moni.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Technical Routing

-->

- <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="OUTBINDING">CO_TXT_OUTBINDING_ERROR</SAP:Code>

<SAP:P1>-XJL_300</SAP:P1>

<SAP:P2>-BS_TPT_CSL,http://sap.com/xi/castp/TransactionalData.UpdatePIMessageID_In</SAP:P2>

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>No standard agreement found for , XJL_300, , BS_TPT_CSL, http://sap.com/xi/castp/TransactionalData, UpdatePIMessageID_In</SAP:AdditionalText>

<SAP:Stack>Problem occurred in receiver agreement for sender -XJL_300 to receiver -BS_TPT_CSL,http://sap.com/xi/castp/TransactionalData.UpdatePIMessageID_In: No standard agreement found for , XJL_300, , BS_TPT_CSL, http://sap.com/xi/castp/TransactionalData, UpdatePIMessageID_In</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Thanks & Regards,

Satish Kumar P.

Former Member
0 Kudos

Hi Gouri,

What should i need to do to resolve the configuration issue.

thanks & regards,

Satish Kumar P.

Former Member
0 Kudos

Hi Satish,

There must be something wrong in the developement. Or might be cache issue. Bcoz the solution we are using to resolve yr issue seems fine. If i get time, i will try developing the scenario and share results.

However, mean while plz recheck the developement and cache.

-Gouri

Former Member
0 Kudos

Hi Satish,

This may help you.

/people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi

Thanks!

Ray.

Former Member
0 Kudos

Hi Gouri,

Thanks for the help. We finally understood that Multi-Mapping doesn't work for Different Receivers. So we are going for different approach..

Thanks to all.

Thanks & Regards,

Satish Kumar P.

former_member194786
Active Contributor
0 Kudos

Hi Satish,

In case you are using proxy communication to SAP, use SOAP adapter and then you would be able to use multimapping.

Also, in case you want to send the same message id to both the recievers use Enhanced Reciever determination and pass the parent message id in dynamic configuration and then that can be used in the subsequent multimapping to pass to the target system.

Hope this is useful.

Regards,

Sanjeev.