How to configure SAP XI/PI to use the standard SAP communication APIs (Idoc, Bapi, Rfc, Enterprise Services) from external systems How to create the necessary certifiable XI Content with the XI Integration Builder SAP Integration & Certification Center,
[email protected] Updated version for XI/PI 7.0
February 2009
Contents 1 2 3 4 5 6 7 8 9 10 11 12
Introduction ..................................................................................................................2 First steps......................................................................................................................2 Add your system into the System Landscape Directory .................................................4 Establish the connection between the SAP systems .......................................................6 Transfer your Software Component into the Integration Repository ..............................7 XI Content for asynchronous IDOC Outbound..............................................................8 XI Content for asynchronous IDOC Inbound .............................................................. 18 XI Content for synchronous RFC/BAPI Inbound ........................................................ 27 XI Content for synchronous RFC/BAPI Outbound...................................................... 37 XI Content to invoke Web Services / SAP Enterprise Services.................................... 47 How to import/configure your XI Content in a target XI system.................................. 58 Files needed for Certification ...................................................................................... 59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
1 Introduction Purpose of this document This document describes how the SAP Exchange Infrastructure (XI/PI) 3.0 or 7.0 can be configured, so that external systems can communicate with a backend SAP system (e.g. SAP R/3 Enterprise) using the standard SAP XI adapter “HTTP” with XML communication. On the other side, the integration of XI with the backend SAP system is done with IDOCs or RFC modules (BAPIs). You could also integrate with the latest SAP systems using SAP Enterprise Services (see chapter 10). Throughout the document we will always use the term “XI”.
SAP Backend System
RFC
Rfc Adapter
SAP XI http Adapter
IDOC
http/ XML
3rd party system
Idoc adapter
The configuration of XI will lead to certifiable XI Content, that can be extracted and again imported into the customers XI system. Related Documents A lot of help can be found in the Online Help of SAP: http://help.sap.com/ Documentation SAP NetWeaver Process Integration SAP Exchange Infrastructure. You should at least read the basics of XI provided there (Overview Basics). You can also find some sample scenarios using XI (Overview
Demo Examples).
Certification Requirements It’s possible to certify an integration scenario with an SAP backend system using XI. To do that it’s necessary that the 3rd party system integrates with XI via one of the standard SAP adapters or a certified 3rd party adapter. XI Content Certification This tutorial lists all the steps that are necessary to get certifiable XI Content. But sure, you should also check the NW-XI-CNT certification test catalog. Please ask your local ICC to get further details about this (
[email protected] or
[email protected]) or check the ICC SDN page (http://www.sdn.sap.com/irj/sdn/icc):
2 First steps This tutorial is designed for the test environment provided by the SAP Integration and Certification Center (ICC). It consists of the SAP XI 7.0 system NX7 and the SAP R/3 enterprise backend system CE8. To include other XI systems or SAP backend systems further configuration might be necessary. You can get access to this test environment through our Remote Access Kit (RAC). For more information regarding RAC you should contact your local ICC or check the here: http://www.sdn.sap.com/irj/sdn/saprac The XI system is hosted on pwdf6425.dmzwdf.sap.corp, the internet address is iccpi7.sap.com. To use the XI system you need to install Java WebStart on your PC. You can get this as part of the J2SE platform provided by SUN. After the installation you should start Java WebStart manually and configure it correctly, so that it can access the internet (also check chapter 2.1). You should be able to execute the sample applications located on http://java.sun.com/products/javawebstart/apps/remoteApps.html.
2/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Now start the XI system NX7 and log on. After the logon, you should activate the user menu (ctrl-F10) to find all the necessary programs to configure, use and monitor the XI system. As a first check you should start the Integration Builder (“Start Integration Builder” or choose the following link: http://iccpi7.sap.com/rep/start/index.jsp) that opens in a separate browser window. Please check, if you can start all the four tools IntegrationRepository, IntegrationDirectory, SystemLandscapeDirectory and RuntimeWorkbench. The two Integration tools are based on Java WebStart and perhaps you have to start them several times before all the necessary classes are loaded completely into the WebStart-cache (see following chapter).
2.1
Connecting to NX7 system through a proxy server
The Integration Builder of the NX7 system can be reached directly from a web browser. If you need a proxy server for your internet connection, you should configure your browser accordingly. Also the Java Web Start tool must be configured. You can use the Java Web Start Preferences panel to view or edit the proxy configuration. Launch the Application Manager, either by clicking on the icon on the desktop (Microsoft Windows), or type ./javaws in the Java Web Start installation directory, and then select Edit/Preferences. If you are in an environment where access to the Web is through a proxy server, you are encouraged to use the Java Web Start Preferences panel to check that these are set-up correctly. The first time you start the two XI Web Start Applications (Integration Repository or Integration Directory), the necessary classes are loaded from iccxi.sap.com into the Java Web Start Cache. Especially if you have to connect through a proxy server, this can take quite long. To avoid any authentication problems, you should also add the following line to your hosts file (on windows platforms: \windows\system32\drivers\etc\hosts): 155.56.49.19
pwdf6425
pwdf6425.dmzwdf.sap.corp
iccpi7.sap.com
Now everything should be in place to start all the applications contained in the SAP XI Integration Builder.
2.2
Prerequisites if you want to do IDOC communication
For IDOC communication you also need ALE customizing in the SAP Backend System, and the description of this customizing is not part of this tutorial. ALE communication with IDOCs is implemented as communication between Logical Systems. In the following chapters, we assume that we have the following Logical Systems defined in the SAP Backend System “CE8”: Central Logical System of CE8, client 850: CE8CLNT850 Logical System created for the external system: CC_CRM
3/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
3 Add your system into the System Landscape Directory All our XI configuration objects will be created in the range of the external product that consists of one or more Software Component Versions. At first we need to add information about this 3rd party product into the System Landscape Directory (SLD). The name of the external business system will be CC_CRM.
IMPORTANT NOTE: Please neither use the sample objects mentioned below in your scenario, nor change the sample Integration Scenarios or Configuration Scenarios. Always create your own objects!! Additionally, most of the sample objects here have the prefix “CC”. This is just ICC related and does not reflect a special naming convention. You don’t have to use the same prefix
Now open the SLD. Edit the Software Catalog: In section “Software Catalog”, choose ”Products“ Click “New Product Version Enter the appropriate data into the three fields Vendor: e.g. ccvendor.com Name: e.g. ccCRM Version: e.g. 1.0 Then enter Software Unit name ccCRM. Now add a Software Component Name: e.g. CCVENDOR_CRM Version: e.g. 1.0 Click “Home” to go back The above information is part of your XI Content and must be named in the same way for all your customers. Therefore you have to export it from the SLD and provide this exported file for your customers to import into their SLD. To export, go to section “Software Catalog” / “Products” again, search your product from the list and select it, then simply press the “Export”-button. This exports the Product and all attached Software Components into one single zip-file. This zip-file is part of the XI content package and is required to submit for the certification. The information for Product, Product Version, Software Component and Software Component Version are also important for the PPMS data sheet and will be entered into SAP’s internal PPMS system. Please find further details about that in the XI Content certification catalog, chapter 4.
4/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Now create the “Technical System” and the “Business System”; these are customer specific and therefore not part of the static XI Content.
Create Technical System: Click on “Technical Systems”, then choose “New Technical System” Choose “Third Party”, press “Next” Enter some sample details System: e.g. ccCRM_system Host: your host name, e.g. P105077 Now choose the product created in the step before, e.g. ccCRM and the attached Software Components, and press “Finish”. Click “Home” to go back
Create Business System CC_CRM: Click on “Business Systems”, then choose “New Business System” Choose “Third Party”, press “Next” Choose the technical system created in the step before, e.g. ccCRM_system For IDOC communication, we should enter the Logical System as defined in the SAP Backend System for the external system, so in our sample it’s CC_CRM. Enter the name “CC_CRM”, then press “Next” two times Choose Integration Server “SAP_NX7_800” Click “Finish”, then “Home” to go back
Check the available Business Systems: Click on “Business Systems”. Now you should be able to find the two Business Systems necessary for our communication scenario: The SAP backend system SAP_CE8 Your external system CC_CRM
5/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
4 Establish the connection between the SAP systems In the following chapters we want to send messages from the CE8 to XI and vice versa, so we need a connection between the two systems:
4.1
Connect the CE8 system with the XI system NX7
Create R/3 destination in CE8: Log on to CE8 system, and with transaction SM59, create a new RFC destination that points to the XI system: RFC destination: Connection type: Documentation: Target Host: System Number:
CC_DEST_NX7 3 My Destination PWDF6425 (will then be automatically replaced by something) 10
Change to the Logon Tab and provide your logon details for the XI system. Try the connection and try the remote logon. Both should be successful.
4.2
Connect the XI system NX7 with the CE8 system
You only need to make changes here, if you want to make IDOC communication. Then you have to log on to NX7, Integration Server. Check R/3 destination: With transaction SM59, you can find an ABAP destination CC_DEST_CE8 that connects to the CE8 system. It’s not necessary to change that or create a new R/3 destination. Create port: With transaction IDX1, create a port named as the Logical System Name of your ALE customizing in the CE8 system. In our case, this name is CC_CRM. Port: CC_CRM Client: 850 Description: A valuable Text RFC Destination: CC_DEST_CE8 Check port: NX7 also needs one port to query IDOC metadata from the sending SAP system CE8. The port name must be SAP. So check that the following port is available. Don’t change this port, you also don’t need an additional port! Port: SAPCE8 Client: 850 RFC Destination: CC_DEST_CE8
6/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
5 Transfer your Software Component into the Integration Repository All the static XI configuration objects (message definitions, mappings etc.) belong to an Integration Scenario that lies in your Software Component Version created previously in the SLD. This Software Component must be created first in the Integration Repository, together with a meaningful namespace. So now open the Integration Builder, from there jump into the Integration Repository.
Important: Every change in the Integration Repository must be committed in a second step. So before you leave, you should make sure to jump to the “Change Lists”-Tab, rightclick on your change list and choose “Activate”.
Import your product from SLD: In the Integration Repository Menu, choose “Tools” System Landscape Directory” “Import Software Component Versions”. Choose your Software Component Version created in 3: CCVENDOR_CRM Click “Import”, then exit
“Transfer from
Add the Namespace: Open the Software Component, then doubleclick the Software Component Version CCVENDOR_CRM, 1.0 of ccvendor.com. Use the first icon to switch into the “change”-mode. Choose “Import of RFC … permitted” and enter the system details: o o
System: Client:
CE8 850
Go into the first line of the “Namespaces”-section and enter a namespace for your Integration Scenario: http://ccvendor.com/xi/crm_demo Save. Now you should find new objects under your Software Component Version. Now jump to the chapter that is relevant for you (6, 7, 8 or 9) and finish the XI Content Development.
7/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
6 XI Content for asynchronous IDOC Outbound In the following chapter we will configure the XI system, so that we can send MATMAS01 IDOCs from the CE8 system through XI to the external system CC_CRM using the SAP tRFC communication protocol. We only focus on the XI customizing, not the ALE customizing in the CE8. You can find the complete configuration in our XI system, so it should be easy to copy it using different external systems and IDOCs. As a prerequisite you should have completed chapters 3-5.
6.1
Check the customizing in the SAP backend system
Prepare ALE customizing: In the CE8 system, prepare the ALE customizing so that MATMAS01-IDOCs can be sent to the logical system CC_CRM. This name must match with the logical system name of the external Business System created in chapter 3. You also need to know the central logical system of the client (the sender system). In our case this is CE8CLNT850. The scenario is as follows: Outbound MATMAS01: CE8CLNT850 CC_CRM Into the port of your ALE customizing you have to enter the R/3 destination to the SAP XI system created in 4.1.
6.2
Create the Repository Content for the IDOC Outbound Scenario
Open the Integration Builder, from there jump into the Integration Repository. Important: Every change in the Integration Repository must be committed in a second step. So before you leave, you should make sure to jump to the “Change Lists”-Tab, rightclick on your change list and choose “Activate”. Import MATMAS01 message data: Since the external system already understands the MATMAS01 message format, we only need to import one message type into the XI system. We also don’t need any mapping. We can import the message type into our Software Component Version. Open your Software Component Version CCVENDOR_CRM, 1.0 of ccvendor.com “Imported Objects” Rightclick on “IDOCs” and choose “Import” Enter data: Application Server: cpce801 System Number: 75 your CE8-user and password Choose the IDOCs you want to import, in our case it’s MATMAS.MATMAS01, then “Continue”. Choose “Finish”, then “Close” after the successful import.
8/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Create Communication Channel Templates: The communication channels serve as the technical endpoints to the connected systems. Since we already know, that the SAP sender is connected via IDOC and the receiving external system is connected via http, we can create the templates for these endpoints now. This makes the configuration of the integration scenario later easier. For IDOC outbound, we only need a receiver communication channel: Open your namespace “Adapter Objects” and rightclick on “Comm Channel Templates”, choose “New” Enter a name for the external http receiver: idoc_outbound_HTTPreceiver and enter a meaningful description. Choose “Adapter Type” = “HTTP” by using the F4-Help-icon, save, then choose “Receiver”-type. That’s it, the details of the connection are usually defined later during the configuration and are therefore not part of the static XI Content. Save. Don’t forget the descriptions and the documentation! For all objects, you should always add a meaningful text in the field “Description” and also provide some further documentation, by clicking on
in the menu of the XI Content object:
1. Press here to show the documentation panel
2. Press here to add documentation
9/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Create the Integration Scenario: Open your namespace “Integration Scenarios…” and rightclick on “Integration Scenarios”, choose “New” Enter a name and description: IS_ReceiveMaterialMaster and choose “Create”. Create a graphical representation of the SAP system by rightclicking into the first grey column. The text “Insert Application Component” should appear, choose this one. o o o
Application Component Type = Product Version, title = SAP R/3 ENTERPRISE 47X110 Role – Name = SAP_System Choose “Apply”
Create a graphical representation of the external system by rightclicking into the second grey column. Choose “Insert Application Component”. o o o
Application Component Type = Product Version, title = ccCRM, 10. of ccvendor.com (our external product, created previously in the SLD) Role – Name = External_CRM_System Choose “Apply”
Don’t forget to enter some documentation of your Integration Scenario. It’s no bad idea to describe the scenario quite detailed here. Save.
Create action to send the MATMAS01 from the SAP_System Still in the edit mode of your Integration Scenario, rightclick into the SAP_System column and choose “Create Action” On the next popup we have to choose “External”, since from the view of our Software Component “CCVENDOR_CRM” SAP is the Partner Software Component. Enter the name “SendMatmas” and press “Finish”, then “Close” You can now find a window with the details of the action, switch to the change mode here. From the SAP_System we want to send the MATMAS message, so we need to add a line to the “Outbound Interfaces”. In the outbound-table, click on the +-icon and choose ObjectType = IDOC Click on the 7th icon of the table (“Display input help”) and choose the MATMAS01 from your Software Component CCVENDOR_CRM. Enter a meaningful description and documentation 10/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Save and close the created action Create action to receive the MATMAS01 in the External_CRM_System Still in the edit mode of your Integration Scenario, rightclick into the External_CRM_System column and choose “Create Action” On the next popup we have to choose “Internal”, since the External_CRM_System contains our own Software Component CCVENDOR_CRM. Enter the name “ReceiveMatmas” and press “Finish”, then “Close” You can now find a window with the details of the action, switch to the change mode here. Since we want to receive a message, we need to add a line to the “Inbound Interfaces”. In the inbound-table, click on the +-icon and choose ObjectType = IDOC Click on the 7th icon of the table (“Display input help”) and choose the MATMAS01 from your Software Component CCVENDOR_CRM. Enter a meaningful description and documentation Save and close the created action
Create connection for message flow between the previously created actions Still in the edit mode of your Integration Scenario, check the location of the two created actions. To get an asynchronous IDOC-connection, it’s necessary that the receiving action is “below” the sending action. Make sure to move the “ReceiveMatmas”-box accordingly:
Rightclick the action “SendMatmas” and choose “Define as Start Action”. Rightclick the action “ReceiveMatmas” and choose “Define as End Action”
Mark both actions by holding the shift-key, rightclick and choose “Create Connection …”. In the following popup, make sure that both checkboxes “MATMAS.MATMAS01” are marked. You can also see that the communication is asynchronous:
11/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Go to the “Assign Comm Channel Template” tab and assign the previously created template idoc_outbound_receiver in the receiver part. You can use the F4-help-icon in the “Name”-field to find the channel template in our Software Component CCVENDOR_CRM. Leave the sender part empty, as we don’t need to create a communication channel there:
Choose apply then save the Integration Scenario
Check the consistency of the scenario by choosing “Component View” “Check Configurability”. You should only receive warning messages like: “Check Result for Object IS_ReceiveMaterialMaster Component View IS_ReceiveMaterialMaster: Connection from Action to send Material Master from SAP to Action to receive Material Master from SAP has no mapping”
Activate all your changes (check chapter 5 about how to activate).
That’s it. With these simple steps you have created the certifiable content for the IDOC outbound scenario completely. If there are further communication steps involved in your scenario (other IDOCs or RFCs), you should add them directly into the already defined Integration Scenario. For a better overview, in our tutorial we will generate a separate Integration Scenario for each communication method.
12/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Export the Repository Content: After you have finished the creation of all the XI Content Objects, you can export the content so that it can be easily implemented at your customers site. Just choose “Tools Export Design Objects”, select the Software Component Version “CCVENDOR_CRM, 1.0” and export the objects that belong to your content that should be certified (usually “all objects of your Software Component Version”).
Note: When you are ready for a certification test drive, please provide us the export path with the name of your XI content and the exported SLD content zip file (see chapter 3).
6.3
Create the Configuration Scenario in the XI Integration Directory
In the next step, we want to configure our Integration Scenario in the XI Integration Directory, so that it fits into our existing landscape with an external HTTP server and the CE8 SAP system. After that, we want to test the communication. Since the system landscape is different for each customer, it’s not necessary to export the Integration Directory Content. For certifiable XI Content it must be possible, to configure it automatically with the Integration Scenario Configurator. So we will also check, if this works as expected. Open the Integration Builder, from there jump into the Integration Directory. Important: Every change in the Integration Directory must be committed in a second step. So before you leave, you should make sure to jump to the “Change Lists”-Tab, rightclick on your change list and choose “Activate”. Clear SLD cache: To have a consistent start, you should clear the SLD cache with “Environment” Cache”.
“Clear SLD Data
Import the Integration Scenario: In the first step, we copy the Integration Scenario created in the XI Integration Repository into a Configuration Scenario. Choose “Tools” “Transfer Integration Scenario from the Integration Repository” and use the F4-help-icon to find your Integration Scenario IS_ReceiveMaterialMaster in your Software Component Version. Click “Continue” The scenario is copied into a Configuration Scenario and you should change the name, e.g. into CS_ccReceiveMaterialMaster (“CS” is ConfiguationScenario). You can also add your company name or initials as a prefix, so that you can find it later easily. Click “Finish” and “Close”. This automatically starts the:
Integration Scenario Configurator: In this step we have to assign Services to our two Application Components “SAP_System” and “External _CRM_System” of our Integration Scenario. These services are the physically existent Business Systems “CC_CRM” and “SAP_CE8” that we have created in the System Landscape Directory in chapter 3.
13/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
We can start directly with step 2: 2. Assign Services: This is where we have to assign the Business Systems: o o
In the popup, use the arrow icons on the top to choose Role = SAP_System. Click on the “+”-icon of the table below and choose the F4-Help to find the Business System SAP_CE8.
o o o
Now use the arrow icons on the top to choose Role = External_CRM_System. Click on the “Create”-icon of the table below (4th icon) and choose 2 times “Continue” Look for your Business System CC_CRM. If it’s not available here, then it has been already created, click “Cancel”. If it’s available, then choose it, deselect the “Create Communication Channels Automatically” (Important!) and choose “Finish”, then “Close” If not yet assigned, click on the “+”-icon of the table below and choose the F4-Help to find the Business System CC_CRM.
o
o
Click on “Assign”.
3. Configure Connections: This is where we have to assign the Communication Channels: o
o o
In the popup, use the arrow icons on the top to choose the Communication Step you want to configure. Since we only have one step in our Integration Scenario, this is chosen automatically. In the table below, click into the field “Communication Channel” for the Receiver Business System on the very right. Then click the “Create”-icon (3rd icon) to start the Communication Channel Wizard.
14/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
o
Press “continue”, then make sure that our template idoc_outbound_receiver is chosen, and then press “continue”. Now give the Communication Channel a new unique name, so that it does not collide with other configuration objects, after that click “finish” and then “close”.
o
Finish the configuration of the connections by pressing “Apply”.
4. Generate: Generate all the needed agreements automatically and finish the wizard: o o o o
Change the general settings to “Generation” (no simulation), press “Start”. Quickly check the log, if there are any errors. Close the log without saving, Close the Integration Scenario Configurator and choose “Apply”.
If you have later changed the Integration Scenario in the XI Integration Repository and you want to update the existing Configuration Scenario, then you can also start the Integration Scenario Configurator manually: Open your Configuration Scenario with a double click Switch to the Edit Mode Choose “Configuration Scenario” “Integration Scenario Configurator” To update the scenario, choose “Settings” “Integration Scenario from the Integration Repository” “Update”. Go on with the configuration steps and generate the new configuration.
6.4
Finish the configuration manually
With the wizard we have already created all the needed XI objects, now we need to configure the connection between the external http IDOC receiver and XI. Finish Configuration in XI Integration Directory: Add the connection details into the previously created Receiver Communication Channel: Open CS_ccReceiveMaterialMaster Service Without Party Business System CC_CRM CommChannel idoc_outbound_receiver. Switch into the edit mode and enter the following data: o Target host: Host of http server o Service number: Port of http server o Path: Path of http service To access the internet: o Proxy Host: 155.56.68.229 o Proxy Port: 8080 o Authentication data if necessary 15/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
To finish the configuration in XI Integration Directory, save and activate all the changes done before.
6.5
Check the IDOC communication
That’s it! Now you should be able to send MATMAS01 IDOCs from the SAP backend system to the external IDOC server via http. Send MATMAS01 IDOC: In the CE8 system, choose transaction BD10 Enter Material (e.g. T-22212) and your logical system (e.g. CC_CRM) Execute with F8
16/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Check message in Integration Server Monitoring In NX7 system, open “Monitoring” “Integration Engine Monitoring” Open the Monitor for processed XML Messages Enter appropriate selection criteria, e.g. Receiver-Service = CC_CRM and execute with F8 Check the status of your message. With a doubleclick on the line you can inspect the details. Sample Request from SAP:
POST /?msgguid=F0D38FDC18C5BA4E977FC5DEE169F3EE&service=SAP_CE8&namespace=urn%3asapcom%3adocument%3asap%3aidoc%3amessages&interface=MATMAS%2eMATMAS01&qos=EO HTTP/1.0 content-type: text/xml content-length: 25524 connection: close accept: */* user-agent: SAP Web Application Server (1.0;640) host: P105077:123 accept-encoding: gzip
[…]
The unique message ID (GUID) can be found in the http header: msgguid=F0D38FDC18C5BA4E977FC5DEE169F3EE
Sample Response:
HTTP/1.1 200 Ok Content-Type: text/xml; charset=utf-8 Content-Length: 0
Congratulations! You have successfully created certifiable content and tested the communication. Now all you have to do is fill out the Technical Profile questionnaire and complete the Configuration Guide document. Then you are ready for a certification test drive. Please make sure to read more information on the configuration in chapters 11 and 12.
17/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
7 XI Content for asynchronous IDOC Inbound In the following chapter we will configure the XI system, so that we can send MATFET messages from the external system CC_CRM to the CE8 system through XI using the SAP IDOC and HTTP Adapter. These messages are sent to SAP using the IDOC type ALEREQ01. We only focus on the XI customizing, not the ALE customizing in the CE8. You can find the complete configuration in our XI system, so it should be easy to copy it using different external systems and IDOCs. As a prerequisite you should have completed chapters 3-5.
7.1
Check the customizing in the SAP backend system
Prepare ALE customizing: In the CE8 system, prepare the ALE customizing so that ALEREQ01-IDOCs can be received from the logical system CC_CRM. This name must match with the logical system name of the external Business System created in chapter 3. You also need to know the central logical system of the server (the receiving SAP system). In our case this is CE8CLNT850. The scenario is as follows: Inbound ALEREQ01: CC_CRM CE8CLNT850
7.2
Create the Repository Objects for the IDOC Inbound Scenario
Open the Integration Builder, from there jump into the Integration Repository. Important: Every change in the Integration Repository must be committed in a second step. So before you leave, you should make sure to jump to the “Change Lists”-Tab, rightclick on your change list and choose “Activate”. Import ALEREQ01 message data: Since the external system already understands the ALEREQ01 message format, we only need to import one message type into the XI system. We also don’t need any mapping. We import the message type into our Software Component Version. Open your Software Component Version CCVENDOR_CRM, 1.0 of ccvendor.com “Imported Objects” Rightclick on “IDOCs” and choose “Import” Enter data: Application Server: cpce801 System Number: 75 your CE8-user and password Choose the IDOCs you want to import, in our case it’s MATFET.ALEREQ01, then “Continue”. Choose “Finish”, then “Close” after the successful import. Create Communication Channel Templates: The communication channels serve as the technical endpoints to the connected systems. Since we already know, that the SAP receiver is connected via IDOC and the sending external system is connected via http, we can create the templates for these endpoints now. This makes the configuration of the integration scenario later easier. For IDOC inbound, we only need a receiver communication channel: Open your namespace “Adapter Objects” and rightclick on “Comm Channel Templates”, choose “New” Enter a name for the IDOC receiver: idoc_inbound_receiver and enter a meaningful description. Choose “Adapter Type” = “Idoc”, save, then choose “Receiver”-type. That’s it, the details of the connection are usually defined later during the configuration and are therefore not part of the static XI Content. Save. 18/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Don’t forget the descriptions and the documentation! For all objects, you should always add a meaningful text in the field “Description” and also provide some further documentation, by clicking on
in the menu of the XI Content object:
1. Press here to show the documentation panel
2. Press here to add documentation
Create the Integration Scenario: Open your namespace “Integration Scenarios…” and rightclick on “Integration Scenarios”, choose “New” Enter a name and description: IS_SendMaterialRequest and choose “Create”. Create a graphical representation of the SAP system by rightclicking into the first grey column. The text “Insert Application Component” should appear, choose this one. o o o
Application Component Type = Product Version, title = SAP R/3 ENTERPRISE 47X110 Role – Name = SAP_System Choose “Apply”
19/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Create a graphical representation of the external system by rightclicking into the second grey column. Choose “Insert Application Component”. o o o
Application Component Type = Product Version, title = ccCRM, 10. of ccvendor.com (our external product, created previously in the SLD) Role – Name = External_CRM_System Choose “Apply”
Don’t forget to enter some documentation of your Integration Scenario. It’s no bad idea to describe the scenario quite detailed here. Save.
Create action to send the MATFET message from the External_CRM_System Still in the edit mode of your Integration Scenario, rightclick into the External_CRM_System column and choose “Create Action” On the next popup we have to choose “Internal”, since the External_CRM_System contains our own Software Component CCVENDOR_CRM. Enter the name “SendMatfet” and press “Finish”, then “Close” You can now find a window with the details of the action, switch to the change mode here. Since we want to send a message, we need to add a line to the “Outbound Interfaces”. In the outbound-table, click on the +-icon and choose ObjectType = IDOC Click on the 7th icon of the table (“Display input help”) and choose the ALEREQ01 from your Software Component CCVENDOR_CRM. Enter a meaningful description and documentation Save and close the created action
20/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Create action to receive the MATFET message in the SAP_System Still in the edit mode of your Integration Scenario, rightclick into the SAP_System column and choose “Create Action” On the next popup we have to choose “External”, since from the view of our Software Component “CCVENDOR_CRM” SAP is the Partner Software Component. Enter the name “ReceiveMatfet” and press “Finish”, then “Close” You can now find a window with the details of the action, switch to the change mode here. In the SAP_System, we want to receive the MATFET message, so we need to add a line to the “Inbound Interfaces”. In the inbound-table, click on the +-icon and choose ObjectType = IDOC Click on the 7th icon (“Display input help”) and choose the ALEREQ01 from your Software Component CCVENDOR_CRM. Enter a meaningful description and documentation Save and close the created action
Create connection for message flow between the previously created actions Still in the edit mode of your Integration Scenario, check the location of the two created actions. To get an asynchronous IDOC-connection, it’s necessary that the receiving action is “below” the sending action. Make sure to move the “ReceiveMatfet”-box accordingly:
Rightclick the action “SendMatfet” and choose “Define as Start Action”. Rightclick the action “ReceiveMatfet” and choose “Def. as End Action”
Mark both actions by holding the shift-key, rightclick and choose “Create Connection …”. In the following popup, make sure that both checkboxes “MATFET.ALEREQ01” are marked. You can also see that the communication is asynchronous:
21/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Go to the “Assign Comm Channel Template” tab and assign the previously created template idoc_inbound_receiver in the receiver part. You can use the F4-help-icon in the “Name”-field to find the channel template in our Software Component CCVENDOR_CRM. Leave the sender part empty, as we don’t need to create a communication channel there:
Choose apply then save the Integration Scenario
Check the consistency of the scenario by choosing “Component View” “Check Configurability”. You should only receive warning messages like: “Check Result for Object IS_SendMaterialRequest Component View IS_SendMaterialRequest: Connection from Action to request Material Master Data from SAP to Action to receive the Material Master Request has no mapping” Activate all your changes (check chapter 5 about how to activate).
That’s it. With these simple steps you have created the certifiable content for the IDOC inbound scenario completely. If there are further communication steps involved in your scenario (other IDOCs or RFCs), you should add them directly into the already defined Integration Scenario. For a better overview, in our tutorial we will generate a separate Integration Scenario for each communication method.
22/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
Export the Repository Content: After you have finished the creation of all the XI Content Objects, you can export the content so that it can be easily implemented at your customers site. Just choose “Tools Export Design Objects”, select the Software Component Version “CCVENDOR_CRM, 1.0” and export the objects that belong to your content that should be certified (usually “all objects of your Software Component Version”).
Note: When you are ready for a certification test drive, please provide us the export path with the name of your XI content and the exported SLD content zip file (see chapter 3).
7.3
Create the Configuration Scenario in XI Integration Directory
In the next step, we want to configure our Integration Scenario in the XI Integration Directory, so that it fits into our existing landscape with an external IDOC client and the CE8 SAP system. After that, we want to test the communication. Since the system landscape is different for each customer, it’s not necessary to export the Integration Directory Content. For certifiable XI Content it must be possible, to configure it automatically with the Integration Scenario Configurator. So we will also check, if this works as expected. Open the Integration Builder, from there jump into the Integration Directory. Important: Every change in the Integration Directory must be committed in a second step. So before you leave, you should make sure to jump to the “Change Lists”-Tab, rightclick on your change list and choose “Activate”. Clear SLD cache: To have a consistent start, you should clear the SLD cache with “Environment” Cache”.
“Clear SLD Data
Import the Integration Scenario: In the first step, we copy the Integration Scenario created in the XI Integration Repository into a Configuration Scenario. Choose “Tools” “Transfer Integration Scenario from the Integration Repository” and use the F4-help-icon to find your Integration Scenario IS_SendMaterialRequest in your Software Component Version. Click “Continue” The scenario is copied into a Configuration Scenario and you should change the name, e.g. into CS_ccSendMaterialRequest (“CS” is ConfiguationScenario). You can also add your company name or initials as a prefix, so that you can find it later easily. Click “Finish” and “Close”. This automatically starts the:
Integration Scenario Configurator: In this step we have to assign Services to our two Application Components “SAP_System” and “External _CRM_System” of our Integration Scenario. These services are the physically existent Business Systems “CC_CRM” and “SAP_CE8” that we have created in the System Landscape Directory in chapter 3. We can start directly with step 2: 2. Assign Services: This is where we have to assign the Business Systems: o o
In the popup, use the arrow icons on the top to choose Role = SAP_System. Click on the “+”-icon of the table below and choose the F4-Help to find the Business System SAP_CE8.
23/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
o o o
o
o
Now use the arrow icons on the top to choose Role = External_CRM_System. Click on the “Create”-icon of the table below (4th icon) and choose 2 times “Continue” Look for your Business System CC_CRM. If it’s not available here, then it has been already created, click “Cancel”. If it’s available, then choose it, deselect the “Create Communication Channels Automatically” (Important!) and choose “Finish”, then “Close” If not yet assigned, click on the “+”-icon of the table below and choose the F4-Help to find the Business System CC_CRM.
Click on “Assign”.
3. Configure Connections: This is where we have to assign the Communication Channels: o
o o o
o
In the popup, use the arrow icons on the top to choose the Communication Step you want to configure. Since we only have one step in our Integration Scenario, this is chosen automatically. In the table below, click into the field “Communication Channel” for the Receiver Business System on the very right. Then click the “Create”-icon (3rd icon) to start the Communication Channel Wizard. Press “continue”, then make sure that our template idoc_inbound_receiver is chosen, and then press “continue”. Now give the Communication Channel a new unique name, so that it does not collide with other configuration objects, after that click “finish” and then “close”.
Finish the configuration of the connections by pressing “Apply”. 24/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
4. Generate: Generate all the needed agreements automatically and finish the wizard: o o o o
Change the general settings to “Generation” (no simulation), press “Start”. Quickly check the log, if there are any errors. Close the log without saving, Close the Integration Scenario Configurator and choose “Apply”.
If you have later changed the Integration Scenario in the XI Integration Repository and you want to update the existing Configuration Scenario, then you can also start the Integration Scenario Configurator manually: Open your Configuration Scenario with a double click Switch to the Edit Mode Choose “Configuration Scenario” “Integration Scenario Configurator” To update the scenario, choose “Settings” “Integration Scenario from the Integration Repository” “Update”. Go on with the configuration steps and generate the new configuration.
7.4
Finish the configuration manually
With the wizard we have already created all the needed XI objects, now we need to configure the connection between XI and the SAP Backend System CE8 in the communication channel. After that, the external http IDOC client can be started and send messages to XI. Finish Configuration in XI Integration Directory: Add the connection details into the previously created Receiver Communication Channel: Open CS_ccSendMaterialRequest Service Without Party Business System SAP_CE8 CommChannel idoc_inbound_receiver. Switch into the edit mode and enter the following data: RFC Destination: We already have an RFC Destination pointing to CE8 system (check chapter 4), so we can enter this name: CC_DEST_CE8. Interface Version: Release 4.0 or Higher (CE8 is Enterprise 4.7) SAP Release: 470. Port: Here you have to enter your own created port according chapter 4.2, i.e. CC_CRM.
To finish the configuration in XI Integration Directory, save and activate all the changes done before.
25/59
How to configure SAP XI/PI to use the standard SAP communication APIs (idoc, bapi, rfc, ES) from external systems ____________________________________________________________________________________________
7.5
Check the IDOC communication
That’s it! Now you should be able to send MATFET messages from an external HTTP client to the SAP backend system. If you have also implemented chapter 6, then the SAP system will process the MATFET message, and if the requested material can be found, it generates a MATMAS message and sends that back through the XI system to your external HTTP server. Get the port number for http-requests In the NX7 system, go to the ICM Monitor (transaction SMICM) In the menu, choose “Goto” “Services” Find the http port number, for NX7 system this is 80. Post the request to iccpi7.sap.com Check message in Integration Server Monitoring In NX7 system, open “Monitoring” “Integration Engine Monitoring” Open the Monitor for processed XML Messages Enter appropriate selection criteria and execute with F8 Check the status of your message. With a doubleclick on the flag you can inspect the details.
Sample Request: Below you can see the path to post the request to. The information about service, namespace and interface can be taken from the matching Interface Determination, Sender part: It’s not necessary to fill the IDOC Control Record EDI_DC40. This is done by XI according to the configuration in the Integration Directory.
POST /sap/xi/adapter_plain?service=CC_CRM&namespace=urn%3asapcom%3adocument%3asap%3aidoc%3amessages&interface=MATFET%2eALEREQ01&qos=EO HTTP/1.0 Content-type: text/xml; charset=utf-8 Host: localhost Authorization: Basic Accept: */* MATMAS MATMAS MATNR I EQ P-101