Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
14,398


Summary:

This document provides step by step guidance on how to implement a process flow to merge files using SAP NetWeaver BPM.

Contents

1       Interface Description.

2       Prerequisites

3       SAP PI I-Flows

4       Integration Design Configurations

       4.1       Data types

       4.2       Message Types

       4.3       Service Interfaces

       4.4       Message Mappings

       4.5       Operation Mappings

5       Integration Flow Configurations

       5.1       Integration Flow from NWPI to NWBPM for File 1

       5.2       Integration Flow from NWPI to NWBPM for File 2

       5.3       Integration Flow from NWBPM to NWPI for Final Merged file

6       Integration Process Flow

       6.1       Process Diagram

       6.2       Process Steps Definition

7       Testing the Scenario

8       Monitoring

9       References

 

1       Interface Description

We will develop a scenario which will merge 2 simple emp files containing employee details and his company information in 2 separate files. These two files are merged into single file. The whole process in done using NWBPM

Input File 1:

EmpID: String

EmpName: String

Place: String

Input File 2:

EmpID: String

Company: String

DOJ: String

2     Prerequisites

  1. Check for proper connection is established between NWDS and PI Enterprise Service Repository (Window-->Preferences-->Web-services-->Enterprise Service Browser).

 

  1. Check for a proper connection is established between NWDS and Integration Directory (Windows-->Preferences-->PI Tools Configuration-->Connections).

  1. Check proper PO system details are provided to deploy the NWBPM process component in PO (Windows-->Preferences-->SAP AS Java)

 

3       SAP PI I-Flows

For this scenario, we need 3 integration flows.

  1.    Integration flow for file1 from SAPPI to NWBPM (Input File1)

            This is used to process employee file1 details and send this data to NWBPM

  2.    Integration flow for file2 from SAP PI to NWBPM (Input File2)

             This is used to process employee file1 details and send this data to NWBPM

  3.   Integration flow from NWBPM to SAP PI (Output File after Merging)

               This flow is for sending the merged file from NWBPM to NWPI.

4       Integration Design Configurations

       

4.1    Data types

  Create Data type for File 1 

                          

Create Data type for File 2

                

               

Create Data type for Super Data Type

                         

     Create Data type for Output file

               

                             

4.2     Message Types

      Create Message type for File1

                          

    

Create Message type for File2

                         

     Create Message type for Super Data type (DT_Super_Emp)

                        

    

       Create Message type for Output

                         

4.3     Service Interfaces

      Create Service interface for File1 with Category as “Outbound”

       

                     

      Create Service interface for File2 with Category as “Outbound”

          

                      

Create Service interface for Super Message type which will trigger the NWBPM.

        Make sure the Interface pattern is “Stateless (XI30-Compatible)”.

        For category we can either use “Inbound” or “Abstract”. Here I am using Abstract for the service     interfaces which are used in BPM to avoid the confusion.

              

                     

           

   Create abstract service interface for the output file after merge from BPM. Select the interface pattern to “Stateless (XI30-Compatible)”.

                     

      Create an inbound service interface which is used at the final integration flow from NWBPM to NWPI.

                     

4.4     Message Mappings

             Create message mapping for the input message type (For File1) to Super Message type and map the correlation ID.

Note: Here in this mapping only File 1 details are mapped and also we need to map the CorrelationID with the EmpID.

                    

                    

Create message mapping for the input message type (For File2) to Super Message type and map the correlation ID.

PS: Here in this mapping only File 2 details are mapped and also we need to map the CorrelationID with the EmpID.

                   

                 

4.5     Operation Mappings

                Create Operation mapping for the Outbound Service interface (For File1) to Super service interface. This will send file1 details to NWBPM.

         

                    

Create Operation mapping for the Outbound Service interface (For File2) to Super service interface. This will send file2 details to NWBPM 

                     

Now we are done with ESR part.

5       Integration Flow Configurations

5.1     Integration Flow from NWPI to NWBPM for File 1

                       The below details are configured for this integration flow. This will send file1 details to NWBPM.

Sender Component: BS_Sender

Sender Interface: SI_Emp_File1

Receiver Component: NWBPM

Receiver Interface: SI_Super_Emp_Abs

Operation Mapping: OM_Emp_File1

Configure sender file channel with FILE adapter and receiver channel with SOAP adapter.

Provide the below URL for Target URL and use logon data to non-SAP system.

http://servername:port/MessagingSystem/receive/JPR/XI

Use “X1 3.0” for Message Protocol for receiver SOAP channel.

       

            

5.2     Integration Flow from NWPI to NWBPM for File 2

                The below details are configured for this integration flow. This will send file2 details to NWBPM.

Sender Component: BS_Sender

Sender Interface: SI_Emp_File2

Receiver Component: NWBPM

Receiver Interface: SI_Super_Emp_Abs

Operation Mapping: OM_Emp_File2

Configure sender file channel with FILE adapter and receiver channel with SOAP adapter.

Provide the below URL for Target URL and use logon data to non-SAP system.

http://servername:port/MessagingSystem/receive/JPR/XI

Use “X1 3.0” for Message Protocol for SOAP receiver channel

5.3     Integration Flow from NWBPM to NWPI for Final Merged file

                    The below details are configured for this integration flow. This will send merged file from BPM to PI.

Sender Component: NWBPM

Sender Interface: SI_Emp_Output_Abs

Receiver Component: BC_Receiver

Receiver Interface: SI_Emp_Output

Configure receiver file channel with FILE adapter and sender channel with SOAP adapter.

Use “X1 3.0” for Message Protocol for sender SOAP channel.

6       Integration Process Flow

6.1     Process Diagram

                     The below process flow is designed for our scenario.

               

6.2     Process Steps Definition

Please note here I am explaining the properties of the steps which I have used for the process flow.

For detailed explanation of to create process component, please refer William’s Lee article

                 To start working on the process flow, first need to import the service interfaces from ESR to Composite Designer. And also need to create service groups for the service interfaces.

                    

The below service interfaces are imported from ESR to BPM component.

           SI_Emp_Output_Abs

           SI_Super_Emp_Abs

                                 

   Here 2 data objects “IncomingMesg” and “OutgoingMesg” are allocated with input and output data types.

        

           

START STEP:

                   

Create trigger with super service interface (SI_Super_Emp_Abs)

The message which is received by Start trigger is mapped to the data object “IncomingMesg”.

Please note each time only one message is received, either EMP File1is received or EMP File 2 is received.

EXCLUSIVE CHOICE: (Check if File1 or File2)

  For defining the condition for “No”, use the standard function which is available within the BPM. “isSet” function will check if the field is filled with value or not? As we are receiving only one message at a time from Incoming message we need to evaluate if the received message is for file1 or for file2. So based on the condition Yes, it will map for file1 and the condition is not satisfied by default it will map for file2.

MAPPING STEP: (Used for both File1 and File2)

   So now based on the condition we now know that for what message is received. So do the mapping from IncomingMesg—File1 to OutgoingMesg—File1

Like above do the same for File2 mapping.

EXCLUSIVE CHOICE: (Check if both files are received)

Now we need to check if both file1 and file2 are received. If yes then the output is send to NWPI and if No, need to wait for the next message. To check if both messages are received, I am comparing the EmpID’s of both the files. If both of them are equal we can send to “Automated activity -- OutputFile” else “Intermediate Message Event” will trigger.

Automated Activity: (OutputFile)

For this step, select final service interface which is sent out from BPM (SI_Emp_Output_Abs)

Click on Service reference and provide the “XI” for the Type and give the Sender Component.

Now map the “OutgoingMesg” details to Final output message type.

So the final output structure is having both the file contents in a single file.

Intermediate Message: (Wait for File)

For trigger, need to select the same trigger which is used in Start Event.

The same mapping what we have used in Start step is done here. Map the received message to the data object “IncomingMesg”.

Now we need to define the correlation to ensure the incoming messages are assocaited with the right process instance.

Now we are done with all the steps. Build and deploy the process.

7       Testing the Scenario

        The below files are used for testing

                                    

File 1:

File2:

Output File.

8       Monitoring

You can monitor the message flows in Adapter engine message monitoring.

Monitoring -- ProcessTasks--Manage Process

If we want to check the data, select “Context Data” and select the data object and you can view the data present in the data variable.

9 References

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90308598-4b8d-2f10-4a9a-b78973859...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60bf80bb-736f-2f10-4593-a57a6ccb0...

http://scn.sap.com/docs/DOC-27342

8 Comments
0 Kudos

Very usefull Leela. Thanks for sharing.

-- Naren

Former Member
0 Kudos

Very descriptive Leela.Any body can understand your doc easily. :smile:

--Venkat

Former Member
0 Kudos

Hi Leela,

I am getting a communication error between SAP PI AEX and BPM components I followed exact steps as you/bill provided above any idea on below error?

Thanks

Jake

Delivery of the message to the application using connection JPR failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing inbound message. FaultException: com.sap.aii.proxy.xiruntime.core.ESPXISystemFaultException: Error encountered during processing of XI request message in inbound ESP; Hint: com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException: Unexpected uriID '/{urn:http://xyz.com/xi/XIMapping/mergebpmpoc}SI_Super_Emp_Abs'. Found: BindingData 'null', interfaceMapping 'null' interfaceDefinition 'null'

0 Kudos

Hi Leela,

Thanks for a descriptive blog.

Quick question:

The scenario shown here is for input files having 1..1 row. I am trying a scenario where input files have multiple rows.

  • I am unable to find a way to modify the above approach to fit multiple rows
  • Is there a way to leverage a standard pattern?

I think we can write a EJB custom function and use it in BPM. But, i am trying to avoid this route. 🙂

Thanks,

Sai

binod8
Active Participant
0 Kudos

Hi,

I am also getting the same error.

Would you please suggest how did you resolve this?

Thanks,

Binod

Former Member
0 Kudos
Hi Team ,

I configured the same scneario . Facing the mentioned error. Can anyone help on this.

 



 

 
0 Kudos
Thank u very much.. really its a very clear Explanation.
former_member202642
Participant
0 Kudos
Hi,

I am not able to add output of "File 2" to Merge.

Please explain how to do this.

Thanks,

Aamir
Labels in this area