Skip to Content
0
Former Member
Jul 20, 2007 at 08:15 PM

BAPI_INCOMINGINVOICE_CREATE - Getting error and can't find field

622 Views

Hi, I'm trying to post MIRO documents via BAPI_INCOMINGINVOICE_CREATE, but getting an error that I cannot seem to figure out.

I'm getting an error for the following: "System cannot calculate cash discount base amount; enter it"

There is a field in the header called discount amount and I tried it, but doesn't work. It is specifically looking for discount "base" amount. For the life of me I cannot figure out what field it is or what workaround I have.

Here is some of the code:

clear: v_itemno_acc, s_MIROheader.

s_miroheader-INVOICE_IND = 'X'.

s_miroheader-comp_code = s_miro-vbund_tr.

s_miroheader-doc_date = sy-datum.

s_miroheader-pstng_date = sy-datum.

s_miroheader-doc_type = c_is.

s_miroheader-GROSS_AMOUNT = s_miro-amount * -1.

s_miroheader-currency = s_miro-waerk.

v_itemno_acc = v_itemno_acc + c_10.

s_miroitemdata-INVOICE_DOC_ITEM = '1'. "s_miro-vbeln.

s_miroitemdata-PO_NUMBER = '4500001368'. "s_miro-ebeln.

s_miroitemdata-po_item = v_itemno_acc. "s_miro-ebelp.

s_miroitemdata-quantity = '2'.

s_miroitemdata-po_unit = 'G'.

s_miroitemdata-ITEM_AMOUNT = s_miro-amount.

s_miroitemdata-ref_doc = '5000001936'. "s_miro-vbelv.

s_miroitemdata-ref_doc_year = '2007'.

s_miroitemdata-ref_doc_it = '1'. "v_itemno_acc. "s_miro-ebelp.

append s_miroitemdata to t_miroitemdata.

Thanks for your help!!!!

Mark