This is Part 4 of the four-part series on using the new Neuron ESB SAP Connector. In Part 1, we showed you how to set-up the SAP Connector and then use it for importing schemas based on SAP BAPIs, RFCs and IDocs and generating sample XML documents based on those schemas. In Part 2, we showed you how to call BAPIs and RFCs. In Part 3, we showed you how to set-up SAP to send a Material Master IDoc and how to receive it in Neuron ESB. In this post we will walk you through sending a Status update IDoc back to SAP. The steps here require you to have completed the steps in Parts 1 & 3 of the series.
Modify the Partner Profile in SAP
Sending IDocs to SAP also requires a little setup on SAP. You’ll need to add an inbound parameter to the partner profile previously created.
- Modify the Neuron Partner Profile – In the SAP GUI use transaction WE20 to modify the partner profile:
- Click the green plus to add an Inbound parameter. Set the Message type to STATUS and the Process code to STA1. Save the changes:
Create the Neuron Subscribing Connector Endpoint
- In Neuron ESB Explorer, navigate to Connections->Connector Endpoints and click the New button
- Set the Name of the Connector Endpoint to SAPIDOCOutboundEndpoint. This Connector Endpoint will be used to IDocs to SAP
- Set the Party Id to SAPIDOCSubscriber
- Set the Connector to SAPConnector
- Set the Mode to Subscribe
- Click on the Properties tab
- Under the category Connection set the properties necessary for connecting to SAP. You will need all the same properties as you set in the first Connector Endpoint:
- Click the Apply button, then save the Neuron solution. If the Neuron ESB service is already configured to host this solution and is currently running, the Connector Endpoint will automatically start. Check the status of the Connector Endpoint using Neuron ESB’s Endpoint Health monitor.
Send an IDoc to SAP
In the first post of this series you imported the schema and sample XML for sending a status IDoc to SAP. You can use this sample XML to test the IDoc. These steps assume you have saved the previous changes, configured the Neuron ESB runtime to host this solution and started the Neuron ESB Service.
- In Neuron ESB Explorer, navigate to Repository->XML Documents. Select the document Idoc_Send_SYSTAT01_SYSTAT01 and click the XML tab. Copy the contents of the XML document. If you want to format the XML before copying, right-click in the text area and select Format.
- Start the Neuron ESB Test Client from Start->All Programs->Neudesic->Neuron ESB V3 (<instance name>)->Neuron Test Client.
- In the Test Client select TestPublisher as the Party Id and click the Connect button:
- Navigate to the Send tab. Set the Topic to SAP.IDOC.Outbound, the Sematic to Multicast and paste the contents of the XML document into the message area:
- At this point you have an XML request with no real data in it. All of the elements are empty. Before using this message you have to set some of these fields:
- Under the element <idoc>:
- Under the element <idoc><E1STATS>:
- Under the element <idoc>:
Note – the DOCNUM value must match the value of the DOCNUM you received with the material master IDoc in the previous step!All of the other elements can remain nil or you can delete them. This would be the minimal XML that you can send:
<SYSTAT01 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Neuron.Esb.Connectors.SAP/IDOC/Send/SYSTAT01/"> <idoc> <MESTYP>STATUS</MESTYP> <RCVPRN>T90CLNT090</RCVPRN> <RCVPRT>LS</RCVPRT> <SNDPOR>NEURON</SNDPOR> <SNDPRN>NEURON</SNDPRN> <SNDPRT>LS</SNDPRT> <E1STATS> <DOCNUM>0000000001082801</DOCNUM> <LOGDAT>20150713</LOGDAT> <LOGTIM>133000</LOGTIM> <STATUS>12</STATUS> </E1STATS> </idoc> </SYSTAT01>
- Click the Send button. There will not be a response message.
- To verify the receipt of the status IDoc in SAP, use transaction code BD87. The default values in the Select IDocs screen will display all IDocs sent today. Click the execute button to see the list. The IDoc you sent earlier will now have a status of 12.
And that’s it for now! In this series we demonstrated how to use the Neuron ESB SAP Connector to generate schemas and XML samples, execute functions like BAPIs and RFCs and receive and send IDocs. As we add more features to the SAP Connector we will build upon this series.