<?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: BAPI_ACC_DOCUMENT_POST extension in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295570#M1989804</link>
    <description>&lt;P&gt;Calling report
should look something like this for any of the Accounting document update
BAPIs:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT YACCT_DOC_UPDATE.

DATA ls_header TYPE bapiache08.
DATA lt_glaccount TYPE STANDARD TABLE OF bapiacgl08.
DATA lt_currency TYPE STANDARD TABLE OF bapiaccr08.
DATA lt_ext TYPE STANDARD TABLE OF bapiextc.
DATA lt_return TYPE STANDARD TABLE OF bapiret2.

* This is copied from an old project. Use any values that make sense to you
lt_ext = VALUE #( 
field1 = |{ bkpf-mblnr WIDTH = 10 }{ bkpf-mjahr }{ bkpf-zeile }| 
field2 = '0000000005' 
field3 = 'YACCT_DOC_UPDATE' 
field4 = |{ ekpo-mwskz WIDTH = 2 }{ ekpo-txjcd WIDTH = 16 }| ).

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING 
  documentheader = ls_header
TABLES 
  accountgl = lt_glaccount 
  currencyamount = lt_currency 
  extension1 = lt_ext
  return = lt_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;OL&gt;
 
&lt;LI&gt;Create an enhancement project
     in transaction CMOD&lt;/LI&gt; 
&lt;LI&gt;Assign enhancement ACBAPI01
     to the project&lt;/LI&gt; 
&lt;LI&gt;Save and activate the project&lt;/LI&gt; 
&lt;LI&gt;Navigate to the component
     EXIT_SAPLACC4_001&lt;/LI&gt; 
&lt;LI&gt;Double-click into the
     function, continue clicking into include ZXACCU15 &lt;/LI&gt; 
&lt;LI&gt;Paste the following code:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT extension ASSIGNING FIELD-SYMBOL(&amp;lt;ext&amp;gt;) 
WHERE field2 EQ '0000000005'AND field3 EQ 'YACCT_DOC_UPDATE'.
  LOOP AT t_accit ASSIGNING FIELD-SYMBOL(&amp;lt;accit&amp;gt;) FROM 5 TO 5. 
    &amp;lt;accit&amp;gt;-mwskz = &amp;lt;ext&amp;gt;-field4+00(02). "Tax on sales/purchases code 
    &amp;lt;accit&amp;gt;-txjcd = &amp;lt;ext&amp;gt;-field4+02(15). "Tax Jurisdiction
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This should be enough to get you started.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Sep 2020 15:43:40 GMT</pubDate>
    <dc:creator>juan_suros</dc:creator>
    <dc:date>2020-09-21T15:43:40Z</dc:date>
    <item>
      <title>BAPI_ACC_DOCUMENT_POST extension</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295569#M1989803</link>
      <description>&lt;P&gt;I need to add a custom field that does not require between the structures.&lt;/P&gt;
  &lt;P&gt; give me an example of even a trivial code of how to implement extension structures etc. to pass the field name and value?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:32:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295569#M1989803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-09-21T14:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST extension</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295570#M1989804</link>
      <description>&lt;P&gt;Calling report
should look something like this for any of the Accounting document update
BAPIs:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT YACCT_DOC_UPDATE.

DATA ls_header TYPE bapiache08.
DATA lt_glaccount TYPE STANDARD TABLE OF bapiacgl08.
DATA lt_currency TYPE STANDARD TABLE OF bapiaccr08.
DATA lt_ext TYPE STANDARD TABLE OF bapiextc.
DATA lt_return TYPE STANDARD TABLE OF bapiret2.

* This is copied from an old project. Use any values that make sense to you
lt_ext = VALUE #( 
field1 = |{ bkpf-mblnr WIDTH = 10 }{ bkpf-mjahr }{ bkpf-zeile }| 
field2 = '0000000005' 
field3 = 'YACCT_DOC_UPDATE' 
field4 = |{ ekpo-mwskz WIDTH = 2 }{ ekpo-txjcd WIDTH = 16 }| ).

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING 
  documentheader = ls_header
TABLES 
  accountgl = lt_glaccount 
  currencyamount = lt_currency 
  extension1 = lt_ext
  return = lt_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;OL&gt;
 
&lt;LI&gt;Create an enhancement project
     in transaction CMOD&lt;/LI&gt; 
&lt;LI&gt;Assign enhancement ACBAPI01
     to the project&lt;/LI&gt; 
&lt;LI&gt;Save and activate the project&lt;/LI&gt; 
&lt;LI&gt;Navigate to the component
     EXIT_SAPLACC4_001&lt;/LI&gt; 
&lt;LI&gt;Double-click into the
     function, continue clicking into include ZXACCU15 &lt;/LI&gt; 
&lt;LI&gt;Paste the following code:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT extension ASSIGNING FIELD-SYMBOL(&amp;lt;ext&amp;gt;) 
WHERE field2 EQ '0000000005'AND field3 EQ 'YACCT_DOC_UPDATE'.
  LOOP AT t_accit ASSIGNING FIELD-SYMBOL(&amp;lt;accit&amp;gt;) FROM 5 TO 5. 
    &amp;lt;accit&amp;gt;-mwskz = &amp;lt;ext&amp;gt;-field4+00(02). "Tax on sales/purchases code 
    &amp;lt;accit&amp;gt;-txjcd = &amp;lt;ext&amp;gt;-field4+02(15). "Tax Jurisdiction
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This should be enough to get you started.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 15:43:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295570#M1989804</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2020-09-21T15:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST extension</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295571#M1989805</link>
      <description>&lt;P&gt;Most relevant to what you are looking for. Check &lt;A href="https://blogs.sap.com/2018/03/27/enlarging-the-use-of-bapi_acc_document_post/"&gt;this&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 16:39:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295571#M1989805</guid>
      <dc:creator>GK817</dc:creator>
      <dc:date>2020-09-21T16:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST extension</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295572#M1989806</link>
      <description>&lt;P&gt;I did not understand the procedure well.
I need to add the value of the ZTERM field of the BSEG table, but after running the bapi it does not populate the field&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 09:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295572#M1989806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-09-23T09:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_DOCUMENT_POST extension</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295573#M1989807</link>
      <description>&lt;P&gt;I see there is a field ACCIT-ZTERM in structure accit, so the code added to include ZXACCU15 should be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT extension ASSIGNING FIELD-SYMBOL(&amp;lt;ext&amp;gt;)
WHERE field1 EQ 'KEY1'
  AND field2 EQ 'KEY2'.
  AND field3 EQ 'KEY3'.
  LOOP AT t_accit ASSIGNING FIELD-SYMBOL(&amp;lt;accit&amp;gt;).
    &amp;lt;accit&amp;gt;-zterm =&amp;lt;ext&amp;gt;-field4.
  ENDLOOP.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am using "KEY" values in the first three fields of the EXTENSION record to safely identify the passed values from any other use of this table. If you do not have ABAP resources available the solution proposed by "&lt;SPAN class="mention-scrubbed"&gt;gaurav.karkara3&lt;/SPAN&gt;" may be a better idea.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 17:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-document-post-extension/m-p/12295573#M1989807</guid>
      <dc:creator>juan_suros</dc:creator>
      <dc:date>2020-09-25T17:14:52Z</dc:date>
    </item>
  </channel>
</rss>

