<?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: Issue with CDHDR select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520204#M1934321</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #333333; font-size: 12px;"&gt; Vadamalai,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just an advice..you should not use SELECT query on CDHDR and CHPOS as they are huge table and SAP does not recommend SELECT on any such huge table.in production it can cause an performance issue.&lt;/P&gt;&lt;P&gt;try using FM &lt;SPAN style="color: #333333; font-size: 12px;"&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;CHANGEDOCUMENT_READ_HEADERS to read header and &lt;SPAN style="color: #333333; font-size: 12px;"&gt;CHANGEDOCUMENT_READ_POSITIONS for items.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;how to pass the data to these FMs you can check on below link.&lt;/P&gt;&lt;P&gt; &lt;A href="https://scn.sap.com/thread/1315600" title="https://scn.sap.com/thread/1315600"&gt;Function Module to Read Change Documents from T... | SCN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Menka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jan 2016 03:58:37 GMT</pubDate>
    <dc:creator>former_member479995</dc:creator>
    <dc:date>2016-01-05T03:58:37Z</dc:date>
    <item>
      <title>Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520201#M1934318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing piece of code in driver program(&amp;nbsp;&amp;nbsp; FORM ENTRY_NEU configured in NACE).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During change PO the output type will be called and calling the &lt;SPAN style="font-size: 13.3333px;"&gt;FORM ENTRY_NEU as well. I have written the below code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT objectclas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; changenr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; udate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; utime&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM cdhdr INTO TABLE i_cdhdr&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE&amp;nbsp; objectclas = 'EINKBELEG'&lt;/P&gt;&lt;P&gt;&amp;nbsp; AND objectid = lv_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During debug mode I could see 20 records but when I see 19 entries in table CDHDR(SE16)&lt;/P&gt;&lt;P&gt;I am taking latest updated entries from CDHDR and select from CDPOS(no records on change number)&lt;/P&gt;&lt;P&gt;Due to some discrepancy our logic is failing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any commit work issue or what could be the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;A Vadamalai.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 06:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520201#M1934318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-04T06:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520202#M1934319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vadamalai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess, the custom output type which you have used has the output condition records with Dispatch Time as "Immediate".&amp;nbsp; If you need to refer the tables for this corresponding change, you would need to set the Dispatch time as "Processing using own transaction" or any other mode and let the standard completely update the standard tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try by changing the output condition records and let us know. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Karthikeyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 06:46:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520202#M1934319</guid>
      <dc:creator>karthikeyan_p3</dc:creator>
      <dc:date>2016-01-04T06:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520203#M1934320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthikeyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier it was working fine with the same setup "Immediate".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise some alternate way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;A Vadamalai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 01:30:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520203#M1934320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-05T01:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520204#M1934321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #333333; font-size: 12px;"&gt; Vadamalai,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just an advice..you should not use SELECT query on CDHDR and CHPOS as they are huge table and SAP does not recommend SELECT on any such huge table.in production it can cause an performance issue.&lt;/P&gt;&lt;P&gt;try using FM &lt;SPAN style="color: #333333; font-size: 12px;"&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;CHANGEDOCUMENT_READ_HEADERS to read header and &lt;SPAN style="color: #333333; font-size: 12px;"&gt;CHANGEDOCUMENT_READ_POSITIONS for items.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;how to pass the data to these FMs you can check on below link.&lt;/P&gt;&lt;P&gt; &lt;A href="https://scn.sap.com/thread/1315600" title="https://scn.sap.com/thread/1315600"&gt;Function Module to Read Change Documents from T... | SCN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Menka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 03:58:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520204#M1934321</guid>
      <dc:creator>former_member479995</dc:creator>
      <dc:date>2016-01-05T03:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520205#M1934322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vadamalai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tested the same in my system. The changes are written using the function module &lt;EM&gt;EINKBELEG_WRITE_DOCUMENT&lt;/EM&gt;. The table CDHDR &amp;amp; CDPOS updates happen in the FM &lt;EM&gt;CHANGEDOCUMENT_CLOSE&lt;/EM&gt;. In the form &lt;EM&gt;write_normal_changedocu,&lt;/EM&gt; CDHDR is updated using the statement &lt;STRONG&gt;INSERT INTO , &lt;/STRONG&gt;while the CDPOS is updated using&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INSERT (pv_tabname) FROM TABLE pt_in.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Documentation as on help.sap for the above Insert from&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Notes &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The inserted rows are included permanently in the table in the next database commit. Up until this point, they can still be removed by a database rollback. &lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMO, SAP calls the update function modules in a predefined order. &lt;EM style="font-size: 13.3333px;"&gt;EINKBELEG_WRITE_DOCUMENT &lt;/EM&gt;gets executed ahead of RV_MESSAGE_UPDATE. So CDHDR is updated using INSERT INTO &amp;amp; updates the record in the table. CDPOS is updated using INSERT FROM, the records will be updated only in the next database commit (SAP issues the commit after all the update function modules are executed). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;RV_MESSAGE_UPDATE triggers your custom output type and&lt;/SPAN&gt; you are selecting the CDPOS before SAP issues the final commit and so you are not able to see the table entries in CDPOS for that change number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest you to change the dispatch time other than "Immediate" or&lt;/P&gt;&lt;P&gt;1. Wrap all your CDPOS selection logic, email code to a function module 'Z_CALL_IN_NEW_LUW&lt;/P&gt;&lt;P&gt;2. In your output type call&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION '&lt;SPAN style="font-size: 13.3333px;"&gt;Z_CALL_IN_NEW_LUW&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IN BACKGROUND TASK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS SEPARATE UNIT&lt;/P&gt;&lt;P&gt;&amp;nbsp; EXPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;your data&amp;gt;&lt;/P&gt;&lt;P&gt;3. In &lt;SPAN style="font-size: 13.3333px;"&gt;Z_CALL_IN_NEW_LUW, check if the PO is not locked and write the select query to fetch CDPOS. (As &lt;SPAN style="font-size: 13.3333px;"&gt;Z_CALL_IN_NEW_LUW is called as a separate unit, it will be called in a new LUW. By this time CDPOS data will be saved to database.) write your logic using the fetched values of CDPOS.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Karthikeyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 11:09:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520205#M1934322</guid>
      <dc:creator>karthikeyan_p3</dc:creator>
      <dc:date>2016-01-05T11:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with CDHDR select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520206#M1934323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Menka Dahiya wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;..you should not use SELECT query on CDHDR and CHPOS as they are huge table and SAP does not recommend SELECT on any such huge table.in production it can cause an performance issue.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is nothing wrong with SELECTing from large tables and SAP does &lt;SPAN style="text-decoration: underline;"&gt;not&lt;/SPAN&gt; recommend against it; they do it themselves. You just have to be careful that you are using indexes wisely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 14:52:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-cdhdr-select-query/m-p/11520206#M1934323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-01-05T14:52:22Z</dc:date>
    </item>
  </channel>
</rss>

