Skip to Content
author's profile photo Former Member
Former Member

posting data using bapi

hi,

how to post some data for transaction f-02 using bapi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 09:03 AM

    Hi,

    Use the following BAPI.

    BAPI_ACC_GL_POSTING_POST

    Regards,

    Asmitha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 09:06 AM

    Hi bharat,

    use this to post the data.

    *********************************************************************

    • DATA DECLARATION

    **********************************************************************

    *

    *&---HEADER DECLARATION

    data: header type bapiache09. " HEADER DATA

    **********************************************************************

    • INTERNAL TABLE DECLARATION

    **********************************************************************

    *&----G/L ACCOUNT ITEM

    data: accountgl type standard table of bapiacgl09.

    *&---g/l Account tax

    data: account_tax type standard table of bapiactx09.

    *&---CURRENCY ITEMS

    data: currency_amount type standard table of bapiaccr09.

    *&----RETURN PARAMETER

    data: return type standard table of bapiret2 with header line.

    **********************************************************************

    • WORK-AREA DECLARATION

    **********************************************************************

    *&----WORKAREA FOR G/L ACCOUNT ITEM

    data: wa_accountgl type bapiacgl09.

    *&---WORKAREA FOR CURRENCY ITEMS

    data: wa_currency_amount type bapiaccr09.

    *&---WORKAREA FOR TAX ITEMS

    data: wa_tax type bapiactx09.

    **********************************************************************

    • INITIALIZATION

    **********************************************************************

    header-header_txt = 'TEST HEADER'.

    header-username = 'DEVELOPER'.

    header-comp_code = '0002'.

    header-fisc_year = '2007'.

    header-doc_date = '20070502'.

    header-pstng_date = '20070502'.

    header-trans_date = '20070502'.

    header-doc_type = 'SA'.

    header-bus_act = 'RFBU'.

    wa_accountgl-itemno_acc = '0000000010'.

    wa_accountgl-gl_account = '0000113020'.

    wa_accountgl-item_text = 'SO_DOC'.

    wa_accountgl-de_cre_ind = 'S'.

    append wa_accountgl to accountgl.

    clear wa_accountgl.

    wa_accountgl-itemno_acc = '0000000020'.

    wa_accountgl-gl_account = '0000113020'.

    wa_accountgl-item_text = 'SO_DOC'.

    wa_accountgl-de_cre_ind = 'H'.

    append wa_accountgl to accountgl.

    clear wa_accountgl.

    wa_currency_amount-itemno_acc = '0000000010'.

    wa_currency_amount-amt_doccur = '500'.

    wa_currency_amount-currency = 'INR'.

    append wa_currency_amount to currency_amount.

    clear wa_currency_amount.

    wa_currency_amount-itemno_acc = '0000000020'.

    wa_currency_amount-amt_doccur = '-500'.

    wa_currency_amount-currency = 'INR'.

    append wa_currency_amount to currency_amount.

    clear wa_currency_amount.

    *WA_TAX-ITEMNO_ACC = '0000000010'.

    *WA_TAX-TAX_CODE = 'V0'.

    *APPEND WA_TAX TO ACCOUNT_TAX.

    *CLEAR WA_TAX.

    *

    *WA_TAX-ITEMNO_ACC = '0000000020'.

    *WA_TAX-TAX_CODE = 'V0'.

    *APPEND WA_TAX TO ACCOUNT_TAX.

    *CLEAR WA_TAX.

    **************************************************************

    • START-OF-SELECTION

    **************************************************************

    start-of-selection.

    call function 'BAPI_ACC_DOCUMENT_POST'

    exporting

    documentheader = header

    • CUSTOMERCPD =

    • CONTRACTHEADER =

    • IMPORTING

    • OBJ_TYPE =

    • OBJ_KEY =

    • OBJ_SYS =

    tables

    accountgl = accountgl

    • ACCOUNTRECEIVABLE =

    • ACCOUNTPAYABLE =

    • ACCOUNTTAX = ACCOUNT_TAX

    currencyamount = currency_amount

    • CRITERIA =

    • VALUEFIELD =

    • EXTENSION1 =

    return = return

    • PAYMENTCARD =

    • CONTRACTITEM =

    • EXTENSION2 =

    • REALESTATE =

    .

    if return-type na 'EA'.

    call function 'BAPI_TRANSACTION_COMMIT'

    exporting

    wait = 'X'.

    • IMPORTING

    • RETURN = RETURN.

    write:/ return-message.

    else.

    write:/ return-message.

    endif.

    write:/ return-message+36(10).

    write:/ return+36(10).

    Regards

    Lalit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.