cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI to Park the Invoice Document

12-15-2003 2:29 PM
17384 views 26 comments
0 Likes
SAP Managed Tags
Subscribe

hi

i am trying to use a BAPI to replace the transaction MIRO or FB60 or MIR7. To park the document.

Can any worked in this area? Any input is highly appreciated.

thanks

mlnaras

0 Likes
View Entire Topic
bankmlt855
Newcomer
0 Likes

I'm trying to use a BAPI to replace transactions like **MIRO**, **FB60**, or **MIR7**—specifically to **park** a document.  

 

Has anyone worked on this before? Any input or guidance would be greatly appreciated!

 

---

 

And here’s the full detailed response translated into English:

 

---

Recommended BAPI for **Parking a Vendor Invoice**:

**`BAPI_INCOMINGINVOICE_PARK`**
This BAPI is specifically designed to **park incoming vendor invoices** and functions as the programmatic equivalent of transaction **MIRO** in **Park** mode.

---

### 🔧 Key Parameters of the BAPI:

- **`INVOICE_INDICATORS`**: Specifies invoice type (e.g., GR-based invoice verification)
- **`INVOICE_AMOUNT`**: Total invoice amount
- **`TAX_AMOUNT`**: Tax amount
- **`ITEMDATA`**: Line item details (including G/L account, cost center, amount, PO number, PO line item, etc.)
- **`ACCOUNTGL`**: General ledger account information (if needed)
- **`ACCOUNT_PAYABLE`**: Vendor account details
- **`DOCUMENT_DATE`**, **`POSTING_DATE`**, **`COMP_CODE`**, **`FISC_YEAR`**, **`DOC_TYPE`**, **`REF_DOC_NO`**, etc.

Yes, to **park** an accounting document or vendor invoice in SAP (equivalent to transactions like **MIRO**, **FB60**, or **MIR7**), you can use standard SAP **BAPIs**. Below is a precise guide based on common scenarios:

all **`BAPI_INCOMINGINVOICE_PARK`** with the appropriate data.
2. Check the **`RETURN`** table for errors.
3. If no errors occur, the output parameter **`INVOICE_DOC_NUMBER`** returns the parked document number.
4. You can then:
- **Post** it using **`BAPI_INCOMINGINVOICE_RELEASE`**, or
- **Cancel** it using **`BAPI_INCOMINGINVOICE_CANCEL`**.

---

### 📝 Important Notes:

- This BAPI is **independent of MIRO** but implements the exact same parking logic.
- If you need to **park a general accounting document** (not a vendor invoice), you’d need to use **`BAPI_ACC_DOCUMENT_CHECK`** and **`BAPI_ACC_DOCUMENT_POST`** with a parking/hold indicator—but this is more complex and requires specific SAP customizing (e.g., defining a document type that supports parking).
- In **SAP S/4HANA**, document parking is fully supported via these same BAPIs.

DATA: ls_invoice_header TYPE bapi_incinv_head,
lt_itemdata TYPE STANDARD TABLE OF bapi_incinv_item,
lt_return TYPE STANDARD TABLE OF bapiret2,
lv_invoice_number TYPE bapi_incinv_head-inv_doc_no.

ls_invoice_header-comp_code = '1000'.
ls_invoice_header-doc_date = sy-datum.
ls_invoice_header-pstng_date = sy-datum.
ls_invoice_header-vendor = '100001'.
ls_invoice_header-invoice_amt = '1000.00'.
ls_invoice_header-currency = 'IRR'.
ls_invoice_header-ref_doc_no = 'REF12345'.

" Fill lt_itemdata with line item details...

CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
EXPORTING
invoice_header = ls_invoice_header
IMPORTING
invoice_doc_no = lv_invoice_number
TABLES
return = lt_return
itemdata = lt_itemdata.

" Check lt_return for serious errors (type = 'E' or 'A')