<?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 to change Accounting Document Header in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671384#M616792</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;Check this example code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: bapiache08, bapiacgl08,bapiaccr08, bapiret2.

DATA: t_bapiache08 LIKE TABLE OF bapiache08 WITH HEADER LINE,
t_bapiacgl08 LIKE TABLE OF bapiacgl08 WITH HEADER LINE,
t_bapiaccr08 LIKE TABLE OF bapiaccr08 WITH HEADER LINE,
t_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE,
ct_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE.

t_bapiache08-obj_type = 'BKPFF'. "BKPFF
t_bapiache08-obj_key = '010000000000062005'.
t_bapiache08-obj_sys = 'T90CLNT800'. "T09CLNT800
t_bapiache08-username = 'SSI4'.

t_bapiache08-header_txt = 'DOCUMENT POSTING'.
t_bapiache08-comp_code = '1000'.
t_bapiache08-fisc_year = '2005'.
t_bapiache08-doc_date = '20050805'.
t_bapiache08-pstng_date = '20050805'.
t_bapiache08-fis_period = '07'.
t_bapiache08-doc_type = 'SA'.
t_bapiache08-compo_acc = 'FI'. "GL

APPEND t_bapiache08.

t_bapiacgl08-itemno_acc = '031'.
t_bapiacgl08-gl_account = '160000'.
t_bapiacgl08-comp_code = '1000'.
t_bapiacgl08-pstng_date = '20050805'.
t_bapiacgl08-doc_type = 'SA'.
t_bapiacgl08-fisc_year = '2005'.
t_bapiacgl08-fis_period = '07'.
t_bapiacgl08-stat_con = 'X'.
t_bapiacgl08-vendor_no = '1920'. "ACCOUNTING NO.FOR VENDOR/CREDITOR.
t_bapiacgl08-item_text = 'LINE ITEM TEXT BY VIN'.

APPEND t_bapiacgl08.


t_bapiaccr08-itemno_acc = '031'.
t_bapiaccr08-currency_iso = 'EUR'.
t_bapiaccr08-amt_doccur = '2000'.
APPEND t_bapiaccr08.



CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = t_bapiache08
* IMPORTING
* OBJ_TYPE =
* OBJ_KEY =
* OBJ_SYS =
TABLES
accountgl = t_bapiacgl08
currencyamount = t_bapiaccr08
return = t_bapiret2
* EXTENSION1 =
.


LOOP AT t_bapiret2.
WRITE :/ t_bapiret2-type, t_bapiret2-id, t_bapiret2-number,
t_bapiret2-message,t_bapiret2-parameter,
t_bapiret2-row, t_bapiret2-field, t_bapiret2-system.
ENDLOOP.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
IMPORTING
return = ct_bapiret2.


LOOP AT ct_bapiret2.
WRITE :/ ct_bapiret2-type, ct_bapiret2-id, ct_bapiret2-number,
ct_bapiret2-message,ct_bapiret2-log_no, ct_bapiret2-parameter,
ct_bapiret2-row, ct_bapiret2-field, ct_bapiret2-system.
ENDLOOP.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2007 04:06:08 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-08-16T04:06:08Z</dc:date>
    <item>
      <title>BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671382#M616790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to go into an existing document (Billing Doc.) and change the Reference field (XBLNR).  The business requirement is specifically to modify the BKPF-XBLNR field to contain a new reference.  Is there a BAPI that can be used to modify accounting header details?  All the accounting BAPI's I can find seem to be for posting a new record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded for helpful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 03:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671382#M616790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T03:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671383#M616791</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;Try with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. BAPI_ACC_GL_POSTING_POST &lt;/P&gt;&lt;P&gt;2. BAPI_ACC_DOCUMENT_POST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 04:03:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671383#M616791</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-16T04:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671384#M616792</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;Check this example code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: bapiache08, bapiacgl08,bapiaccr08, bapiret2.

DATA: t_bapiache08 LIKE TABLE OF bapiache08 WITH HEADER LINE,
t_bapiacgl08 LIKE TABLE OF bapiacgl08 WITH HEADER LINE,
t_bapiaccr08 LIKE TABLE OF bapiaccr08 WITH HEADER LINE,
t_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE,
ct_bapiret2 LIKE TABLE OF bapiret2 WITH HEADER LINE.

t_bapiache08-obj_type = 'BKPFF'. "BKPFF
t_bapiache08-obj_key = '010000000000062005'.
t_bapiache08-obj_sys = 'T90CLNT800'. "T09CLNT800
t_bapiache08-username = 'SSI4'.

t_bapiache08-header_txt = 'DOCUMENT POSTING'.
t_bapiache08-comp_code = '1000'.
t_bapiache08-fisc_year = '2005'.
t_bapiache08-doc_date = '20050805'.
t_bapiache08-pstng_date = '20050805'.
t_bapiache08-fis_period = '07'.
t_bapiache08-doc_type = 'SA'.
t_bapiache08-compo_acc = 'FI'. "GL

APPEND t_bapiache08.

t_bapiacgl08-itemno_acc = '031'.
t_bapiacgl08-gl_account = '160000'.
t_bapiacgl08-comp_code = '1000'.
t_bapiacgl08-pstng_date = '20050805'.
t_bapiacgl08-doc_type = 'SA'.
t_bapiacgl08-fisc_year = '2005'.
t_bapiacgl08-fis_period = '07'.
t_bapiacgl08-stat_con = 'X'.
t_bapiacgl08-vendor_no = '1920'. "ACCOUNTING NO.FOR VENDOR/CREDITOR.
t_bapiacgl08-item_text = 'LINE ITEM TEXT BY VIN'.

APPEND t_bapiacgl08.


t_bapiaccr08-itemno_acc = '031'.
t_bapiaccr08-currency_iso = 'EUR'.
t_bapiaccr08-amt_doccur = '2000'.
APPEND t_bapiaccr08.



CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = t_bapiache08
* IMPORTING
* OBJ_TYPE =
* OBJ_KEY =
* OBJ_SYS =
TABLES
accountgl = t_bapiacgl08
currencyamount = t_bapiaccr08
return = t_bapiret2
* EXTENSION1 =
.


LOOP AT t_bapiret2.
WRITE :/ t_bapiret2-type, t_bapiret2-id, t_bapiret2-number,
t_bapiret2-message,t_bapiret2-parameter,
t_bapiret2-row, t_bapiret2-field, t_bapiret2-system.
ENDLOOP.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '
IMPORTING
return = ct_bapiret2.


LOOP AT ct_bapiret2.
WRITE :/ ct_bapiret2-type, ct_bapiret2-id, ct_bapiret2-number,
ct_bapiret2-message,ct_bapiret2-log_no, ct_bapiret2-parameter,
ct_bapiret2-row, ct_bapiret2-field, ct_bapiret2-system.
ENDLOOP.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 04:06:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671384#M616792</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-16T04:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671385#M616793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi a®s,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In using these BAPI's, do I need to re-create each line item from the original document in order for the change document to post?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, is there a 'Get' bapi that can return these values ready for 're' posting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 04:29:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671385#M616793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T04:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671386#M616794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turned out there is a function module (FI_DOCUMENT_CHANGE) that updates the required fields for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 01:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671386#M616794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T01:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI to change Accounting Document Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671387#M616795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I saw your requirement which was you posted, I have also similar requirement but i need to change Reference field value ( BKPF-XBLNR) in Transaction code - FB02. So if you used function module&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;(FI_DOCUMENT_CHANGE)&amp;nbsp; and got exact requirement can you help me how did you done and how you passed parameter there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Thanks,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-to-change-accounting-document-header/m-p/2671387#M616795</guid>
      <dc:creator>ram_sahoo</dc:creator>
      <dc:date>2015-02-06T11:46:31Z</dc:date>
    </item>
  </channel>
</rss>

