<?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: Change Document issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752960#M1114709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SAP Lover&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Nov 2008 09:10:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-05T09:10:39Z</dc:date>
    <item>
      <title>Change Document issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752959#M1114708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I have created one change document in SCDO transaction. I am using that function module in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are the parameters, I am passing to the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;objectid = p_objid.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;tcode = sy-tcode.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;utime = sy-uzeit.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;udate = sy-datum.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;username = sy-uname.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;upd_psacl_tab = 'U'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"XPSACL_TAB contains only one record.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;eg.,  Key         Field1           Field2         KZ&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;1.      A1          ABC             123             U              (Record after modification)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"YPSACL_TAB contains 2 records&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;&lt;U&gt;eg.,  Key          Field1           Field2            KZ&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;1.      A1         DEF              345               U            (Record before modification)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;2.      B1         XYZ               567               E            (Deleted record)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;( In the above table, first record - the value of the Field1 and Field2 are changed )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;CALL FUNCTION 'CNACL_WRITE_DOCUMENT' IN UPDATE TASK&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;EXPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;OBJECTID                = OBJECTID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;TCODE                   = TCODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;UTIME                   = UTIME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;UDATE                   = UDATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;USERNAME                = USERNAME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;PLANNED_CHANGE_NUMBER   = PLANNED_CHANGE_NUMBER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;OBJECT_CHANGE_INDICATOR = CDOC_UPD_OBJECT&lt;/STRONG&gt;                       "value = 'U'&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;PLANNED_OR_REAL_CHANGES = CDOC_PLANNED_OR_REAL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;NO_CHANGE_POINTERS      = CDOC_NO_CHANGE_POINTERS&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;updateflag of PSACL_TAB*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;          &lt;STRONG&gt;UPD_PSACL_TAB          = UPD_PSACL_TAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;UPD_ICDTXT_CNACL      = UPD_ICDTXT_CNACL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;TABLES&lt;/STRONG&gt;        &lt;/P&gt;&lt;P&gt;           &lt;STRONG&gt;ICDTXT_CNACL&lt;/STRONG&gt;            &lt;STRONG&gt;= ICDTXT_CNACL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;           &lt;STRONG&gt;XPSACL_TAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                      &lt;STRONG&gt;= XPSACL_TAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;YPSACL_TAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;                      &lt;STRONG&gt;= YPSACL_TAB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is after calling this function module, change document is created. When I look into the CDPOS table, the records are created as 2 deleted records(chngind = E) and 1 inserted record(chngind = I). But I need 2 records, one deleted (chngind = E) and another updated record (chngind = U) with old and new values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(But the same function module is working fine if I pass either only deleted records in YPSACL_TAB table or only updated records, 1record in YPSACL_TAB and 1 record in XPSACL_TAB table . I am confused.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any mistake in my code or parameter values?  Please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SAP Lover.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2008 06:52:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752959#M1114708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-05T06:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change Document issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752960#M1114709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SAP Lover&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2008 09:10:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752960#M1114709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-05T09:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change Document issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752961#M1114710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the primary key of the table, if the changed field is a part of the primary key then the record will be deleated and re-created.&lt;/P&gt;&lt;P&gt;Since it is not possible to modify the primary key of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover you need to provide more details of the table , also you  need to evaluate the last field of the X and Y table in debug mode, that will tell you what exactly it will do 'I' - Inser 'D' - Delete , U - Update.&lt;/P&gt;&lt;P&gt;but if it marked as update , and the primary key has been changed then the only option is to delete the record and re-create with the change in the primary key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this is the reason you get 2 change docs with 'delete' opeation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Nov 2008 09:16:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-document-issue/m-p/4752961#M1114710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-05T09:16:28Z</dc:date>
    </item>
  </channel>
</rss>

