2026 Mar 19 9:06 AM - edited 2026 Mar 19 9:09 AM
This question was actually also asked back in 2022, but SAP Document AI has been updated 50-100 times since, so maybe a solution exist today.
We use Document AI basic edition.
We use SAP_purchaseOrder_schema or a extended copy of the same. We load purchase orders from different customers with different layouts and we see a lot of problems with the OCR not working in a consistent way. We hope we can fix some of these problems with templates. We would probably need templates for most of our customers POs.
We don't have a secure way to automatically determine which template to use before we load the PDFs.
Currently we can make a manual process where a user must open the pdf to see which customer it comes from and then manually load the pdf with the correct schema and template. This manual load process does not fulfill our goal for an automatic process.
The best solution will of course be if the OCR could be better so we wouldn't need a template, but a solution from the drawer with second best options could be if SAP Document AI automatic could detected the correct template from the templates related to the chosen schema.
Here is a a couple of examples of problems we hope to solve with templates. To be honest I don't think SAP Document AI performs very well in these cases:
1) A customer has more lines in the PDF for each item. The second line for an item has a scheduling line item no and SAP document AI reads this as a new item instead of just information for the previous item:
2) With line items that has identical layouts SAP Document AI suddenly swich from identifying a "Supplier material no" to instead identify a "Customer material no":
3) On page 1 SAP Document AI does not identify the "Supplier material no", but on page 2 it does.
Page 1:
Page 2:
Best regards
Thomas Madsen Nielsen
Request clarification before answering.
Hi @TMNielsen
Yes, we do support a "template auto-detect feature" both in UI and API. See e.g. here https://help.sap.com/docs/document-ai/sap-document-ai/add-document
When considering templates, I recommend to also have a look at the best practices and limitations: https://help.sap.com/docs/document-ai/sap-document-ai/template-best-practices
Besides this, our recommendation for such scenarios is to consider the premium edition with instant learning to avoid the overhead of creating and maintaining templates.
Best regards, Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Tobias. This is good news, but unfortunately I can't make it work via API.
If I load a file manually in the UI and select "Detect automatically" it finds a suitable template or no template if none is suitable. So, this is perfekt.
Here is the result when I load a file manually:
According to documentation I can select "Detect automatically" in api call by setting templateId = "detect"
I'm doing the call in ABAP, so my payload is build like this:
CONCATENATE
'--' lv_boundary lv_crlf
'Content-Disposition: form-data; name="options"' lv_crlf
'Content-Type: application/json' lv_crlf
lv_crlf
'{"clientId":"' imp_client '",'
'"schemaId":"' gv_schema_id '",'
'"schemaVersion":"' imp_schema_version '",'
'"templateID":"detect"}'
lv_crlf
INTO lv_json_part.but it doesn't work:
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.