Web Service To File Scenario In Sap Pir

What is SAP PI?

SAP PI (Process Integration) is an integration platform which provides seamless integration between SAP and non-SAP applications within the organization A2A (Application to Application) or even outside the organization B2B (Business to Business).

What is SAP PO?

SAP PI — File to File Scenario Execution. Go to software component → Right click → New. In the next window, select interface objects → data type. Step 8 − Enter the name of Data Type and Namespace and click Create as above. Next is to insert sub element into the Data Type. Step 9 − Enter the name of the element. A Web service user is called a service requester who uses the web service with the help of a web browser. In a normal scenario, a service requester is an application that access Web service. An application takes all the necessary details to access a Web service from service description and this information is maintained in the service registry.

SAP Process Orchestration is a tool to automate and optimize business processes. It combines features of SAP Business Process Management (BPM), SAP Process Integration(PI) and SAP Business Rules Management(BRM). In other words, it's more advanced version of SAP PI and has all the tools required to integrate applications.

Understanding SAP PI/PO with an Example

But this was a technical aspect of SAP PI, but to understand this better we will see the example of implementation of SAP PI.

Example: To understand the concept of SAP PI more clearly, we take an example of a large-scale Dairy Industry, which is operating in a large portion of a state and dominating the region. But there is some small-scale dairy industries operating in the same region, parallel to the large-scale industry which is not making a profit due to their price variation compare to large-scale industry. So to avoid the pricing conflict and maintaining the same price all over the region, large scale and small scale industry decide to link together, with the help of SAP PI. They interconnect with each other with the help of SAP PI and started to work as a single unit. Now, through SAP PI they are able to exchange all the information pertaining to dairy industry, including pricing and share an equal amount of profit.

SAP PI connects different platforms like

  • SAP and Non-SAP systems
  • B2B and A2A Scenarios
  • Asynchronous and Synchronous Communications
  • Cross-component business process management

In this training, we will learn

Why SAP PI/PO?

Prior to SAP PI, business would connect with each other through point-to-point communication. But this process is not used for multiple and complex processes. For smooth communication between multiple businesses, Mediated communication or Integration broker is used, and SAP PI adapts this system very well. It enables interconnection of a different process via a central location known as Integration Broker, unlike the point to point connection which is more like a spider web. The integration broker or server is an integral part of mediated communication consist of Java based Advanced Adapter Engine (AAE) and an integration engine for routing. Mediated communication is based on an integration broker which is executed by exchanging XML messages.

Let see how SAP PI handles the XML messages by the help of Integration Broker. The exchange of data or message in SAP PI occurs in this four phases.

  • Message Transformation: During message exchange, it transforms the structure of the business data
  • Message Routing: Forwarding a message sent by a sender system to one or more receiver systems
  • Connectivity Adapters: Connecting the integration broker and receiver system, the adapter will transform the incoming message into an inbound message and later convert it to the format of the receiving system at the other end
  • Integration Processes: Cross component Business Process Management (ccBPM) consists of functions for enhanced service orchestration.

How SAP PI/PO works

SAP PI performs three basic functions

  • Connect: SAP PI has an ability to integrate with all application regardless of whether it is an application from a 3rd party or from the SAP. It uses the adapter framework to integrate 3rd party solutions.
  • Co-ordinate: It can define a path/workflow for each business transaction that is integrated. It ensures that each message is correctly delivered from the source to the target destination
  • Communicate: It can translate files into any format whether an internal file format or any business to business integration standard.

SAP PI/PO Architecture

SAP PI is not a single component responsible for the integration of SAP and Non- SAP application, but it is a cluster of components that together make SAP PI functional. This architecture of SAP PI or components is used during design time, configuration time and at run time. The various components of SAP PI include

  1. System Landscape Directory: It is a central information provider in a system landscape. SLD contains two types of information, 'Component Information (Installable & Installed) and Landscape description.'
  2. Integration Builder: It is a tool-set which contains a set of tools for accessing and editing integration objects
  3. Integration Repository: To develop, design and maintain data types, message structures, mappings, interfaces, integration processes and integration scenarios independently of system landscape, integration repository is used.
  4. Integration Server: It is a central processing engine of the PI. All messages are processed using this server.
  5. Central Monitoring: With the help of this monitoring of PI domain is done, and 'workbench' is the tool that is used for monitoring.
  6. Adapter Engine: It acts as a connector to connect the integration engine to SAP systems and other systems.
  7. Message Processing Technique by PI: To access data from SAP and Non-SAP application this technique is used. SAP PI uses an intermediate document like IDoc to Flat files to transfer their data.
  8. Design: Process Integration (PI) uses integration repository to design message structure
  9. Configuration: Integration Directory (ID) is used to configure technical parameters for objects created in IR ( Integration Repository)
  10. Message Processing: Once the IDOC is activated in SAP system, PI takes in charge and convert messages into XML format for its internal processing
  11. Message Monitoring: The messages can be monitored and traced using 'Run Time Workbench'. This tool can be useful in monitoring sender and receiver adapters, Outgoing and Incoming messages, End to End monitoring of complete scenario and error traces.

Connectivity: Proxy Framework & Adapter Framework

Adapter Framework:

SAP PI connects with any external systems (SAP or Non-SAP) using the Adapter Framework. The adapter framework is based on the AS Java runtime environment and the connector architecture (JCA) version. The adapter framework consists of two default module chains if message processing is to be executed entirely within the adapter, default module chain for the adapter can be used.

  1. One for the sender direction
  2. One for the receiver direction

There are four types of Adapters used in SAP PI

  • File adapters: It exchanges files with external systems
  • JMS adapters: It communicates with a messaging system
  • SOAP adapters: It communicates with providers and clients of web services
  • JDBC adapters: It is an extended pack for SAP PI

Other interfaces supported by adapter framework are

  1. Configuration Services ( API and Adapter metadata xsd)
  2. Administration Services
  3. Various service APIs provided by Adapter framework- Thread Manager, Transaction Manager)
  4. Adapter framework includes a message audit log API. The API can be used for the technical trace and logging to write trace statements that describes the execution of the code.

How adaptor framework works?

  1. The data is received from the wire through a receive location that is listening for messages at certain protocol at a specified address
  2. After the message is received by the receive location, a message is sent to the adapter. It creates a new BizTalk message, attaches the data stream to the message.
  3. It adds any meta-data pertaining to the end-point over which the data was received and then the message is submitted to the message engine
  4. Message engine sends the message to the receive pipeline where the data is transformed into XML, here the message sender is authenticated, a message is decrypted and the XML is validated
  5. Next, the messaging engine published the message to the message box. The message box is a Microsoft SQL table containing messages to be processed
  6. The messaging engine sends the message to either the orchestration or send port.

SAP PI/PO Security

For messages, SAP PI provides the message level security for XI message protocol, for the SOAP adapter, for the RosettaNet protocol, for mail adapter, for the CIDX protocol and for connectivity with WSRM (Web Service Reliable Messaging) enabled systems. In SAP PI message level security enabled through the use of encryption, digital signature, SAML Assertion, Username token, Certificate token, etc. Authentication methods supported by WS infrastructure for transport level includes basic authentication (Password and Username), SAP assertion ticket, and HTTP over SSL.

Connecting Integration Server with WSRM (Web Service Reliable Messaging) Enabled System

To connect with WSRM enabled system you use a communication channel of adapter type WS.

  • You use a sender agreement with an assigned WS sender adapter to connect the Integration Server to a WS consumer
  • You use a receiver agreement with an assigned WS receiver adapter to connect the integration server to a WS provider

Benefits of Security in SAP PI/PO

  • Permissions of the receiver application are checked against the original user
  • In the receiver system, a user can be audited
  • Dynamic configuration at the PI receiver channel

New Features in SAP PI/PO

The new features in SAP PI include

  • Centralized monitoring based on SAP solution manager.
  • Very large (binary) file to file transfer
  • IDOC ( Intermediate Document ) and HTTP adapters in AAE (Advance Adapter Engine)
  • User Centric perspective in the ESR
  • Interface and Mapping based message split on AAE
  • Time Out configuration per communication channel
  • Automated Transport for Schema Validation
  • Replacing Trex, user-defined message search
  • User Centric perspectives in the ESR
  • Add-on for SAP PI: Secure Connectivity add-on (SGTP Adapter, PGP module) & B2B add-ons (OFTP adapter, AS2 adapter, EDI separator, EDI XML converter etc.)

Advantages of SAP PI/PO

  • In comparison to any other middleware product monitoring in SAP PI is better. It offers monitoring features like a message, performance, component monitoring and so on, all of which can be used to track and rectify the errors.
  • SAP PI supports various SAP components which are required while integrating with SAP PI
  • Adapters and mappings are good as compared with any other middleware product
  • Asynchronous and Synchronous communication is possible

SAP PI vs. BizTalk

SAP PIBizTalk
  • Mostly used only by SAP customers to enable SOAP-based integration
  • BizTalk is completely built on .Net, certified by Microsoft and SAP to Integrate with SAP directly without the need of any middleware
  • ESB product designed and implemented to integrate SAP systems with Non- SAP Systems
  • More generalized product, ability to integrate a variety of systems including SAP and other products
  • SAP PI has pre-delivered message monitoring system
  • Not available
  • SAP PI can do multiple data transfer
  • Not available
  • In SAP PI automation can be manual as well as scheduled
  • Not available
  • SAP uses net weaver portal solution
  • BizTalk uses MS SharePoint as a portal solution
  • SOA architecture paradigm for SAP is eSOA ( Enterprise Service Oriented Architecture)
  • SOA is on basis of .NET and BizTalk
  • SAP PI Base Engine is priced based on the overall processed message volume expressed in Gigabytes/month. SAP PI is free to use between SAP-to-SAP
  • MS BizTalk server is priced based on the server capacity. It has four different version Enterprise, Standard, Branch, and Developer

When SAP PI/PO is not recommended in enterprise SOA (Service Oriented Architecture)

  • SAP PI is not recommended for synchronous communication as it will put a significant load on the infrastructure service for servicing asynchronous request
  • SAP PI is not recommended for UI driven scenarios if the backend is exposed as enterprise services
  • SAP PI is not needed for intermediation if a non-SAP backend like J2EE or .NET platform is exposing business services in a UI scenario

Long term planning (Simulative MRP) is used to simulate the future demand and supply situation in all BOM levels. The main function is to check the capacity situation, material requirement and vendor ability to provide the material in desired time.

This is not an actual run but a simulative run where actual planning situation is not being affected, and we can see the capacity situation of the work centers well ahead in time. If such information is available in advance, then we can decide at an early date whether additional machines will be required to cope with capacity bottlenecks.

  • LTP (Long Term Planning) is nothing but MRP run in simulation version to simulate the production plan for the future.
  • It is possible to transfer the plan from simulative version to operative version '00'(actual planning) if through simulation it is found that all capacity and requirement can be fulfilled.
  • The purchasing department can also utilize the outcome of long-term planning. They use the information on the future requirement quantities to estimate future purchase orders. This provides them with an opportunity to negotiate delivery schedules and contracts with vendors.
  • Vendors also have an advantage from long-term planning results as they are sent a preview of future estimated purchase orders and delivery schedules.
  • Generally, Planned Independent Requirement (PIR) version can be either active or inactive. For LTP planned independent version should be inactive as it is a simulative version. Only active PIR version is being taken for operative planning (MRP).
  • Existing master data can be used for LTP. But to have a different master data (BOM and Routing) for LTP is also possible.
  • If you want to delete the Long term planning data, then you need to delete the planning scenario and you can re-run whole cycle again with new requirement again in another inactive version.
  • Long term planning data can also be utilized to transfer routing activity quantities to the respective cost centers. Controlling department can calculate activity price calculation by dividing the cost center budget value and activity quantity (calculated by LTP run) which is used for standard cost calculation.

In this tutorial- you will learn

How to Create Inactive version of Independent requirement (PIR)

Step 1) From SAP easy access, open Transaction MD61

  1. Enter material code for which requirement needs to be created
  1. Enter Plant Code.
  1. Enter version as '02' which is inactive version and requirements would be considered in Long Term planning run and not MRP.
  1. Enter the Planning horizon dates for which demand needs to be created.
  1. Enter planning period as month M.

After filling in all the fields, click or press Enter to go to the next screen.

Step 2) In this screen, we will input the requirement quantity of the material in monthly buckets.

  1. Version '02' and Active check box is unflagged which means it is an inactive/simulative requirement and would be considered in LTP run only.
  1. Enter the requirement quantity in monthly buckets.

Click to save after fill all the data, the system will show message.

How to Create Planning Scenario

Planning scenario creation is required for Long term planning run. Annual simulative requirements in the form of PIR are assigned to the planning scenario.BOM selection ID is assigned to the scenario for selection of relevant BOM in LTP run. We can also include or exclude current stock , existing planned receipts from LTP run.

Step 1) From SAP easy access screen open Transaction MS31

  1. Enter Planning scenario (numeric or alphanumeric of your choice) and give the description of the scenario.

    Press enter on the keyboard to move to next screen.

Step 2) In this screen,

  1. Enter planning periods for which LTP run needs to take place.
  1. Keep Opening stock as blank which means the current stock will not be considered in LTP run.
  1. BOM selection id '01' means active BOM will be exploded in LTP run.

Step 3) In the same screen,

Web service to file scenario in sap pirateService
  1. Press 'planned Independent requirement' button on top, a small pop-up window will appear.
  1. In the small pop up screen, enter version '02' and planning periods.

Step 4) In the same screen,

  1. Press 'Plants' button on top and a small pop-up screen appears.
  1. Enter your manufacturing Plant code.
  1. Press button 'confirm', after verifying all the details

Step 5) In the same screen,

  1. Press 'Release+save' button and planning file entries will be generated.
  1. Click 'yes' in the pop-up window to release the scenario.

On clicking yes button, system will ask you to create planning file entries in online mode or background mode.

Step 6) In this screen,

  1. Planning file entries are generated. Click on button 'immediately' to generate the entries.

Messages will be generated regarding planning file entries which means system has identified number of materials relevant for Long term planning run.

You can close this screen or can move back to easy access screen.

How to run Long Term Planning (LTP)

Step 1) In Transaction MS02, we will take LTP run.

  1. Enter the material code.
  1. Enter your manufacturing Plant code for which you want to take MRP run.
  1. Enter Processing key as 'NETCH' ( Net change in total horizon)
  1. Enter '1' in MRP List and system will create MRP list similar to stock /requirement list for later analysis of previous MRP run.

Web Service To File Scenario In Sap Piracy

  1. Enter Planning mode '1' as we will take LTP run.
  1. Enter Scheduling indicator '2' which means LTP will do lead time scheduling and consider routing times to calculate the duration of simulative planned order.
  1. Enter '1' to use settings from planning scenario i.e. firmed receipts will not be considered in LTP run.

Press 2 times enter from keyboard to run the LTP. System will take some time to run LTP and will throw messages regarding planning.

Step 2) In this screen,

  1. Check the messages regarding number of procurement proposals created.

How to Check Stock/requirement list

This list will show you the requirement (inactive PIR) and receipt elements like simulative planned orders for the planning scenario. This list will show all simulative data and not the real time operative data.

Step 1) In Transaction MS04

  1. Enter material code.
  1. Enter Plant code

Press enter to move to next screen.

Step 2) In this screen,

  1. Check whether the planned orders got generated against the PIR and check the rescheduling dates in the planned orders. These are all simulative planned orders and nothing to do with real time data.

How to check capacity situation

Step 1) From SAP easy access, open transaction CM38 to check the capacity requirement at the work center ie. Work center will be loaded with simulative planned orders which has resulted in capacity requirements in terms of time.

  1. Enter planning scenario.

Press enter to move to next screen

Web Service To File Scenario In Sap Pirate

Step 1) In this screen,

  1. Check the capacity load at the work center which is basically ratio of capacity requirement (in hours) and available capacity (in hours).

How to analyze Simulative Purchase info system

LTP generates 'planned orders' instead of purchase requisitions and there is no 'Source of supply' in planned orders. However, we can see the Vendor in the Standard Information System reports.

After the LTP activity, a new version of the PURCHIS information system would be created.

Step1) In Transaction MS70

  1. Select the option 'Standard/moving avg. price', which means simulative planned orders will be evaluated at standard/moving avg price.
  1. Unmark 'Test mode' and execute. Version info structure 001 will automatically be created.

When you press execute button, System updates the Purchase information system in version 001 with simulative purchase order quantity with value so that purchase planner can plan the raw materials for the whole year and can negotiate with the suppliers.

When you press the execute button, it will take you to the next screen.

Step 2) In Transaction MCEC, you can see the updates of purchase information system done in previous step. Order quantity can be seen vendor wise for given period. This is all done in simulation version.

  1. Enter your plant code.

Press execute button on top or press F8 from keyboard to run this report. The report will display the simulative purchase order quantity in next screen.

Step 3) This screen will display the anticipated Purchase Quantity and value for raw materials based on simulative annual year production plan.

  1. Check the PO quantity and value in simulation version

Troubleshooting

  • All PP master data like BOM and routing needs to be in place to effectively run Long term planning because without master data, you cannot drill down and plan to lowest level in BOM i.e. raw materials.
  • Ensure to enter the PIR quantity in inactive version to avoid any conflicts in real data.