‎2005 Nov 10 2:09 AM
I am trying to use this BAPI (BAPI_ACC_DOCUMENT_POST) to post documents for F-02 (G/L Account Posting). I populated the required information in the internal tables required for the BAPI then when the BAPI is called, a new document is created. But the new document # is not found in the BKPF or the BSEG table. I call the BAPI_TRANSACTION_COMMIT. Please let me know if I am missing any thing.
Here is the Header info
t_header-bus_act = 'RFBU'.
t_header-obj_type = 'BKPFF'."Reference procedure
t_header-obj_key = '$'."Reference Key
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = t_header-obj_sys
EXCEPTIONS
own_logical_system_not_defined = 1
OTHERS = 2.
t_header-username = sy-uname."User name
t_header-header_txt = tab_input-bktxt."Document Header Text
t_header-obj_key_r = ' '.
"Cancel: object key (AWREF_REV and AWORG_REV)
t_header-comp_code = tab_input-bukrs."Company Code
t_header-ac_doc_no = tab_input-saknr."Accounting Document
*Number
t_header-fisc_year = tab_input-budat+6(4)."Fiscal Year
PERFORM convert_date USING tab_input-bldat l_date.
t_header-doc_date = l_date."Document Date in Document
PERFORM convert_date USING tab_input-budat l_date.
t_header-pstng_date = l_date."Posting Date in the Docu
PERFORM convert_date USING tab_input-budat l_date.
t_header-trans_date = l_date."Translation date
t_header-fis_period = tab_input-budat+3(2)."Fiscal Period
t_header-doc_type = tab_input-blart."Document type
t_header-ref_doc_no = tab_input-xblnr."Reference Document Number
‎2005 Nov 10 3:09 AM
Hi Rajiv,
I am using the BAPI successfully.
In the t_header, leave the obj_type and obj_key blank.
Hope this helps,
Bhanu
‎2005 Nov 10 3:46 AM
Hi,
Check this link.
http://funciones.sapabap.cc/DocuFuncion.asp?Id=515
Kindly reward points by clicking the star on the left of reply,if it helps.
‎2005 Nov 10 3:48 AM
Here is the docu for the function module. Follwo the steps:
FU BAPI_ACC_DOCUMENT_POST
____________________________________________________
Text
Accounting: Posting
Functionality
Using this method you can create a posing in accounting for certain business transactions.
Possible ( Business Transactions):
Postings that generally only affect the general ledger. (RFBU)
Billing: For billing in Sales and Distribution, accounting is supplied with the relevant billing data. (SD00) Billing Document
Accounting can use the data of a logistics system that result from an Invoice Receipt. (RMRP)
Goods Movement are triggered by transactions in Sales and Distribution or by inventory postings. Within logistics, they lead to a change in the warehouse stocks of <DS:GLOS.Inventory Management>Inventory Management. This results in a posting in accounting. This is why accounting is supplied with the relevant data from logistics. (RMWA)
Example
Billing document:
By selling goods in accordance with targets, revenue is generated. The revenue is posted in billing and forwarded to accounting.
Invoice receipt:
Raw materials are purchased in accordance with targets. The invoice receipt is posted in a logistics system. The data from the raw materials is forwarded to accounting.
Goods Movment:
The use of raw materials leads to a change in stock in inventory managment. The posting of raw material consumption is forwarded to accounting.
G/L Account Posting:
Provision posting for an expected warranty service. This can refer to acquisitions or retirements belonging to stocks that are not in subledger accounting relevant to inventory management. This is particularly the case if such materials are not displayed as vendor/customer, materials, loans etc. or cannot be displayed in this way. This can also refer to write-ups or depreciation that contain higher aggregations of values than are maintained in a corresponding subledger that is relevant to inventory management.
The conversion of foreign currencies for receivables/payables due to large exchange rate changes that should not lead to an update of the accounts payable or accounts receivable accounting. A similar transaction can arise for the revaluation of raw materials if this revaluation takes place at a correspondingly aggreagated level.
Reclassification of inventory of P&L statement accounts that are only used for reconcilliation purposes in the general ledger (this rearranges values for balance sheet items).
Balance reclassifications of stocks to receivables with different return times.
Notes
If the parameter CurrencyAmount is filled with the currency fields, a complete document check including characteristics and value components of profitability analysis (CO-PA). Otherwise, the account assignment objects are checked.
Messages are returned in the parameter Return. In the parameter documentation you can find the return values and their meaning.
Further Information
You can find further information in the SAP Library under "Financials -> Accounting - General (AC) -> Interfaces to Accounting (AC)".
Parameters
DOCUMENTHEADER
CUSTOMERCPD
CONTRACTHEADER
OBJ_TYPE
OBJ_KEY
OBJ_SYS
ACCOUNTGL
ACCOUNTRECEIVABLE
ACCOUNTPAYABLE
ACCOUNTTAX
CURRENCYAMOUNT
CRITERIA
VALUEFIELD
EXTENSION1
RETURN
PAYMENTCARD
CONTRACTITEM
EXTENSION2
REALESTATE
Exceptions
Function Group
ACC9