Skip to Content
Dec 01, 2009 at 11:28 AM

How to create CO-PA document via BAPI_ACC_DOCUMENT_POST


Hi Gurus

I'm using BAPI_ACC_DOCUMENT_POST to post a FI document in background according the process in TCODE FB01. Right now the FI document can be posted whereas the information relavent to profitability analysis (CO-PA) was lost. I do not know how should i fill the parameters so that the profitability analysis data can be populated simutanencely.

i've passed the ledger information to BAPI via BADI ACC_DOUCMENT.

here is my code:

    c_bus_act         TYPE glvor VALUE 'RFBU'.
    <fi_upload>       TYPE LINE  OF ty_excel_template,
    <return>          TYPE          bapiret2.
    st_docheader      TYPE          bapiache09,
    lt_accountgl      TYPE TABLE OF bapiacgl09,
    wa_accountgl      TYPE          bapiacgl09,
    lt_currencyamount TYPE TABLE OF bapiaccr09,
    wa_currencyamount TYPE          bapiaccr09,
    lt_extension      TYPE TABLE OF bapiacextc,
    wa_extension      TYPE          bapiacextc,
    lt_extension2     TYPE TABLE OF bapiparex,
    wa_extension2     TYPE          bapiparex,
    lt_return         TYPE TABLE OF bapiret2,
    lv_obj_key        TYPE          awkey,
    lv_ktonr          TYPE          ktonr

Edited by: Stephen Xue on Dec 1, 2009 12:28 PM