‎2006 Jun 07 11:26 AM
hi all
How to fecth the Goods receipt no(material Document no) and Invoice Receipt no for a particular Purchase order.
i want from which tables i will get those information along with relation between tables...
‎2006 Jun 07 11:32 AM
Hi Ashok
U can also make use of EKBE (PO history) table.
Rgds
B.S.Krishnan
‎2006 Jun 07 11:29 AM
Hi Ashok,
Check this out
http://www.sapdevelopment.co.uk/tables/tables.htm
http://www.allsaplinks.com/tables.html
http://www.sapgenie.com/abap/tables.htm
Regards,
Santosh
‎2006 Jun 07 11:30 AM
‎2006 Jun 07 11:32 AM
Hi Ashok
U can also make use of EKBE (PO history) table.
Rgds
B.S.Krishnan
‎2006 Jun 07 11:44 AM
Hi,
You can get the data from Table MKPF.
Here you need to pass the document type <b>BLART</b> as <b>WE</b>
and also <b>VGART = 'WE'</b>
the above are used to find GR related to PO.
Regards
vijay
‎2006 Jun 07 11:44 AM
From whcih table i will get Invoice doc no for a given Purchage doc no.
‎2006 Jun 07 11:45 AM
Hi,
You can get the data from Table MKPF.
Here you need to pass the document type BLART as WE
and also VGART = 'WE'
the above are used to find GR related to PO.
Regards
vijay
‎2006 Jun 07 12:01 PM
hi Ravi,Vijay,
how can i get Inovice document for given Purchase order no ie from which table i will get this info...
Message was edited by: Ashok Parupalli
‎2006 Jun 07 12:12 PM
Hi,
after you get the material document, go to MSEG and get the details..
SELECT
MBLNR
MJAHR
KDAUF
KDPOS
EBELN
EBELP
INTO TABLE IT_MSEG
FROM MSEG
FOR ALL ENTRIES IN IT_MKPF
WHERE MBLNR = IT_MKPF-MBLNR AND
MJAHR = IT_MKPF-MJAHR.
REFRESH: IT_PO,
IT_SO.
LOOP AT IT_MSEG INTO WA_MSEG.
CLEAR: WA_PO,
WA_SO.
*moving into it_so
IF NOT WA_MSEG-KDAUF IS INITIAL.
WA_SO-MBLNR = WA_MSEG-MBLNR.
WA_SO-KDAUF = WA_MSEG-KDAUF.
WA_SO-KDPOS = WA_MSEG-KDPOS.
APPEND WA_SO TO IT_SO.
ENDIF.
*moving into it_po
IF NOT WA_MSEG-EBELN IS INITIAL.
CLEAR V_KANBA.
SELECT SINGLE KANBA
INTO V_KANBA
FROM EKPO
WHERE EBELN = WA_MSEG-EBELN AND
EBELP = WA_MSEG-EBELP.
IF SY-SUBRC = 0 AND
V_KANBA IS INITIAL.
WA_PO-MBLNR = WA_MSEG-MBLNR.
WA_PO-EBELN = WA_MSEG-EBELN.
WA_PO-EBELP = WA_MSEG-EBELP.
APPEND WA_PO TO IT_PO.
ENDIF.
ENDIF.
ENDLOOP.if you want i can give the coding related...
Regards
vijay
‎2006 Jun 07 12:16 PM
First MKPF->MSEG-> then using MESG-EBELN,EBELP you can get the PO details..
MKPF is used to filter material docs (GR related PO's).
select * from mpf INTO TABLE IT_MKPF
FROM MKPF
WHERE MJAHR = S_MJAHR AND
VGART IN 'WE' AND
BLART IN 'WE' AND
BUDAT IN S_BUDAT.aftet you get MBLNR's then go to MSEG for all entries of MKPF get ebeln,ebelp details.
Regards
vijay