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: 

Problem with BAPI_INCOMINGINVOICE_CREATE

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

Hello,

what happens if you skip this line

" lt_itemdata-cond_type = gt_podt-kschl." ?

Regards Wolfgang

0 Kudos

I will need to process the cond type.

Will update when I get a fix.

Thanks,

Ravi.

0 Kudos

I got this from OSS note and may help you.

You can define delivery costs in BAPIs BAPI_INCOMINGINVOICE_CREATE and BAPI_INCOMINGINVOICE_PARK either via the condition type or via the level number and the condition counter (see the BAPI online help). For this, the following cases can be differentiated respectively:

a) You specify a delivery costs line with a delivery vendor L1 and a condition type K1 at the BAPI interface and

  • there are two different delivery vendors L1 and L2 for the same condition K1: the system generates a line L1/K1.

  • there are two different conditions K1 and K2 for a delivery vendor L1: the system generates a line L1/K1. If you additionally want to create a line L1/K2, you have to specify this second one at the BAPI interface as well.

b) You specify a delivery costs line without a delivery vendor L1 for condition type K1 at the BAPI interface and

  • there are two different delivery vendors L1 and L2 for the same condition K1: the system generates the error message 'Processing of the conditions with delivery costs not possible'. The reason is the missing uniqueness concerning the line specified at the interface. In this case, you best create a second delivery costs line at the interface with K1/L2 in order to eliminate this problem and to fill the delivery vendor field of the first one with L1.

  • there are two different conditions K1 and K2 for a delivery vendor L1: the system generates a line L1/K1.

If a combinatin occurs in which no unique assignment is possible between the lines which are specified at the interface of the BAPI and the still open, to be settled delivery costs, the system issues an error message.