Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST

Former Member
0 Kudos
141

Hi All

We are trying to use BAPI_ACC_DOCUMENT_POST to post vendor invoice out of FI similar to FB60.

For test purposes we want to post only a two line item entry

Debit GL Account Cost Center Amount

Credit Vendor Account Amount

We are activating few fields in the following structures of the BAPI

Document Header

Accounts Payable

AccountGL

CurrencyAmount

Here are the errors we are getting

1) OBJ_TYPE Sender identification

OBJ_KEY Reference number of source document

OBJ_SYS Logical system of source document

<i>the above information is required what values need to be populated here?</i>

<i>another error is wrong business transaction</i>

2) How do we activate posting keys; what is the field name/structure; we couldn't find them in the above structures

does anyone have a sample of parameters for these structures that can be used as a starting point?

thanks - Adil

4 REPLIES 4

Former Member
0 Kudos
70

Hi Adil,

I'm using this BAPI, and you don't need to fill OBJ_TYPE OBJ_KEY and OBJ_SYS.

As for the account key, they are replaced by the amount sign +/-.

Hope this helps.

Erwan.

0 Kudos
70

Erwan

Do you have a list of parameters that you are passing to post the FI document through this BAPI? I would like to show it to our programmer

thanks-adil

0 Kudos
70
      
        w_compt = w_comp + 1.

        documentheader-bus_act    = 'RFBU'.
        documentheader-username   = sy-uname.
        documentheader-comp_code  = p_bukrs.
        documentheader-fisc_year  = sy-datum(4).
        documentheader-doc_date   = sy-datum.
        documentheader-pstng_date = sy-datum.
        documentheader-doc_type   = p_blart.
        documentheader-header_txt = w_text_comment

*IF GL ACCOUNT

*       Accountgl / 
        ws_accountgl-itemno_acc   = w_compt.
        ws_accountgl-comp_code    = p_bukrs.
        ws_accountgl-pstng_date   = ws_reformat-datecpt.
        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.

        APPEND ws_accountgl TO accountgl.

*ELSE IF ACCOUNT PAYABLE

*       Account Payable 
        ws_accountpayable-itemno_acc   = w_compt.
        ws_accountpayable-comp_code    = p_bukrs.
        ws_accountpayable-item_text    = w_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
      ws_currencyamount-itemno_acc = w_compt.
      ws_currencyamount-currency = 'EUR'.
*     ws_currencyamount-curr_type = '00'.
      ENDIF.
      ws_currencyamount-amt_doccur = ws_reformat-wrbtr_c.
      APPEND ws_currencyamount TO currencyamount.

This the way I use it.

Hope this helps.

Erwan.

0 Kudos
70

Hi Erwan.

I'm trying to use this BAPI and in test mode, using the parameters you specify in this piece of code I have an error in Return, that says "FI/CO interface: Line item entered several times". Any idea what his might be? I used line ID 1 for both the ACCOUNTGL and ACCOUNTPAYABLE structures.

Thanks a million in advance.

Jean-Marie