Skip to Content

BAPI_INCOMINGINVOICE_CREATE without purchase order/delivery

Hi experts,

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 ?

María

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Nov 03, 2015 at 02:08 PM

    Other hearder data we can fill it.

    Header info:

    LS_HEADERDATA-DOC_DATE         = LV_DATUM.            "Document Date

       LS_HEADERDATA-PSTNG_DATE       = LV_DATUM.            "Posting Date

       LS_HEADERDATA-COMP_CODE        = PT_0100-BUKRS.       "Company Code

       LS_HEADERDATA-CURRENCY         = PT_0100-WAERS.       "Currency

       LS_HEADERDATA-PMNTTRMS         = PT_0100-ZTERM.

       LS_HEADERDATA-CALC_TAX_IND     = GC_CHARX.



    Item Info:


    LT_ITEMDATA-PO_NUMBER        = PT_0100-EBELN.   "Purchase Order

         LT_ITEMDATA-PO_ITEM          = PT_0100-EBELP.   "Item Purchasing

         LT_ITEMDATA-TAX_CODE         = PT_0100-MWSKZ.   "Tax Code

         LT_ITEMDATA-QUANTITY         = LV_MENGE.        "Quantity

         LT_ITEMDATA-PO_UNIT          = PT_0100-MEINS.   "Unit of Measure

         LT_ITEMDATA-PO_PR_UOM        = PT_0100-MEINS.   "Unit of Measure

         LT_ITEMDATA-REF_DOC          = PV_VBELN.        "Reference Doc.

         LT_ITEMDATA-REF_DOC_YEAR     = LV_GJAHR.        "Fiscal Year

         LT_ITEMDATA-REF_DOC_IT       = PV_POSNR.        "Reference Doc Item

         LT_ITEMDATA-ITEM_AMOUNT      = PT_0100-NETPR.



    Thanks,

    Kalyan.

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Kalyan,

      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'
             EXPORTING
               headerdata           = headerdata
               additionalheaderdata = additionalheaderdata
               refdoccategory       = refdoccategory
      *       ADDRESSDATA          =
             IMPORTING
               invoicedocnumber     = invoicedocnumber
               fiscalyear           = fiscalyear
             TABLES
      *       selectpo             = selectpo
      *       SELECTDELIVERY       = selectdelivery
      *       SELECTBILLLADING     =
      *       SELECTSERVICE        =
      *       SELECTPLANT          =
               taxdata              = itax
      *       WITHTAXDATA          =
      *       VENDORITEMSPLITDATA  =
               return               = return
               extensionin          = i_extensionin.