<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Can SAP DOCUMENT AI make automatic template selection? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14357003#M4939134</link>
    <description>&lt;P&gt;Ok I found my typo. It must be templateId, but I wrote templateID.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2026 12:14:11 GMT</pubDate>
    <dc:creator>TMNielsen</dc:creator>
    <dc:date>2026-03-24T12:14:11Z</dc:date>
    <item>
      <title>Can SAP DOCUMENT AI make automatic template selection?</title>
      <link>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaq-p/14353087</link>
      <description>&lt;P&gt;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.&lt;BR /&gt;&lt;SPAN&gt;We use Document AI basic edition.&lt;BR /&gt;We use&amp;nbsp;&lt;SPAN&gt;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.&lt;BR /&gt;We don't have a secure way to automatically determine which template to use before we load the PDFs.&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;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:&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_7-1773910935121.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/386046iCD9D354DB50E92A0/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_7-1773910935121.png" title="TMNielsen_7-1773910935121.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;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":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_6-1773910862999.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/386045i6D633FA48E1D961C/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_6-1773910862999.png" title="TMNielsen_6-1773910862999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3) On page 1 SAP Document AI does not identify the "Supplier material no", but on page 2 it does.&lt;/P&gt;&lt;P&gt;Page 1:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_5-1773910744439.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/386043i0651481FAB73313D/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_5-1773910744439.png" title="TMNielsen_5-1773910744439.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Page 2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_4-1773910695544.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/386040i622456F9EF4A2467/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_4-1773910695544.png" title="TMNielsen_4-1773910695544.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Thomas Madsen Nielsen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2026 09:09:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaq-p/14353087</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2026-03-19T09:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAP DOCUMENT AI make automatic template selection?</title>
      <link>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14354265#M4938966</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/16897"&gt;@TMNielsen&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Yes, we do support a "template auto-detect feature" both in UI and API. See e.g. here &lt;A href="https://help.sap.com/docs/document-ai/sap-document-ai/add-document" target="_blank"&gt;https://help.sap.com/docs/document-ai/sap-document-ai/add-document&lt;/A&gt;&lt;BR /&gt;When considering templates, I recommend to also have a look at the best practices and limitations:&amp;nbsp;&lt;A href="https://help.sap.com/docs/document-ai/sap-document-ai/template-best-practices" target="_blank"&gt;https://help.sap.com/docs/document-ai/sap-document-ai/template-best-practices&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Besides this, our recommendation for such scenarios is to consider the premium edition with &lt;A href="https://help.sap.com/docs/document-ai/sap-document-ai/instant-learning-premium-edition" target="_self"&gt;instant learning&amp;nbsp;&lt;/A&gt;to avoid the overhead of creating and maintaining templates.&lt;BR /&gt;&lt;BR /&gt;Best regards, Tobias&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2026 09:34:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14354265#M4938966</guid>
      <dc:creator>tobias_weller</dc:creator>
      <dc:date>2026-03-20T09:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAP DOCUMENT AI make automatic template selection?</title>
      <link>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14356971#M4939133</link>
      <description>&lt;P&gt;Thank you Tobias. This is good news, but unfortunately I can't make it work via API.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Here is the result when I load a file manually:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_1-1774352781290.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/388322iF617B4FFD583CF74/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_1-1774352781290.png" title="TMNielsen_1-1774352781290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;According to documentation I can select "Detect automatically" in api call by setting templateId = "detect"&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_0-1774352467285.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/388318i37254D9F3CF5A947/image-size/medium?v=v2&amp;amp;px=400" alt="TMNielsen_0-1774352467285.png" title="TMNielsen_0-1774352467285.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I'm doing the call in ABAP, so my payload is build like this:&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;    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.&lt;/LI-CODE&gt;&lt;P&gt;but it doesn't work:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TMNielsen_2-1774352889208.png"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/388326i5C3C34DF6C30918A/image-size/large?v=v2&amp;amp;px=999" alt="TMNielsen_2-1774352889208.png" title="TMNielsen_2-1774352889208.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 11:55:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14356971#M4939133</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2026-03-24T11:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAP DOCUMENT AI make automatic template selection?</title>
      <link>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14357003#M4939134</link>
      <description>&lt;P&gt;Ok I found my typo. It must be templateId, but I wrote templateID.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 12:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/can-sap-document-ai-make-automatic-template-selection/qaa-p/14357003#M4939134</guid>
      <dc:creator>TMNielsen</dc:creator>
      <dc:date>2026-03-24T12:14:11Z</dc:date>
    </item>
  </channel>
</rss>

