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

BAPI_ACC_DOCUMENT_POST - Header text not transferred!

Hello everyone,

I've this weird problem that document header text is not being transferred in the accounting document...rest everything is OK. Has anyone come across this problem before? I'm on ECC 5.0 system. I've copied program "ACC_BAPI_TEST_DOCUMENT" into a Z program and changed some fixed values specific to my client, for e.g. company code = 'AU01' etc.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2009 at 06:07 AM

    Because BAPI: BAPI_ACC_DOCUMENT_POST will Check BADI with Posting

    1.BADI Information:

    (1)Object Type Name(Interface) is IF_EX_AC_DOCUMENT (T-code: SE24)

    (2)Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK

    2.Reason:

    (1)Once This BADI has been created for any reason,

    BAPI:BAPI_ACC_DOCUMENT_CHECK & BAPI_ACC_DOCUMENT_POST

    will check it for Document Header Text

    (2)If Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK has been created for any reason,

    but Creator return an null Document Header Text, then BAPI will clear Document Header Text

    3.Solution:

    (1)Add source code into Method: CHANGE_INITIAL & CHANGE_AFTER_CHECK,

    please refer to (2) for detail source code below

    (2)

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

    DATA: wa_header TYPE acchd.

    IF sy-xprog EQ 'SAPLBPFC'.

    *---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_CHECK

    *---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_POST

    CLEAR wa_header.

    wa_header = im_document-header.

    ex_document-header-bktxt = wa_header-bktxt.

    CLEAR wa_header.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 13, 2009 at 07:13 AM

    Sorry! I have corrected source code

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

    DATA: wa_header TYPE acchd.

    IF sy-xprog NE 'SAPMSSY1'.

    *---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_POST

    *---<SAPCNVE > is for Posting(Tax) with BAPI: BAPI_ACC_DOCUMENT_POST

    *---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_CHECK

    CLEAR wa_header.

    wa_header = im_document-header.

    ex_document-header-bktxt = wa_header-bktxt.

    CLEAR wa_header.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 04, 2006 at 05:22 AM

    hi,

    pls chk this code.

    • 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 <> 0.

    MESSAGE e999(re) WITH 'Problem occured'.

    ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

    ENDIF.

    rgds

    anver

    if helped mark points

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi there,

      I'm talking about field "HEADER_TXT" in structure "BAPIACHE09" not transferred to field "BKTXT" in table "BKPF" when the document is created via the BAPI call in the ABAP program.

      Any idea?

      Thanks.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2006 at 08:32 PM

    Hi,

    i've the same problem.

    Any Idea?

    regards.

    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.