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: 

Getting Error Using BAPI_INCOMINGINVOICE_CREATE for GL posting

bkgupta
Explorer
0 Kudos

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.

5 REPLIES 5

JL23
Active Contributor
0 Kudos

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

0 Kudos

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'.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
headerdata = ls_headerdata
IMPORTING
invoicedocnumber = lv_inv_num
fiscalyear = lv_park_gjahr "lv_fiscalyear
TABLES
itemdata = lt_item_data "lt_itemdata
glaccountdata = lt_gldata
return = lt_return.

JL23
Active Contributor
0 Kudos

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?

0 Kudos

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').

JL23
Active Contributor
0 Kudos

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.