Skip to Content

Need to Post f-02 Using bapi:BAPI_ACC_DOCUMENT_POST


I am facing one problem.
I need to post Gl account posting Using Bapi::BAPI_ACC_DOCUMENT_POST
If i post Gl account credit debit everything is fine.

But If i post or mention Vendor code with special Gl it is not working.

I am calling bapi:

documentheader = documentheader
accountgl = accountgl
accountpayable = accountpay
currencyamount = currencyamount
extension1 = extension
return = return.

In the abvoe
accountgl I am passing Vendor and account type
accountgl-vendor_no = it_final-lifnr.

accountgl-acct_type = 'K'.

and accountpay Details
i am passing Special Gl account too.

While posting Front end f-02 with same data , document posting. But using bapi I am not able to post. Any thing i missed Please Suggest me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 12, 2017 at 08:47 AM

    Pass the vendor item in the accountpayable table, not to the accountgl one, fill VENDOR_NO and SP_GL_IND correctly. Which SGL ind did you try?

    Add comment
    10|10000 characters needed characters exceeded

    • hi Raymond Giuseppi

      I got the answer. There is One Custom Function module is there, When i ever i create the Entry with Vendor, one field xfield is passing as x automatically. This line is deleting the function module.

      Now i remove the code. Now working.I did not understood. 1 point,When ever line entry is having posting key with 39,One more line with posting key 31 is coming. In the zfunction module they are removing the 31 line entry, Then only I can add the entry using bapi. Other wise fi interface error is coming.