Skip to Content

How to use system events to communicate XI and R3.

SUMMARY

This document shows how to create and trigger events.

This scenario makes a collect of xml files and transforms it in an inbound  Idoc (ZTUR_ATR_IN) to SAP. Some xml files are stored in a FTP folder. Then the interface is triggered when the xml file arrived to the FTP dir. Later, the files go to  BPM and the files are collected. After that those files are transformed in an Idoc. This Idoc is uploaded to SAP I-SU System.

The really trouble is that the Idoc need be executed manually from the transaction BD20. Then you need to implements how to trigger this transaction automatically.

To do this process you need from the BPM XI a last step to call to the BAPI. This BAPI will start the event in Sap R3. When the event is running, it will trigger a Job that you use to call a variant of the program BD20.

By:  José Antonio Roldán Luna

 

CONTENTS

  1. 1. SAP R3
  1. a. Create the variant of BD20.
  2. b. Create the system event.
  3. c. Create the Job.
  1. 2. XI Integration Repository (Design)
  1. a. Import the RFC to call the BAPI that send the event.
  2. b. Create a message to reference the BAPI that have sent the event.
  3. c. Add values to the BAPI message that have been sent the event.
  4. d. Updates the BPM append the BAPI that have sent the event.
  1. 3. XI Integration Directory (Configuration)
  1. a. Create objects to call the RFC.
  1. 4. Test

REFERENCES

  • “Working SAP Events” SAP guide.

http://help.sap.com/saphelp_nw2004s/helpdata/en/44/c079599d3756a2e10000000a1553f6/frameset.htm

  • Another example to use events

http://searchsap.techtarget.com/tip/0,289483,sid21_gci1253243,00.html

  • Sap Library BPM step types.

http://help.sap.com/saphelp_nwpi71/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/frameset.htm

 

  1. 1. SAP R3
  1. a. Create the variant of BD20.

To create a variant of the transaction BD20 you have to use the transaction SE38. In the field Program write the program name RBDAPP01, and click into Variants


ScreenHunter_139 Feb. 06 13.14.jpg

In the next screen, write the name of the variant (f.e. TRANSIDOC_ATR).


ScreenHunter_139 Feb. 06 13.16.jpg

Now, click on Continue.


ScreenHunter_139 Feb. 06 13.22.jpg

In the next screen, you need to configure the variant. In the picture below you can see the values for this case.

In Message type write a concrete Idoc type, in this case ZMTUR_ATR_IN. After write the values click into Variant Attributes

ScreenHunter_140 Feb. 06 13.22.jpg

In the next screen, you can select a list of values and you can take the values of the picture below.


ScreenHunter_140 Feb. 06 13.23.jpg

And click to save.

  1. b. Create the system event.

To create the system event you need to execute  the transaction SM64 and click on Create.

The checkbox System needs be selected.


ScreenHunter_141 Feb. 06 13.23.jpg

  1. c. Create the Job.

To create the Job you need use the transaction SM36.

Write the Job name and  click on Start Condition.

ScreenHunter_141 Feb. 06 13.24.jpg

In Start Condition menu click on After event and select the event that have been created before. And save.


ScreenHunter_142 Feb. 06 13.24.jpg

To continue with the configuration of the Job click on Step

In the next step, you need to link the Variant of the program that has been created before.


ScreenHunter_142 Feb. 06 13.25.jpg

click to save.

  1. 2. XI Integration Repository (Design)
  1. a. Import the RFC to call the BAPI.

To import a RFC to call the BAPI right-click on RFC and Import of SAP Objects.


ScreenHunter_142 Feb. 06 13.26.jpg

Write the SAP server and logon to the system then click on Continue

In the next screen, select the RFC RSSM_EVENT_RAISE and click on Finish.

double-clicking on the object, you can see his structure.


ScreenHunter_142 Feb. 06 13.27.jpg

If you have problem to import the RFC, make sure that you have selected the correct SAP system. Check the Software Component Version.

ScreenHunter_143 Feb. 06 13.27.jpg

  1. b. Create a message to reference the BAPI.

To use the RFC in the BPM, you need to create a Message Interface with Abstract and Asynchronous attributes.

Right-click over Message Interfaces and click on New. Then an aux window will be displayed. you need to write the Message Interface name here.  After that choose Abstract and Asynchronous attributes. In the field Type Message Name select the RFC RSSM_EVENT_RAISE

ScreenHunter_143 Feb. 06 13.28.jpg

Now, save and activate changes.

  1. c. Add values to the BAPI message.

The next steep is to assign the values to the BAPI, so, you need to create a Message Mapping and put the name of the event.

Right-click over Message Mapping and New. Then an aux window will be displayed. You need to write the Message Mapping name here. 

You need to select the source and target structure. In this case, the source structure is ZTUR_FACTURA_ATR and the target structure is the BAPI.

ScreenHunter_144 Feb. 06 13.28.jpg

Now, double-click on I_EVENTID field and link it with a constant box with the name of the event.


ScreenHunter_145 Feb. 06 13.28.jpg

To use the Message Mapping you need to use an Interface Mapping object. Here select the source and target messages (MI) and the mapping which will be transformed.


ScreenHunter_145 Feb. 06 13.29.jpg

Now, save and activate changes.

  1. d. Update the BPM.

ScreenHunter_146 Feb. 06 13.29.jpg

In the BPM you have to join the procedure to receipt, transform and send the BAPI.

To receipt the BAPI, you need to add the Message Interface (MI) in the Container menu as shown in the the picture below.

In the BPM you need to insert a Wait step to enhance the process.


ScreenHunter_146 Feb. 06 13.30.jpg

The next step is set a transformation step. You use a transformation step to assign the previous Interface Mapping and his messages.


ScreenHunter_147 Feb. 06 13.30.jpg

The last step is send the BAPI to a Sap system.

you write the Message to send. The right configuration of the process must be created in XI Integration Directory (Configuration).

ScreenHunter_147 Feb. 06 13.31.jpg

Then, save and activate changes.

 

  1. 3. XI Integration Directory (Configuration)
  1. a. Create the object to call the RFC.

To configure the process you need to create the next objects:

  • Receiver Determination

You need a Receiver Determination to describe the process flow. In this case you use the Receiver Determination to ensure that a Message like a BAPI should be enable to use in the BPM.


ScreenHunter_148 Feb. 06 13.31.jpg

  • Interface Determination

If the message is going to be transformed, you need to create an Interface Determination. In this case is no necessary to set the Interface Mapping here, because it has been set in the BPM.


ScreenHunter_149 Feb. 06 13.31.jpg


  • Communication Channel

You need a communication channel to set the communication between XI and R3. In this case you use a receiver RFC adapter with the R3 connection parameters.


ScreenHunter_150 Feb. 06 13.32.jpg

  • Receiver Agreement

You need a Receiver Agreement to indicate which communication channel is used to send your Message.

ScreenHunter_151 Feb. 06 13.32.jpg

  1. 4. Test

To you know that the Job had been executed successfully. You can see the Jobs executed in the SM37 in Sap ISU.


ScreenHunter_151 Feb. 06 13.33.jpg

And find the Job that you test.


ScreenHunter_152 Feb. 06 13.33.jpg


Fill your boots xD !!

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply