cancel
Showing results for 
Search instead for 
Did you mean: 

Link Table For Miro values against Migo Details

Former Member
0 Kudos

Dear All,

Our Requirement is calculate the TDS based on vendor wise TDS Subcontractors (10708029),

we have the below details

OutputTcode GLCode Type Descrpn Series Input Tcode

FAGLL03 40120100 WE Subcontract charges 5000000014 Migo

FAGLL03 10708029 RE,KZ TDS Subcontractors 5100004062 Miro

How to link Subcontract charges against TDS Subcontractors?

Please tell me the Table name for Link Field?

Regards,

S.Kalaivani.

Edited by: vanissmca on Nov 9, 2011 4:43 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

MIRO (vendor invoicie) values are stored in RBKP (invoice header) and RSEG (invoice item). Blocked invoices have records in RBKP_BLOCKED.

MIGO (goods receipt) values are stored in MKPF (material document header) and MSEG (material document item) table.

Invoice and goods receipt are related to each other through the PO item from PO history table EKBE.

Using RSEG-EBELN and RSEG-EBELP you can find the PO item related to an invoice item. Similarly using MSEG-EBELN and MSEG-EBELP you can related a goods receipt item to a PO item.

From EKBE (PO history table) you can fetch related invoice and GR details like below. You may need to change BEWTP and VGABE depending on what type of documents you searching for (Subcontract charge and TDS Subcontractor documents may have different values for EKBE-BEWTP and EKBE-VGABE check out). The below is valid for Goods receipt and inbound Invoice and similar logic should connect Subcontract charge and TDS Subcontractor items to their related PO item.

* Fetch good receipts from linked PO items
  SELECT ebeln ebelp belnr buzei gjahr shkzg menge
    INTO CORRESPONDING FIELDS OF TABLE lt_goods_receipt
      FROM ekbe
        FOR ALL ENTRIES IN lt_po_items
          WHERE ebeln = lt_po_items-ebeln AND
                ebelp = lt_po_items-ebelp AND
                bewtp = 'E' AND
                vgabe = '1'.

* Fetch invoice receipts from linked PO items
  SELECT ebeln ebelp belnr buzei gjahr menge
    INTO CORRESPONDING FIELDS OF TABLE lt_invoice_receipt
      FROM ekbe
        FOR ALL ENTRIES IN lt_po_items
          WHERE ebeln = lt_po_items-ebeln AND
                ebelp = lt_po_items-ebelp AND
                bewtp = 'Q' AND
                vgabe = '2'.