Skip to Content

Getting Error Using BAPI_INCOMINGINVOICE_CREATE for GL posting

Sep 06, 2017 at 08:13 AM


avatar image

I am using BAPI_INCOMINGINVOICE_CREATE to post vendor GL. I am passing header data and gl account data in this Bapi. After posting I'm getting Error Message ME038 "No direct postings can be made to G/L acct. XXXXX in CoCode XXXX".

I have checked G/L acct. in fs00, the Automatic Posting box is checked.

How do I resolve this problem if the Automatic Posting box is still checked.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jürgen L
Sep 06, 2017 at 08:28 AM

The system thinks you are doing a direct posting with your BAPI, you probably missed some references.

Explain the process and name/show all fields that have a value when you execute the BAPI

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Jurgen,

The GL account is blocked for direct posting and I need to post that GL through program. I am passing following field in Bapi:

ls_headerdata-doc_type = 'KR'.
ls_headerdata-doc_date = sy-datum.
ls_headerdata-pstng_date = sy-datum.
ls_headerdata-ref_doc_no = '3625410'.
ls_headerdata-comp_code = '1000'.

ls_headerdata-diff_inv = '0000700162'.

ls_headerdata-currency = 'INR'.
ls_headerdata-gross_amount = 128.00.
ls_headerdata-calc_tax_ind = 'X'.
ls_headerdata-bline_date = sy-datum.
ls_headerdata-header_txt = ''. " Document Header Text

ls_gldata-invoice_doc_item = '1'.
ls_gldata-gl_account = lv_glacc_park. " General Ledger Account
ls_gldata-item_amount = 128.00.
ls_gldata-db_cr_ind = 'H'.
ls_gldata-comp_code = '1000'.
ls_gldata-tax_code = '0V'.
ls_gldata-costcenter = '4365'.
ls_gldata-bus_area = '4300'.

headerdata = ls_headerdata
invoicedocnumber = lv_inv_num
fiscalyear = lv_park_gjahr "lv_fiscalyear
itemdata = lt_item_data "lt_itemdata
glaccountdata = lt_gldata
return = lt_return.


What is the process that shall be achieved?

What is document behind this number: '3625410'

It does not look like a purchase order.

Have you tried to do this process manually with a transaction? What transaction would/did you use? Did you get the same error message?


I already have some invoice number for particular vendor, when I will get excel sheet related to vendor payment, I have to match both amount for same invoice. If there is any variation I have to Post that amount in GL account. I am using FB60 for GL posting and getting same error because GL is block for direct posting. I am passing Vendor Invoice number as reference document ('3625410').


if you get the same error then it is certainly not a problem with the BAPI.

Better you talk with your Finance consultant.

Also some hundred discussions exists already on this error message here in the community.