Skip to Content
0
Former Member
Nov 10, 2005 at 02:09 AM

BAPI_ACC_DOCUMENT_POST

984 Views

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