Skip to Content
0
Former Member
Jul 14, 2005 at 11:05 AM

Problem with BAPI_INCOMINGINVOICE_CREATE

976 Views

I have a problem with the above BAPI - it gives me error message M8 524 - 'You cannot process conditions for delivery costs'. My code can be found below. I am not trying to process conditions for delivery costs but merely passing the condition type and the amount.

Any input would be much appreciated.

Thanks

loop at gt_pohd.

ls_HEADERDATA-INVOICE_IND = 'X'.

ls_HEADERDATA-DOC_DATE = sy-datum.

ls_HEADERDATA-PSTNG_DATE = gt_pohd-budat.

ls_HEADERDATA-COMP_CODE = gt_pohd-bukrs.

ls_HEADERDATA-GROSS_AMOUNT = gt_pohd-netwr.

ls_HEADERDATA-CURRENCY = gt_pohd-waers.

clear l_item.

loop at gt_podt where ebeln = gt_pohd-ebeln.

on change of gt_podt-matnr.

clear l_item.

endon.

l_item = l_item + 1.

lt_itemdata-INVOICE_DOC_ITEM = l_item.

lt_itemdata-PO_NUMBER = gt_pohd-belnr.

lt_itemdata-PO_ITEM = gt_podt-ebelp.

lt_itemdata-TAX_CODE = 'V0'.

lt_itemdata-ITEM_AMOUNT = gt_podt-netwr.

lt_itemdata-QUANTITY = gt_podt-menge.

lt_itemdata-PO_UNIT = 'EA'.

lt_itemdata-cond_type = gt_podt-kschl.

append lt_itemdata.

clear lt_itemdata.

at end of ebeln.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'

EXPORTING

headerdata = ls_headerdata

  • ADDRESSDATA =

  • IMPORTING

  • INVOICEDOCNUMBER =

  • FISCALYEAR =

tables

itemdata = lt_itemdata

  • ACCOUNTINGDATA =

  • GLACCOUNTDATA =

  • MATERIALDATA =

TAXDATA = lt_taxdata

  • WITHTAXDATA =

  • VENDORITEMSPLITDATA =

return = lt_return

.

loop at lT_return.

move lt_return to gt_return.

concatenate 'Doc No/PO no' gt_pohd-ebeln '/'

gt_pohd-belnr ':' lt_return-message

into gt_return-message

separated by space.

append gt_return.

clear gt_return.

endloop.

endat.

endloop.

endloop.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

return = ls_bapiret2.