<?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: Poor performance in API API_SALES_ORDER_SRV GET method - order reading in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13938149#M4892435</link>
    <description>solution:</description>
    <pubDate>Thu, 14 Nov 2024 12:43:02 GMT</pubDate>
    <dc:creator>rosenpetrov70</dc:creator>
    <dc:date>2024-11-14T12:43:02Z</dc:date>
    <item>
      <title>Poor performance in API API_SALES_ORDER_SRV GET method - order reading</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaq-p/13931293</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in S4 hana 107 we have an issue with very poor performance during a single sales order reading via GET method of API&amp;nbsp;API_SALES_ORDER_SRV.&lt;BR /&gt;We are trying to read a sales order header, all order items and schedule line information related to sales order items.&lt;BR /&gt;The issue seems to be in selecting data from a view A_SALESORDERSCHEDULELINE which contains about 700 million records.&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder('XYZ')?$expand=to_Item,to_Item/to_ScheduleLine&lt;/P&gt;&lt;P&gt;Test 1: OK.&lt;BR /&gt;Reading a sales order with only one item - takes a miliseconds - no performance issue here.&lt;/P&gt;&lt;P&gt;Test 2: Performance issue.&lt;BR /&gt;Reading a sales order with two items takes about 90 seconds.&lt;BR /&gt;If tha sales order has more than two items the performance is far more worse.&lt;/P&gt;&lt;P&gt;Details from debugging:&lt;/P&gt;&lt;P&gt;Performance issue is only here - data selection from A_SALESORDERSCHEDULELINE:&lt;/P&gt;&lt;P&gt;this code is executed:&lt;BR /&gt;CL_SADL_SQL_EXECUTOR-&amp;gt;SELECT&lt;BR /&gt;...&lt;BR /&gt;ELSEIF &amp;lt;clauses&amp;gt;-offset = 0 OR &amp;lt;clauses&amp;gt;-offset &amp;gt; 0 AND &amp;lt;clauses&amp;gt;-order_by IS INITIAL.&lt;BR /&gt;SELECT (&amp;lt;clauses&amp;gt;-select) FROM (&amp;lt;clauses&amp;gt;-from) "#EC CI_DYNTAB&lt;BR /&gt;WHERE (&amp;lt;clauses&amp;gt;-where) "#EC CI_DYNWHERE&lt;BR /&gt;GROUP BY (&amp;lt;clauses&amp;gt;-group_by)&lt;BR /&gt;HAVING (&amp;lt;clauses&amp;gt;-having)&lt;BR /&gt;ORDER BY (&amp;lt;clauses&amp;gt;-order_by)&lt;BR /&gt;%_HINTS HDB &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/17316"&gt;@db&lt;/a&gt;_hints "#EC CI_HINTS&lt;BR /&gt;INTO CORRESPONDING FIELDS OF TABLE &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/1384774"&gt;@ET&lt;/a&gt;_data&lt;BR /&gt;EXTENDED RESULT &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/43097"&gt;@LO&lt;/a&gt;_extended_result&lt;BR /&gt;UP TO @&amp;lt;clauses&amp;gt;-limit ROWS&lt;BR /&gt;CONNECTION (lv_dbcon)&lt;BR /&gt;%_native_end( hdb = @&amp;lt;clauses&amp;gt;-locale, otherwise = `` ).&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;FROM&lt;BR /&gt;&amp;lt;clauses&amp;gt;-from = A_SALESORDERSCHEDULELINE AS A_SALESORDERSCHEDULELINE&lt;/P&gt;&lt;P&gt;WHERE&lt;BR /&gt;&amp;lt;clauses&amp;gt;-where =&lt;BR /&gt;( A_SALESORDERSCHEDULELINE~SALESORDER, A_SALESORDERSCHEDULELINE~SALESORDERITEM ) IN ( ( 'XYZ', '000010' ), ( 'XYZ', '000020' ) )&lt;/P&gt;&lt;P&gt;*Hint:&lt;BR /&gt;In the debugger if we replace the original where clause which is:&lt;BR /&gt;( A_SALESORDERSCHEDULELINE~SALESORDER, A_SALESORDERSCHEDULELINE~SALESORDERITEM ) IN ( ( 'XYZ', '000010' ), ( 'XYZ', '000020' ) )&lt;BR /&gt;with this one:&lt;BR /&gt;( A_SALESORDERSCHEDULELINE~SALESORDER = 'XYZ' AND A_SALESORDERSCHEDULELINE~SALESORDERITEM IN ( '000010', '000020' ) )&lt;BR /&gt;then the select statement is executed immidiatelly and the there is no performance issue !!&lt;BR /&gt;This is all a standard SAP code and we do not have a clear idea how to solve this problem.&lt;/P&gt;&lt;P&gt;Please, propose a solution.&lt;/P&gt;&lt;P&gt;Thank you,&lt;BR /&gt;Rosen Petrov&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 10:57:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaq-p/13931293</guid>
      <dc:creator>rosenpetrov70</dc:creator>
      <dc:date>2024-11-07T10:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Poor performance in API API_SALES_ORDER_SRV GET method - order reading</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13938149#M4892435</link>
      <description>solution:</description>
      <pubDate>Thu, 14 Nov 2024 12:43:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13938149#M4892435</guid>
      <dc:creator>rosenpetrov70</dc:creator>
      <dc:date>2024-11-14T12:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Poor performance in API API_SALES_ORDER_SRV GET metho...</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13938151#M4892436</link>
      <description>&lt;DIV class=""&gt;&lt;H1&gt;Switch Off Language-Specific Sorting to Improve Performance&lt;/H1&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;SADL runtime uses language-specific alphabetical sorting as the default sort strategy. If sort criteria are defined, the records in the result are sorted according to the alphabet of current user's language.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;H2&gt;&lt;SPAN class=""&gt;Prerequisites&lt;/SPAN&gt;&lt;/H2&gt;&lt;/DIV&gt;This feature is available since SAP NetWeaver 7.40 SP08.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;H2&gt;&lt;SPAN class=""&gt;Context&lt;/SPAN&gt;&lt;/H2&gt;&lt;/DIV&gt;&lt;P class=""&gt;The disadvantage of using language-specific sorting is that the database might need much more time to execute the query, even with factor 10 or more. To protect performance, you can switch the language-specific sorting off, if it is not needed. It is recommended that you use language-specific sorting only if:&lt;/P&gt;&lt;UL class=""&gt;&lt;LI&gt;$orderby&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is defined on a text field or&lt;/LI&gt;&lt;LI&gt;$filter&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with operators 'gt', 'ge', 'lt' or 'le' is defined on a text field.&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;The text field is a database field that contains language-specific texts. In all other cases you can switch the language-specific sorting off by calling the following method:&lt;/P&gt;&lt;STRONG&gt;io_query_options-&amp;gt;set_locale_disabled( abap_true ).&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Nov 2024 12:46:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13938151#M4892436</guid>
      <dc:creator>rosenpetrov70</dc:creator>
      <dc:date>2024-11-14T12:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Poor performance in API API_SALES_ORDER_SRV GET metho...</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13951958#M4894436</link>
      <description>Hi &lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/840368"&gt;@rosenpetrov70&lt;/a&gt; somewhere i have a gap in my understanding. are we talking about the standard coding in api_sales_order or about the call or own service, because of the extension?</description>
      <pubDate>Fri, 29 Nov 2024 14:58:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13951958#M4894436</guid>
      <dc:creator>akuller</dc:creator>
      <dc:date>2024-11-29T14:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Poor performance in API API_SALES_ORDER_SRV GET metho...</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13952995#M4894559</link>
      <description>Yes, the standard service</description>
      <pubDate>Mon, 02 Dec 2024 10:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/13952995#M4894559</guid>
      <dc:creator>rosenpetrov70</dc:creator>
      <dc:date>2024-12-02T10:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Poor performance in API API_SALES_ORDER_SRV GET metho...</title>
      <link>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/14104029#M4914300</link>
      <description>How do we disable the language-specific sorting in the standard service? How can I call the method set_locale_disabled in the GET call?</description>
      <pubDate>Fri, 16 May 2025 19:06:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poor-performance-in-api-api-sales-order-srv-get-method-order-reading/qaa-p/14104029#M4914300</guid>
      <dc:creator>i010691</dc:creator>
      <dc:date>2025-05-16T19:06:04Z</dc:date>
    </item>
  </channel>
</rss>

