Skip to Content

The integration aspect of a LEGACY Product with SAP   always involved lot of technical challenges with respect to planning, analysis, architecting, business scenario selection, implementation approach; validation of approach. The experience obtained from a project involving SAP PI and Legacy built on C and C++ for inventory analysis is being shared. We have selected Forecasting and Replenishment scenario used for inventory analysis for integrating SAP R/3, and Legacy application using SAP PI as middleware.  

Business scenarios for integration:-

The following 2 business scenarios have been identified for integration:-

  • Forecasting Scenario – customer demand data, represented as date-wise requirements for any SKU in the sales orders, flows from SAP to LEGACY. The scope of this data transfer can be limited by a number of selection parameters for the SKUs that would be considered. After forecasting run LEGACY will provide the forecasts for each SKU in scope, as a time series data. This data will flow from LEGACY to SAP.
  • Optimizing replenishment Parameters – customer demand data and planning relevant material master data from SAP flows to LEGACY. As before, scope of this data transfer can be limited. After an optimizing run, LEGACY recalculates replenishment parameters for these SKUs. These flow back to SAP to update the material master of these SKUs in SAP.

 

Technical imperative

 

1. The business scenarios that are in scope are pertaining to planning runs and are not transactions that involve flow of materials. As such, system response time is not a critical factor for design considerations. In fact, in many of the actual usages, LEGACY run can be scheduled to run as a batch job.  

2. Nice to be synchronous, asynchronous is ok

3.  User will only run a transaction in SAP and would expect a notification confirming the completion of the activity

4. A. for forecast -high bi-directional data volume

    B. for replenishment – high data from SAP, but low volume from LEGACY

5. Run frequency – mostly monthly, at the most weekly

Approach – In order to achieve the above goals, Technical solutions were considered as follows

A)    Synchronous communication between SAP and LEGACY via PI using SOAP messages.

  • Pros
  • Synchronous , real-time
  • Cons
  • Resource intensive
  • Large volume of data would require additional HW

 

B)    Asynchronous communication between SAP and LEGACY via PI using XML messages ( two approach)

  • Pros
  • Less resource intensive
  • Cons
  • Large volume of data passing through PI would require additional HW

 

C)    Asynchronous communication between SAP and LEGACY using intermediate storage (file system) and exchanging reference of the data location via PI

  • Pros
  • Less resource intensive
  • Since only nominal control data is passed via PI , no additional HW is required
  • Using file system as the intermediate storage does not require additional database etc
  • Cons
  • Introduction of point-to-point connection weakens the connection via middleware semantics

The details of the individual options and the business scenarios are given below.

Details of Integration Approaches:

Option: A

Synchronous communication between SAP and LEGACY via PI using SOAP messages

INT1 

  • SAP R/3 program will extract relevant data required for LEGACY.

 

  • After extraction of data from SAP R/3, SAP R/3 will trigger one RFC(Remote Function call). Output of this RFC will contain all required data applicable for LEGACY. This RFC will provide the data of the control file required for LEGACY also.

 

  • This RFC will trigger one interface in SAP PI. SAP PI will get all the output of this RFC by RFC adapter or ABAP Proxy and internally convert into XML format.

 

  • SAP PI will map these data into the specific format required by LEGACY. That will be done by mapping in SAP PI. Web service application of LEGACY will generate a WSDL file which contains the data type required for LEGACY.

 

  • SAP PI will send this SOAP message to LEGACY by SOAP adapter of SAP PI. LEGACY should read this SOAP message.

 

  • LEGACY will read the SOAP message sent by SAP PI. LEGACY will do the calculation in its own environment and produce some result.

 

  • After this operation, LEGACY will send the SOAP message to SAP PI. This SOAP message contains the information generated by LEGACY.

 

  • SAP PI will read the SOAP message by SOAP adapter. It will trigger an interface in SAP PI. Using the RFC adapter SAP PI will send the message to SAP R/3 and trigger a process in SAP R/3 which will take this as input and update SAP R/3 Database.

 

 

Option: B (1)

 

Asynchronous communication between SAP and LEGACY via PI using XML messages (XML File)

int11

  • SAP R/3 program will extract relevant data required for LEGACY.

 

  •  After extraction of data from SAP R/3, SAP R/3 will trigger one RFC. Output of this RFC will contain all required data applicable for LEGACY. This RFC will provide the data of the control file required for LEGACY also.

 

  • This RFC will trigger one interface in SAP PI. SAP PI will get all the output of this RFC by RFC adapter or ABAP Proxy and internally convert into XML format.

 

  • SAP PI will map these data into the specific format required by LEGACY. That will be done by mapping in SAP PI. After that SAP PI will generate one XML file in the specified location where LEGACY is running. SAP PI will generate the File by FILE Adepter (Receiver) of SAP PI.

 

  • LEGACY will read the XML file sent by SAP PI. LEGACY will do the calculation in its own environment and produce some result. LEGACY will also generate an XML file with the produced result.

 

  • SAP PI will read the XML file by File Adapter. It will trigger an interface in SAP PI. Using the RFC adapter SAP PI will send the File’s data to SAP R/3 and trigger a process in SAP R/3 which will take this information as input and update SAP R/3 Database. This process will also send notification to SAP user that the results have been updated in SAP R/3.

 

Option: B (2)

 

Asynchronous communication between SAP and LEGACY via PI using XML messages ( Updating LEGACY system’s Database )

  • SAP R/3 program will extract relevant data required for LEGACY.

 

  • After extraction of data from SAP R/3, SAP R/3 will trigger one RFC. Output of this RFC will contain all required data applicable for LEGACY. This RFC will provide the data of the control file required for LEGACY also.

 

  • This RFC will trigger one interface in SAP PI. SAP PI will get all the output of this RFC by RFC adapter or ABAP Proxy and internally convert into XML format.

 

  • SAP PI will map these data into the specific format required by LEGACY. That will be done by mapping in SAP PI. After that SAP PI will update these records in the underlying RDBMS database of LEGACY by using SAP PI JDBC adapter.

 

  • LEGACY will read the data from its own database and do processing. LEGACY will also insert the results into its database.

 

  • SAP PI will read data from RDBMS database by JDBC Adapter. It will trigger an interface in SAP PI. Using the RFC adapter SAP PI will send the File’s data to SAP R/3 and trigger a process in SAP R/3 which will take this information as input and update SAP R/3 Database. This process will also send notification to SAP user that the results have been updated in SAP R/3.

Option: C

Asynchronous communication between SAP and LEGACY using intermediate storage (file system) and exchanging reference of the data location via PI

INT2 

  • SAP R/3 program will extract relevant data required for LEGACY. ( custom development in SAP ERP required)

 

  • SAP R/3 program will generate a file into the file server( the application server of SAP can be used). This file will contain the data extracted from SAP.

 

  • After that SAP R/3 will trigger one RFC. This RFC function module will trigger the SAP PI interface. In this case we will use RFC Adapter or ABAP Proxy to get the information of SAP R/3 to SAP PI.

 

  • The PI message will contain the data of the control file required for LEGACY , Location of File Server and Name of the file just saved in the previous steps.

 

  • SAP PI will map these data into the specific format required by LEGACY. That will be done by mapping in SAP PI. Web service application of LEGACY will generate a WSDL file which contains the data type required for LEGACY.

 

  • SAP PI will send this SOAP message to LEGACY by SOAP adapter of SAP PI. LEGACY should read this SOAP message.

 

  • LEGACY will read the SOAP message sent by SAP PI. After that LEGACY will read the file from the file server.

 

  • LEGACY will do the calculation in its own environment and produce some result. After producing the results LEGACY will generate a new file and put into the file server. If possible LEGACY should delete/archive the SAP generated file on which it acted.

 

  • After this operation, LEGACY will send the SOAP message to SAP PI. This SOAP message contains the information regarding the File Name and File Server Location. ( if the deletion stated above is not possible by LEGACY , the SAP generated file reference should also be in the message passed back from LEGACY)

 

  • SAP PI will read the SOAP message by SOAP adapter. It will trigger an interface in SAP PI. Using the RFC adapter SAP PI will send the message to SAP R/3. SAP R/3 will read the data of the File created by LEGACY in the File Server and update the SAP R/3 database with required information. This process will also send notification to SAP user that the results have been updated in SAP R/3. After successful processing Sap will delete/archive the file created by LEGACY( if LEGACY could not delete SAP-generated file , then SAP will delete it)

There can be lot many ways to integrate  i have just tried from my observation and experience to illustrate few which may help in such type of integration.

To report this post you need to login first.

3 Comments

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

Leave a Reply