Finance package

SAP purchase requisition → PO approval

An SAP S/4HANA purchase requisition is read over OData, routed by an approval matrix to approvers who pick the cost centre, then turned into a PO.

Connects to SAP S/4HANA

OfficialHeadless / APIAdvanced~40 min setupv1.0.0

About this package

What it does

SAP purchase requisition → PO approval moves requisition approval out of SAP inboxes and into task forms people actually use. When a requisition is released for approval (a business event, a BTP Event Mesh message or a small ABAP job posting the number), the workflow reads it from the API_PURCHASEREQ_PROCESS_SRV OData service: the header and every item with material, material group, quantity, price, plant, purchasing organization and fixed supplier.

It totals the items and evaluates the PR approval matrix decision table on amount, material group and plant, which sets the approver level, whether finance must approve too and the SLA. The approver gets a task form with the items, a Cost centres lookup that fills the owner, remaining budget and G/L account, and Approve / Reject buttons; two-step rules add a finance approval.

Once approved, a purchase order is created with a deep insert into API_PURCHASEORDER_PROCESS_SRV A_PurchaseOrder, one PO item per requisition item with the approved cost centre, and the PO number is logged against the requisition.

Headless / API

Starts when SAP posts a released purchase requisition number to the workflow start API or inbound webhook (business event, Event Mesh or a scheduled ABAP report).

Another system starts it over REST or an inbound webhook. No UI is needed; people only appear where a decision needs a human.

The flow

Step by step

  1. 1

    Requisition released

    SAP posts the purchase requisition number.

  2. 2

    Read it over OData

    A_PurchaseRequisitionHeader and its to_PurchaseReqnItem items are read; the items are totalled.

  3. 3

    Approval matrix

    The decision table sets the approver level, whether finance approves too and the SLA from amount, material group and plant.

  4. 4

    Approver

    A task form with the items, a cost centre lookup (owner, budget, G/L) and Approve / Reject buttons.

  5. 5

    Finance (two-step)

    For larger or IT-hardware requisitions, finance confirms the budget and approves.

  6. 6

    Create the PO

    A_PurchaseOrder is created with one item per requisition item and the approved cost centre; the PO number is logged.

SAP purchase requisition approval — A released SAP purchase requisition is read over OData, routed by the approval matrix to one or two approvers who pick the cost centre, and converted into a purchase order. The same canvas you get in the designer after installing.

Forms

Inputs and task forms

The inputs a caller passes when it starts a run, and the forms people complete when the process needs a decision.

Start inputs

SAP purchase requisition approval

Passed by the calling system

Purchase requisition * purchase_requisition · textSAP purchase requisition number (BANFN), e.g. 10000123
Approver (user id) approver_user_id · textOptional: UserTasks user id of the first approver; the install-time default otherwise
Finance approver (user id) finance_user_id · textOptional: UserTasks user id of the finance approver for two-step approvals

User Task

Approve requisition

Approve PR {{purchase_requisition}}: {{pr_description}} ({{currency}} {{amount}}) · 2-column grid · own header and theme

Cost centre * cost_center · lookup
Name cost_center_name · text
Responsible cost_center_owner · text
Budget remaining (EUR) budget_remaining · currency
G/L account * gl_account · text
Comment comment · textarea
ApproveReject

User Task

Finance approval

Finance approval: PR {{purchase_requisition}} ({{currency}} {{amount}}) on {{cost_center}} · 2-column grid · own header and theme

Budget availability checked * budget_checked · boolean
Comment comment · textarea
ApproveReject

Headless

Call it from your systems

Every workflow can be started over REST, MCP or the CLI, whatever its trigger, with the sample input below. Runs start straight away on the published version; replace <workflow id> with the id the install created.

REST

shell
curl -X POST "$USERTASKS_URL/api/v1/workflows/start" \
  -H "Authorization: Bearer $USERTASKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflow_id":"<workflow id>","variables":{"purchase_requisition":"10000123"}}'

CLI

shell
usertasks workflows inputs <workflow id>          # the start form: keys, types, required
usertasks workflows run <workflow id> --input purchase_requisition=10000123 --wait

Inbound webhook

shell
usertasks webhooks create <workflow id>          # prints the hook slug and secret once
curl -X POST "$USERTASKS_URL/api/webhooks/inbound?hook=<slug>" \
  -H "Authorization: Bearer <webhook secret>" -H "Content-Type: application/json" \
  -d '{"purchase_requisition":"10000123"}'

What's included

8 assets, ready to adapt

TypeNameDetails
Data tableCost centresControlling cost centres the approver can charge: the approval form looks them up and shows the owner and remaining budget.
Data tableRequisition approvalsEvery SAP purchase requisition routed through UserTasks: amount, approval level, decisions and the purchase order created.
IntegrationSAP S/4HANA
API referenceCreate purchase orderPOST /API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder — API_PURCHASEORDER_PROCESS_SRV: deep insert of A_PurchaseOrder with its items (to_PurchaseOrderItem) referencing the requisition and the approved cost centre. Returns d.PurchaseOrder.
API referenceGet purchase requisitionGET /API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisitionHeader('{{purchase_requisition}}') — API_PURCHASEREQ_PROCESS_SRV: the requisition header (type, description).
API referenceGet requisition itemsGET /API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisitionHeader('{{purchase_requisition}}')/to_PurchaseReqnItem — API_PURCHASEREQ_PROCESS_SRV: the requisition items (navigation to_PurchaseReqnItem): material, material group, quantity, price, plant, purchasing org and group, fixed supplier.
Decision tablePR approval matrix5 rules — Approval level for a purchase requisition by total amount, material group and plant. two_step = a second (finance) approval after the first. First matching rule wins.
WorkflowSAP purchase requisition approval27 steps — A released SAP purchase requisition is read over OData, routed by the approval matrix to one or two approvers who pick the cost centre, and converted into a purchase order.

Cost centres · 5 sample rows

Cost centreNameCompany codeControlling areaResponsibleDefault G/L accountBudget remaining (EUR)Active

Requisition approvals · schema only

Purchase requisitionDescriptionAmountCurrencyMaterial groupPlantApprover levelCost centreStatusPurchase orderNotes

Requirements

What you connect it to

Credentials never travel in a package. The install wizard asks for what your environment must provide, or installs it incomplete until you finish setup.

Needs

  • REST API — A REST API integration: set its base URL and credentials on install.
  • Assignees — People in your workspace to receive the User Tasks (picked on install).
  • Inbound webhook — An inbound webhook created for the workflow, so other systems can start it.

After installing

  1. SAP S/4HANA integration: base URL https://<host>/sap/opu/odata/sap, Basic authentication with the communication user of a communication arrangement for SAP_COM_0102 (purchase requisitions) and SAP_COM_0053 (purchase orders); set sap-client in the integration headers.
  2. CSRF: SAP OData POSTs need an x-csrf-token. Route calls through SAP API Management / BTP destination that fetches the token, or call through a gateway that handles it; the Create purchase order reference has an optional x-csrf-token header input if you fetch it yourself (GET with header x-csrf-token: Fetch).
  3. Assignees: pick the default requisition approver and the finance approver (runs can pass approver_user_id and finance_user_id).
  4. Replace the Cost centres rows with your controlling cost centres (or import them) and edit the PR approval matrix to your release strategy.
  5. Have SAP post {"purchase_requisition": "<number>"} to the start API when a requisition is released for approval.

Asked for on install

  • Integration “SAP S/4HANA”Required

    • Passwordconfig.auth_config.password
    • Base urlconfig.base_urldefault https://s4.sap.example.com/sap/opu/odata/sap· optional
  • Workflow “SAP purchase requisition approval” assigneesRequired

    • User for step “Approve requisition”nodes.14.config.assignee_id
    • User for step “Finance approval”nodes.18.config.assignee_id

Install

Install it in your workspace

Works on UserTasks cloud and on any self-hosted instance. Installing creates the assets above; nothing runs until you complete setup and start it.

In the app

  1. Download sap-purchase-requisition-approval-1.0.0.utpkg.
  2. Open Automations → Packages and drag the file onto the page (or choose Import package). Browse gallery there lists every gallery package without downloading by hand.
  3. Pick the file. The wizard verifies the checksum, every file hash and the signature, and shows the readme.
  4. Review the changes (what is created) and the data rows.
  5. Fill in the requirements, or tick Keep incomplete and finish later with Complete setup.
  6. Done: the workflow is published and active once setup is complete.

With the CLI

shell
curl -fLO https://usertasks.com/gallery/sap-purchase-requisition-approval-1.0.0.utpkg
usertasks packages inspect sap-purchase-requisition-approval-1.0.0.utpkg       # offline: checksum, hashes, signature
usertasks packages install sap-purchase-requisition-approval-1.0.0.utpkg --dry-run
usertasks packages install sap-purchase-requisition-approval-1.0.0.utpkg       # prompts for each requirement
usertasks packages install sap-purchase-requisition-approval-1.0.0.utpkg --keep-incomplete --yes   # in CI; finish with:
usertasks packages complete sap-purchase-requisition-approval -f values.yaml

Verify the download

File SHA-256
c97b10ed098412520fa73054058e4cb77e49c9323c4d805d9da0c30fcff7fdc8
Package checksum (what is signed)
sha256:1c0f0bbb64d437f5d33337d810db93211fdc8dd9f7ac7077ed2bdbeb10b41dab
Signer
Unsigned preview build — compare the SHA-256 above

shasum -a 256 sap-purchase-requisition-approval-1.0.0.utpkg should print the file SHA-256. How gallery packages are signed.

Versions

Version 1.0.0

  1. v1.0.02026-10-28First release.

Installing a newer version upgrades in place: local credentials and requirement values are kept, and changes you made are flagged first. How packages work

More packages

Related

Browse the whole gallery