Create Purchase Order
Based On Purchase Requisition
Simple Sample
Documentation
Documentation Simple Sample
Disclaimer
SAP does not represent or endorse the accuracy or reliability of any of the information, content, or
advertisements (collectively, the "Materials") contained on, distributed through, or linked, downloaded, or
accessed from any of the services contained on this Web site (the "Service"), nor the quality of any products,
information, or other materials displayed, purchased, or obtained by you as a result of an advertisement or
any other information or offer in or in connection with the Service (the "Products"). You hereby acknowledge
that any reliance upon any Materials shall be at your sole risk. SAP reserves the right, in its sole discretion
and without any obligation, to make improvements to, or correct any error or omissions in any portion of the
Service or the Materials.
THE SERVICE AND THE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP
EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT
LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE,
WITH RESPECT TO THE SERVICE OR ANY MATERIALS AND PRODUCTS. IN NO EVENT SHALL SAP
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES
OF ANY KIND WHATSOEVER WITH RESPECT TO THE SERVICE, THE MATERIALS, AND THE
PRODUCTS.
SAP encourages you to exercise discretion while browsing the Internet using this site.
SAP makes no representations concerning any endeavor to review the content of sites linked to this site or
any of the Materials, and so SAP isn't responsible for the accuracy, copyright compliance, legality, or decency
of material contained in sites listed in the directory or in the Materials.
SAP respects the rights (including the intellectual property rights) of others, and we ask our users to do the
same. SAP may, in appropriate circumstances and in its sole discretion, terminate the accounts of users that
infringe or otherwise violate such rights of others.
If you believe that your work has been copied in a way that constitutes copyright infringement, please follow
the instructions at the top of this page.
Documentation Simple Sample
Preface
This documentation contains all information required to understand, configure and run the Simple Sample
provided by SAP. Simple Samples are ready to run SOA based composite applications for educational
purposes which
are intended as an example to understand enterprise service consumption on model/coding level
are running against ES workplace backend systems
Simple Samples are neither enabled nor intended for productive usage or usage as a reusable element in a
real implementation. There is no maintenance obligation from SAP associated for Simple Samples.
FURTHER INFORMATION............................................................................................4
1
1 Abstract
This simple sample demonstrates how a user can create a purchase order based on a purchase
requisition. For example, the purchasing department of a company orders materials for an employee
who has previously requested them in a purchase requisition. In the first step, the purchaser enters the
purchase request identifier that he/she wishes to order. The enterprise service Read Purchase
Request is called to retrieve the details of this purchase request. In the next step, the purchaser enters
further information that is required to create the purchase order, such as the quantity to be ordered,
the supplier, and the delivery date. (Note that there is one restriction: the purchaser can only create a
purchase order with one purchase requisition.) By calling the enterprise service Create Purchase
Order the user then creates the purchase order and, in the last step, receives a confirmation about the
created document.
2 Description
2.1 Application Screens
The simple sample has three screens; description for each of them is provided in the following
sections.
2.1.1
Enter Purchase Requisition ID
In the first screen of this simple sample the user is requested to enter a Purchase Requisition ID. A
Purchase Requisition can be created with the Simple Sample “Create Purchase Requisition”. The
system validates the existence of the entered Purchase Requisition ID after the user clicks on the
“Next” button. The data from this Purchase Requisition will be used as the basis for the Purchase
Order that is to be created.
2.1.2
Enter Purchase Order Data
The second screen shows some details (e.g. purchase requisition item id, material id, material
description, quantity) fetched from database corresponding to purchase requisition ID fed in first
screen.. Among these fields, few fields like purchase organization party, supplier id, item ID etc. can
be modified by user and other are read only. Additionally it has some fields which are mandatory (e.g.
supplier id, line id, purchase organization party etc.), these are pre-filled with some default values to
facilitate easy navigation. This also has a back button, which navigates back to first screen.
2.1.3
Display Purchase Order
After the request for purchase order is created successful in backend, a purchase order id is assigned
to the purchase order. This ID is used to read the purchase order from backend and some fields like
purchase order id, purchase order date, ordered quantity etc. are displayed to user as a confirmation.
This screen has a finish button to close the application.
To review the purchase order in the backend transaction ME23N (SAP Menu
Logistics
Materials
Management
Purchasing
Purchase Order
Display) can be used. Within the transaction
choose "Other Purchase Order" to select the document you want to display. For further information on
how to execute transactions in the Enterprise Services Workplace backend systems, please refer to
chapter 4.
2.2
Enterprise Services Used in This Simple Sample
2.2.1
Read Purchase Request
Enterprise Service
04.03.2009
Fields Used
mandatory/
optional
Label
Test Data
2
Read Purchase
Requisition
INPUT:
Mandatory
Purchase Requisition ID
(e.g. from Simple
Sample ‘Create
Purchase Request’)
PurchaseRequest.ID
OUTPUT:
2.2.2
PurchaseRequest.ID
Purchase Requisition ID
Item.ID
Purchase Requisition Item ID
Item.Requested Quantity
Requested quantity
Item.PlantID
Plant ID
Item.Product.InternalID
Material
Item.Description
Material
Item.DevlieryDate
Requested delivery date
Create Purchase Order
Note: To make the actual sample application UI more usable, some fields that are mandatory to call
the Enterprise Service to create a purchase order are not displayed but filled with default values.
Enterprise Service
3 Composite Details
The UIs for this simple sample have been developed in Visual Composer using a wizard as basic
element. A wizard is a container that uses sequential labelled steps to represent different content
layers. The runtime user navigates between content layers using toolbar buttons or by clicking the step
labels at the top of the Wizard container. The important aspects of this model are as follows:
1. The model has three steps in a wizard. First one is used to enable user to enter a purchase
requisition id, for which a purchase order is being created.
2. When the user clicks on next button in the first step, a call to the service
PurchaseRequestByIDQueryResponse_In is made. If the entered purchase requisition id is
valid, the output of this service is fed into the second step.
3. “Assign” events are used to set the default values of some fields in the second form ( these
fields are ‘Purchase Organization Party’ , ‘Purchase Order Item ID’ , ‘Supplier ID’ , Line ID and
Delivery Date Time – this value is set to Today’s date + 7days). Note that some fields that are
mandatory to call the Enterprise Service to create a purchase order (see next step) are not
displayed on the UI.
4. When a user is clicking on the next button this model calls the service
PurchaseOrderCreateRequestConfirmation_In. If the entered data is valid, a purchase order
04.03.2009
4
is created in the backend ERP system and the Purchase Order ID from the output of this
service is fed into the service PurchaseOrderByIDQueryResponse_In, which reads the newly
created purchase order.
5. The output of this (PurchaseOrderByIDQueryResponse_In) service call is finally displayed to
the user in the third step for confirmation purposes. The FINISH button on third screen uses
the event CLOSE to complete the process and close the explorer window.
A closer look into the models and sources of this Simple Sample is provided as part of the
downloadable Software Component Archive (SCA).
4 Further Information
Please refer to: https://www.sdn.sap.com/irj/sdn/explore-es