<?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 How to use BAPI_ACC_DOCUMENT_POST ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700232#M307032</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the parmaeters to be filled up essentially for calling this BAPI . What is meant by Object type parameter in this BAPI. Please reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2006 08:28:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-07T08:28:18Z</dc:date>
    <item>
      <title>How to use BAPI_ACC_DOCUMENT_POST ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700232#M307032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the parmaeters to be filled up essentially for calling this BAPI . What is meant by Object type parameter in this BAPI. Please reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 08:28:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700232#M307032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T08:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BAPI_ACC_DOCUMENT_POST ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700233#M307033</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;chk a sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* IF GL ACCOUNT
 
*       Accountgl / Compte générale
        ws_accountgl-itemno_acc   = w_compt.
        ws_accountgl-comp_code    = p_bukrs.
        ws_accountgl-pstng_date   = ws_reformat-datecpt.
        ws_accountgl-fisc_year    = ws_reformat-datecpt(4).
        ws_accountgl-fis_period   = ws_reformat-datecpt+4(2).
        ws_accountgl-doc_type     = p_blart.
        ws_accountgl-item_text    = ws_reformat-libel.
 
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ws_reformat-cptclf
          IMPORTING
            output = ws_accountgl-gl_account.
 
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ws_reformat-kostl
          IMPORTING
            output = ws_accountgl-costcenter.
 
      ELSE. " ACC. PAYABLE
 
*       Account Payable /  Compte fournisseur
        ws_accountpayable-itemno_acc   = w_compt.
        ws_accountpayable-comp_code    = p_bukrs.
        ws_accountpayable-item_text    = ws_reformat-libel.
 
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = ws_reformat-cptclf
          IMPORTING
            output = ws_accountpayable-vendor_no.
        APPEND ws_accountpayable TO accountpayable.
ENDIF.
 
*     Currencyamount Struct.
      ws_currencyamount-itemno_acc = w_compt.
      ws_currencyamount-currency = 'EUR'.
*     ws_currencyamount-curr_type = '00'.
      IF ws_reformat-sign EQ 'C'.
        ws_reformat-wrbtr_c = ws_reformat-wrbtr_c * ( - 1 ).
      ENDIF.
      ws_currencyamount-amt_doccur = ws_reformat-wrbtr_c.
      APPEND ws_currencyamount TO currencyamount.
 
 
* BAPI
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader = documentheader
      TABLES
        accountgl      = accountgl
        accountpayable = accountpayable
        currencyamount = currencyamount
        return         = t_return.
 
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE e999(re) WITH 'Problem occured'.
    ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hlped plsmark points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 08:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700233#M307033</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-11-07T08:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BAPI_ACC_DOCUMENT_POST ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700234#M307034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AA , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this BAPI has Documentation , So please check /read the documentation .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FU BAPI_ACC_DOCUMENT_POST        OBJ_TYPE
____________________________________________________
Text
Reference procedure

Source document
Description
When a business transaction is updated in Accounting, it may be that several documents are updated at the same time (FI document, CO document, etc). If the business transaction is not initiated in Accounting, a source document must exist outside Accounting. The information from this document must be transferred when the FI/CO interface is called up. The source information is updated in all accounting documents, and is made up of the following fields:

AWTYP (OBJ_TYPE) Reference transaction
Sender ID
AWKEY (OBJ_KEY) Reference key
Source document number
The reference key is made up of:
AWREF Reference document number (10 digits)
Source document number
AWORG Reference organizational unit (10 digits)
Number range ID (if required)
AWSYS (OBJ_SYS) Logical system
Logical system of source document
When the document is being processed, the system checks whether a reference document number (first part of the reference key) has been transferred.

Notes
Use a separate value in the OBJ_TYPE field (reference transaction). You must maintain an entry for this value in table TTYP, which could be a function module that is called when the user wants to branch back to the source/sender document from an accounting document. This makes it possible for documents updated using BAPIs to be included in the document navigation (revision). If you use SAP defined characters in the field OBJ_TYPE, errors can occur in the navigation.

The FI and CO line item suppression is defined separately for each reference transaction.

It is not necessary to separate the reference key into reference document number and reference organizational unit. This means that reference document numbers that are longer than 10 digits can be transferred into the reference key.


Function Module
BAPI_ACC_DOCUMENT_POST&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 08:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700234#M307034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T08:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BAPI_ACC_DOCUMENT_POST ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700235#M307035</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;Pass the parameters as below....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Document Header Structure.......&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------" /&gt;&lt;P&gt; BUS_ACT                        RFBU               &lt;/P&gt;&lt;P&gt; USERNAME                       GKUMARG            &lt;/P&gt;&lt;P&gt; COMP_CODE                      RIL                &lt;/P&gt;&lt;P&gt; DOC_DATE                       03.02.2006         &lt;/P&gt;&lt;P&gt; PSTNG_DATE                     03.02.2006         &lt;/P&gt;&lt;P&gt; FIS_PERIOD                     00                 &lt;/P&gt;&lt;P&gt; DOC_TYPE                       SA     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AccountGL Table....            &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------" /&gt;&lt;P&gt;ITEMNO_ACC   0000000001                                  &lt;/P&gt;&lt;P&gt;GL_ACCOUNT   113200                                      &lt;/P&gt;&lt;P&gt;ITEM_TEXT    TEST                                        &lt;/P&gt;&lt;P&gt;DOC_TYPE     SA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Currency Amount Table...&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------" /&gt;&lt;P&gt;ITEMNO_ACC     0000000001                          &lt;/P&gt;&lt;P&gt;CURRENCY_ISO   INR                                 &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;Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points if helpful....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ram Mohan Naidu Thammineni&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 08:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700235#M307035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T08:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to use BAPI_ACC_DOCUMENT_POST ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700236#M307036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;just check this sample code.&lt;/P&gt;&lt;P&gt;REPORT gl_posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structure for document header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_docheader   LIKE bapiache08,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table and header for G/L Account Line Items&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gi_accountgl  TYPE STANDARD TABLE OF bapiacgl08,&lt;/P&gt;&lt;P&gt;  g_accountgl   LIKE bapiacgl08,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table and header for Line Item Currency Fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gi_amount     TYPE STANDARD TABLE OF bapiaccr08,&lt;/P&gt;&lt;P&gt;  g_amount      LIKE bapiaccr08,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Return&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gi_return     TYPE STANDARD TABLE OF bapiret2,&lt;/P&gt;&lt;P&gt;  g_return      LIKE bapiret2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HEADER DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; OBJ_TYPE Objekttypes can be found in table TTYP&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; OBJ_KEY  Seems that you can use any value&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; OBJ_SYS  Logical system. Logical ystems can be found in&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          table TBDLS. If there is no logical system assigned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          to the client, assign it this way:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           Transaction: SPRO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           - Basis components&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             - Application Link Enabling (ALE)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              - Sending and receiving systems&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                - Logical systems&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  - Define logical system&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                    - Assign client o logical system&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;P&gt;  g_docheader-obj_type    = 'BKPFF'.&lt;/P&gt;&lt;P&gt;  g_docheader-obj_key     = '1'.&lt;/P&gt;&lt;P&gt;  g_docheader-obj_sys     = 'B3TCLNT800'.&lt;/P&gt;&lt;P&gt;  g_docheader-username    = sy-uname.&lt;/P&gt;&lt;P&gt;  g_docheader-header_txt  = 'BAPI test'.&lt;/P&gt;&lt;P&gt;  g_docheader-comp_code   = '1000'.&lt;/P&gt;&lt;P&gt;  g_docheader-doc_date    = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND g_amount TO gi_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LINE ITEMS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Item 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_accountgl-itemno_acc  = '0000000001'.&lt;/P&gt;&lt;P&gt;  g_accountgl-gl_account  = '0000192600'.&lt;/P&gt;&lt;P&gt;  g_accountgl-pstng_date  = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND g_accountgl TO gi_accountgl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Item 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_accountgl-itemno_acc  = '0000000002'.&lt;/P&gt;&lt;P&gt;  g_accountgl-gl_account  = '0000192600'.&lt;/P&gt;&lt;P&gt;  g_accountgl-pstng_date  = sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND g_accountgl TO gi_accountgl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CURRENCY AND AMOUNT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Item 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_amount-itemno_acc     = '0000000001'.&lt;/P&gt;&lt;P&gt;  g_amount-currency       = 'EUR'.&lt;/P&gt;&lt;P&gt;  g_amount-amt_doccur     =  5000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND g_amount TO gi_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Item 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  g_amount-itemno_acc     = '0000000002'.&lt;/P&gt;&lt;P&gt;  g_amount-currency       = 'EUR'.&lt;/P&gt;&lt;P&gt;  g_amount-amt_doccur     = -5000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND g_amount TO gi_amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call the BAPI function&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      documentheader       = g_docheader&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_TYPE             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_KEY              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OBJ_SYS              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      accountgl            = gi_accountgl&lt;/P&gt;&lt;P&gt;      currencyamount       = gi_amount&lt;/P&gt;&lt;P&gt;      return               = gi_return&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXTENSION1           =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gi_return INTO g_return.&lt;/P&gt;&lt;P&gt;    WRITE: / g_return-message.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 08:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-bapi-acc-document-post/m-p/1700236#M307036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T08:39:53Z</dc:date>
    </item>
  </channel>
</rss>

