<?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>topic Re: CX_SY_OPEN_SQL_DB Memory allocation failed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528745#M2005256</link>
    <description>&lt;P&gt;i noticed something:&lt;/P&gt;&lt;P&gt;if i does clear a lr_aufnr, solving problem. lr_aufnr defination an internal table(&lt;A rel="nofollow" href="https://answers.sap.com/storage/attachments/2021882-image.png"&gt;image.png&lt;/A&gt;). I found a duplicate data here and deleted one, still my problem persists.&lt;/P&gt;&lt;P&gt;By looping my problem was solved as follows. I haven't been able to identify the root cause though. What do you think about?&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;p_jahpr = 011.2021 (this problem is valid only for the 11th month)&lt;/P&gt; 
&lt;PRE&gt;&lt;CODE&gt;    DATA: lr_aufnr TYPE RANGE OF aufk-aufnr,&lt;BR /&gt;          messages TYPE bapirettab.&lt;BR /&gt;*&lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.&lt;BR /&gt;  PARAMETERS: p_jahpr LIKE mldoc-jahrper OBLIGATORY,&lt;BR /&gt;              p_curtp LIKE mldoc-curtp OBLIGATORY DEFAULT `10`.&lt;BR /&gt;SELECTION-SCREEN END OF BLOCK blk1.&lt;BR /&gt;*&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;*&lt;BR /&gt;    SELECT  ml~jahrper,&lt;BR /&gt;            ml~curtp,&lt;BR /&gt;            hd~bwtar,&lt;BR /&gt;            hd~bwkey,&lt;BR /&gt;            m~matkl,&lt;BR /&gt;            t23~wgbez60,&lt;BR /&gt;            hd~matnr,&lt;BR /&gt;            t~maktx,&lt;BR /&gt;            SUM( ml~quant ) AS quant,&lt;BR /&gt;            ml~meins,&lt;BR /&gt;            ml~aufnr,&lt;BR /&gt;            hd~kalnr&lt;BR /&gt;        FROM mldoc AS ml&lt;BR /&gt;        INNER JOIN ckmlhd AS hd ON hd~kalnr = ml~kalnr&lt;BR /&gt;        INNER JOIN mara AS m ON m~matnr = hd~matnr&lt;BR /&gt;        LEFT OUTER JOIN makt AS t ON t~matnr = m~matnr&lt;BR /&gt;        AND                          t~spras = @sy-langu&lt;BR /&gt;        LEFT OUTER JOIN t023t AS t23 ON t23~matkl = m~matkl&lt;BR /&gt;        AND                             t23~spras = @sy-langu&lt;BR /&gt;        WHERE ml~jahrper = @p_jahpr&lt;BR /&gt;        AND   ml~curtp = @p_curtp&lt;BR /&gt;        AND   ml~categ = `ZU`&lt;BR /&gt;        AND   ml~ptyp  = `BF`&lt;BR /&gt;        AND   m~mtart IN ( `U100`, `U200` )&lt;BR /&gt;        AND   ml~aufnr IS NOT INITIAL&lt;BR /&gt;        GROUP BY  ml~jahrper,&lt;BR /&gt;                  ml~curtp,&lt;BR /&gt;                  hd~bwtar,&lt;BR /&gt;                  m~matkl,&lt;BR /&gt;                  t23~wgbez60,&lt;BR /&gt;                  hd~matnr,&lt;BR /&gt;                  t~maktx,&lt;BR /&gt;                  ml~meins,&lt;BR /&gt;                  ml~aufnr,&lt;BR /&gt;                  hd~kalnr,&lt;BR /&gt;                  hd~bwkey&lt;BR /&gt;        INTO TABLE @DATA(lt_data_initial).&lt;BR /&gt;*&lt;BR /&gt;    SELECT DISTINCT&lt;BR /&gt;           'I' AS sign,&lt;BR /&gt;           'EQ' AS option,&lt;BR /&gt;           l~aufnr AS low&lt;BR /&gt;        FROM @lt_data_initial AS l&lt;BR /&gt;        INTO CORRESPONDING FIELDS OF TABLE @lr_aufnr.&lt;BR /&gt;      DATA: ls_aufnr LIKE LINE OF lr_aufnr&lt;BR /&gt;            .&lt;BR /&gt;*&lt;BR /&gt;*loop at lr_aufnr ASSIGNING FIELD-SYMBOL(&amp;lt;fs_aufnr&amp;gt;).&lt;BR /&gt;LOOP AT lr_aufnr INTO ls_aufnr.&lt;BR /&gt;    SELECT DISTINCT&lt;BR /&gt;           ml~aufnr,&lt;BR /&gt;           c~megbtr,&lt;BR /&gt;           c~plstar,&lt;BR /&gt;           c~gjahr,&lt;BR /&gt;           c~perio,&lt;BR /&gt;           c~belnr,&lt;BR /&gt;           c~buzei,&lt;BR /&gt;           c~objnr,&lt;BR /&gt;           c~uspob&lt;BR /&gt;      FROM mldoc AS ml&lt;BR /&gt;      INNER JOIN aufk AS a ON a~aufnr = ml~aufnr&lt;BR /&gt;      RIGHT JOIN coep AS c ON c~objnr = a~objnr&lt;BR /&gt;      AND                     c~kokrs = `1000`&lt;BR /&gt;      AND                     left( @p_jahpr, 4 ) = c~gjahr&lt;BR /&gt;      AND                     right( @p_jahpr, 3 ) = c~perio&lt;BR /&gt;      AND                     c~wrttp = `04`&lt;BR /&gt;      AND                     c~vrgng = `RKL`&lt;BR /&gt;      WHERE ml~jahrper = @p_jahpr&lt;BR /&gt;      AND   ml~curtp = @p_curtp&lt;BR /&gt;**      AND   ml~glvor = `RKL`&lt;BR /&gt;&lt;STRONG&gt;      AND   ml~aufnr EQ @ls_aufnr-low&lt;/STRONG&gt;&lt;BR /&gt;      INTO TABLE @DATA(lt_data_plstar).&lt;BR /&gt;&lt;BR /&gt; DATA: ls_data_plstar_2 LIKE LINE OF lt_data_plstar,&lt;BR /&gt;       lt_data_plstar_2 LIKE TABLE OF ls_data_plstar_2.&lt;BR /&gt;*&lt;BR /&gt;      LOOP AT lt_data_plstar INTO ls_data_plstar_2.&lt;BR /&gt;      APPEND ls_data_plstar_2 TO lt_data_plstar_2.&lt;BR /&gt;      ENDLOOP.&lt;BR /&gt;*&lt;BR /&gt;      CLEAR ls_data_plstar_2.&lt;BR /&gt;      CLEAR lt_data_plstar.&lt;BR /&gt;      CLEAR ls_aufnr.&lt;BR /&gt;*&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;BREAK-POINT.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 19 Feb 2022 10:27:25 GMT</pubDate>
    <dc:creator>former_member751715</dc:creator>
    <dc:date>2022-02-19T10:27:25Z</dc:date>
    <item>
      <title>CX_SY_OPEN_SQL_DB Memory allocation failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528743#M2005254</link>
      <description>&lt;P&gt;Hello experts,&lt;BR /&gt;a dump is returned if the code block below is executed. what would be the reason?&lt;/P&gt;
  &lt;P&gt;Thank you for your support.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; SELECT DISTINCT&lt;BR /&gt; ml~aufnr,&lt;BR /&gt; c~megbtr,&lt;BR /&gt; c~plstar,&lt;BR /&gt; c~gjahr,&lt;BR /&gt; c~perio,&lt;BR /&gt; c~belnr,&lt;BR /&gt; c~buzei,&lt;BR /&gt; c~objnr,&lt;BR /&gt; c~uspob&lt;BR /&gt; FROM mldoc AS ml&lt;BR /&gt; INNER JOIN aufk AS a ON a~aufnr = ml~aufnr&lt;BR /&gt; RIGHT JOIN coep AS c ON c~objnr = a~objnr&lt;BR /&gt; AND c~kokrs = `1000`&lt;BR /&gt; AND left( @p_jahpr, 4 ) = c~gjahr&lt;BR /&gt; AND right( @p_jahpr, 3 ) = c~perio&lt;BR /&gt; AND c~wrttp = `04`&lt;BR /&gt; AND c~vrgng = `RKL`&lt;BR /&gt; WHERE ml~jahrper = @p_jahpr&lt;BR /&gt; AND ml~curtp = @p_curtp&lt;BR /&gt;* AND ml~glvor = `RKL`&lt;BR /&gt; AND ml~aufnr IN @lr_aufnr&lt;BR /&gt; INTO TABLE @DATA(lt_data_plstar).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2021852-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2021851-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 20:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528743#M2005254</guid>
      <dc:creator>former_member751715</dc:creator>
      <dc:date>2022-02-18T20:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: CX_SY_OPEN_SQL_DB Memory allocation failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528744#M2005255</link>
      <description>&lt;P&gt;Try to simplify everything you can/writing differently:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;AND left( @p_jahpr, 4 ) = c~gjahr →  AND c~gjahr =  @( substring( val = p_jahpr len = 4 ) )&lt;/LI&gt;&lt;LI&gt;AND right( @p_jahpr, 3 ) = c~perio →  AND c~perio =  @( substring( val = p_jahpr off = 4 ) )&lt;/LI&gt;&lt;LI&gt;RIGHT JOIN : can you change it to do a left join on MLDOC?&lt;/LI&gt;&lt;LI&gt;AND c~kokrs = `1000` →  AND c~kokrs = '1000' (straight quotes instead of backticks)&lt;/LI&gt;&lt;LI&gt;AND ml~aufnr IN @lr_aufnr : What values do you have in LR_AUFNR ?&lt;/LI&gt;&lt;LI&gt;INTO TABLE @DATA(lt_data_plstar) : did you make sure the order of columns is same as the one in the SELECT, and types are exactly the same?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 18 Feb 2022 20:59:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528744#M2005255</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-02-18T20:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: CX_SY_OPEN_SQL_DB Memory allocation failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528745#M2005256</link>
      <description>&lt;P&gt;i noticed something:&lt;/P&gt;&lt;P&gt;if i does clear a lr_aufnr, solving problem. lr_aufnr defination an internal table(&lt;A rel="nofollow" href="https://answers.sap.com/storage/attachments/2021882-image.png"&gt;image.png&lt;/A&gt;). I found a duplicate data here and deleted one, still my problem persists.&lt;/P&gt;&lt;P&gt;By looping my problem was solved as follows. I haven't been able to identify the root cause though. What do you think about?&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;p_jahpr = 011.2021 (this problem is valid only for the 11th month)&lt;/P&gt; 
&lt;PRE&gt;&lt;CODE&gt;    DATA: lr_aufnr TYPE RANGE OF aufk-aufnr,&lt;BR /&gt;          messages TYPE bapirettab.&lt;BR /&gt;*&lt;BR /&gt;SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.&lt;BR /&gt;  PARAMETERS: p_jahpr LIKE mldoc-jahrper OBLIGATORY,&lt;BR /&gt;              p_curtp LIKE mldoc-curtp OBLIGATORY DEFAULT `10`.&lt;BR /&gt;SELECTION-SCREEN END OF BLOCK blk1.&lt;BR /&gt;*&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;*&lt;BR /&gt;    SELECT  ml~jahrper,&lt;BR /&gt;            ml~curtp,&lt;BR /&gt;            hd~bwtar,&lt;BR /&gt;            hd~bwkey,&lt;BR /&gt;            m~matkl,&lt;BR /&gt;            t23~wgbez60,&lt;BR /&gt;            hd~matnr,&lt;BR /&gt;            t~maktx,&lt;BR /&gt;            SUM( ml~quant ) AS quant,&lt;BR /&gt;            ml~meins,&lt;BR /&gt;            ml~aufnr,&lt;BR /&gt;            hd~kalnr&lt;BR /&gt;        FROM mldoc AS ml&lt;BR /&gt;        INNER JOIN ckmlhd AS hd ON hd~kalnr = ml~kalnr&lt;BR /&gt;        INNER JOIN mara AS m ON m~matnr = hd~matnr&lt;BR /&gt;        LEFT OUTER JOIN makt AS t ON t~matnr = m~matnr&lt;BR /&gt;        AND                          t~spras = @sy-langu&lt;BR /&gt;        LEFT OUTER JOIN t023t AS t23 ON t23~matkl = m~matkl&lt;BR /&gt;        AND                             t23~spras = @sy-langu&lt;BR /&gt;        WHERE ml~jahrper = @p_jahpr&lt;BR /&gt;        AND   ml~curtp = @p_curtp&lt;BR /&gt;        AND   ml~categ = `ZU`&lt;BR /&gt;        AND   ml~ptyp  = `BF`&lt;BR /&gt;        AND   m~mtart IN ( `U100`, `U200` )&lt;BR /&gt;        AND   ml~aufnr IS NOT INITIAL&lt;BR /&gt;        GROUP BY  ml~jahrper,&lt;BR /&gt;                  ml~curtp,&lt;BR /&gt;                  hd~bwtar,&lt;BR /&gt;                  m~matkl,&lt;BR /&gt;                  t23~wgbez60,&lt;BR /&gt;                  hd~matnr,&lt;BR /&gt;                  t~maktx,&lt;BR /&gt;                  ml~meins,&lt;BR /&gt;                  ml~aufnr,&lt;BR /&gt;                  hd~kalnr,&lt;BR /&gt;                  hd~bwkey&lt;BR /&gt;        INTO TABLE @DATA(lt_data_initial).&lt;BR /&gt;*&lt;BR /&gt;    SELECT DISTINCT&lt;BR /&gt;           'I' AS sign,&lt;BR /&gt;           'EQ' AS option,&lt;BR /&gt;           l~aufnr AS low&lt;BR /&gt;        FROM @lt_data_initial AS l&lt;BR /&gt;        INTO CORRESPONDING FIELDS OF TABLE @lr_aufnr.&lt;BR /&gt;      DATA: ls_aufnr LIKE LINE OF lr_aufnr&lt;BR /&gt;            .&lt;BR /&gt;*&lt;BR /&gt;*loop at lr_aufnr ASSIGNING FIELD-SYMBOL(&amp;lt;fs_aufnr&amp;gt;).&lt;BR /&gt;LOOP AT lr_aufnr INTO ls_aufnr.&lt;BR /&gt;    SELECT DISTINCT&lt;BR /&gt;           ml~aufnr,&lt;BR /&gt;           c~megbtr,&lt;BR /&gt;           c~plstar,&lt;BR /&gt;           c~gjahr,&lt;BR /&gt;           c~perio,&lt;BR /&gt;           c~belnr,&lt;BR /&gt;           c~buzei,&lt;BR /&gt;           c~objnr,&lt;BR /&gt;           c~uspob&lt;BR /&gt;      FROM mldoc AS ml&lt;BR /&gt;      INNER JOIN aufk AS a ON a~aufnr = ml~aufnr&lt;BR /&gt;      RIGHT JOIN coep AS c ON c~objnr = a~objnr&lt;BR /&gt;      AND                     c~kokrs = `1000`&lt;BR /&gt;      AND                     left( @p_jahpr, 4 ) = c~gjahr&lt;BR /&gt;      AND                     right( @p_jahpr, 3 ) = c~perio&lt;BR /&gt;      AND                     c~wrttp = `04`&lt;BR /&gt;      AND                     c~vrgng = `RKL`&lt;BR /&gt;      WHERE ml~jahrper = @p_jahpr&lt;BR /&gt;      AND   ml~curtp = @p_curtp&lt;BR /&gt;**      AND   ml~glvor = `RKL`&lt;BR /&gt;&lt;STRONG&gt;      AND   ml~aufnr EQ @ls_aufnr-low&lt;/STRONG&gt;&lt;BR /&gt;      INTO TABLE @DATA(lt_data_plstar).&lt;BR /&gt;&lt;BR /&gt; DATA: ls_data_plstar_2 LIKE LINE OF lt_data_plstar,&lt;BR /&gt;       lt_data_plstar_2 LIKE TABLE OF ls_data_plstar_2.&lt;BR /&gt;*&lt;BR /&gt;      LOOP AT lt_data_plstar INTO ls_data_plstar_2.&lt;BR /&gt;      APPEND ls_data_plstar_2 TO lt_data_plstar_2.&lt;BR /&gt;      ENDLOOP.&lt;BR /&gt;*&lt;BR /&gt;      CLEAR ls_data_plstar_2.&lt;BR /&gt;      CLEAR lt_data_plstar.&lt;BR /&gt;      CLEAR ls_aufnr.&lt;BR /&gt;*&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;BREAK-POINT.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Feb 2022 10:27:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528745#M2005256</guid>
      <dc:creator>former_member751715</dc:creator>
      <dc:date>2022-02-19T10:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: CX_SY_OPEN_SQL_DB Memory allocation failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528746#M2005257</link>
      <description>&lt;P&gt;The root cause is "memory allocation failed", you don't need to understand how the DB engine works, it would take too much time, but you can adjust till it works better. So, good that you found a solution. Also, search SAP notes like &lt;A href="https://launchpad.support.sap.com/#/notes/2906305"&gt;2906305 - HANA Query fails in Join engine results (JERequestedAttributes) with Memory allocation failed;exception 1000002 - SAP ONE Support Launchpad&lt;/A&gt;...&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 12:08:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528746#M2005257</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-02-19T12:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: CX_SY_OPEN_SQL_DB Memory allocation failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528747#M2005258</link>
      <description>&lt;P&gt;Ok i understand. Thank you for help.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 12:13:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-sy-open-sql-db-memory-allocation-failed/m-p/12528747#M2005258</guid>
      <dc:creator>former_member751715</dc:creator>
      <dc:date>2022-02-19T12:13:22Z</dc:date>
    </item>
  </channel>
</rss>

