# Extracting Information from SAP Sales Order with Kognitos

> Watch Kognitos turn an emailed purchase order into a sales order in SAP — 36 lines of English authenticate, extract, look up customer & material numbers, and notify the sender.

**Page**: https://www.kognitos.com/videos/extracting-information-from-sap-sales-order-with-kognitos/
**Watch on YouTube**: https://www.youtube.com/watch?v=kd2rkGyYvnE
**Length**: 6m 30s

## What's in this video

A 6.5-minute walkthrough of a Kognitos process that turns an emailed purchase order into a live sales order in SAP. The whole process is 36 lines of plain English, plus a couple of subprocedures.

## What the process does

- **Email trigger**: the run kicks off when a PO is dragged into a new email and sent to the Kognitos-provided address. The PO in the demo is for Global Text Solutions Incorporated dated 2024-11-15.
- **SAP authentication**: a subprocedure logs into SAP — kept separate so it can be reused by other processes.
- **Customer name extraction**: Kognitos uses a Textract+GPT extraction blend to pull the customer name accurately without training.
- **Line-item extraction**: the single-line table is parsed for material name and quantity.
- **Reference lookups**: subprocedures translate the customer name into a customer number and the material name into a material number using SAP reference tables.
- **Create the sales order**: a single English statement creates the SAP sales order with the customer number, material number, and quantity.
- **Notify the sender**: the original emailer gets the new SAP sales order number back by email — closing the loop.

## Tools and patterns shown

- **Process flow view**: a visual summary of the “big rocks” — authenticate → extract → look up → create — useful for explaining the automation to stakeholders.
- **Subprocedures**: the SAP login and the reference lookups are isolated and reusable.
- **Email metadata in runs**: every run shows the email body, sender, and attachment metadata alongside the extracted facts.

## FAQs

**Q: What does this Kognitos process do end to end?**

It receives an emailed purchase order, authenticates to SAP, extracts the customer name and the material/quantity from the PO, looks up the customer and material numbers in SAP reference tables, creates a SAP sales order with those IDs, and emails the original sender back with the new sales order number.


**Q: How long is the underlying Kognitos process?**

36 lines of plain English in the main process, plus a couple of subprocedures (SAP authentication and the reference lookups). The whole flow runs from an inbound email and finishes by emailing the sender back with the SAP sales order number.


**Q: How does Kognitos extract the customer name and line items?**

Through a Textract+GPT blend purpose-built for high-accuracy extraction without training data. The same step also pulls the single-row line-item table for material name and quantity.


**Q: Can I kick this off from something other than email?**

Yes. Email is convenient for the demo, but Kognitos processes can also be triggered by an API call or on a schedule — the rest of the process stays identical.


