BAPI_INCOMINGINVOICE_CREATE without purchase order/delivery
I'm using bapi BAPI_INCOMINGINVOICE_CREATE to create documents. In some cases I use it with reference to purchase order and in other cases to delivery orders. Now the user needs to create documents wit no PO/delivery.
If I go to MIRO, the data informed are: dates, vendor, reference, amount.
When I use the bapi in the program, I get some errors, for example that I need to fill table Select_po, but I'm not passing any PO.. My problem also is how to fill additionalheaderdata.
Any idea ?
Thanks in advance ?
Maria Merino replied
The problem was that i have no purchase order to inform.
I solved it like this:
[all additionalheaderdata informed]
additionalheaderdata-sel_vendor = c_x.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_SAVE'
headerdata = headerdata
additionalheaderdata = additionalheaderdata
refdoccategory = refdoccategory
* ADDRESSDATA =
invoicedocnumber = invoicedocnumber
fiscalyear = fiscalyear
* selectpo = selectpo
* SELECTDELIVERY = selectdelivery
* SELECTBILLLADING =
* SELECTSERVICE =
* SELECTPLANT =
taxdata = itax
* WITHTAXDATA =
* VENDORITEMSPLITDATA =
return = return
extensionin = i_extensionin.