Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Fields Mapping

Former Member
0 Likes
1,116

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...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,057

Hi Ashok

U can also make use of EKBE (PO history) table.

Rgds

B.S.Krishnan

9 REPLIES 9
Read only

Former Member
Read only

Former Member
0 Likes
1,057

Go to mseg table.

Regards,

Ravi

Read only

Former Member
0 Likes
1,058

Hi Ashok

U can also make use of EKBE (PO history) table.

Rgds

B.S.Krishnan

Read only

Former Member
0 Likes
1,057

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

Read only

Former Member
0 Likes
1,057

From whcih table i will get Invoice doc no for a given Purchage doc no.

Read only

0 Likes
1,057

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

Read only

Former Member
0 Likes
1,057

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

Read only

0 Likes
1,057

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

Read only

0 Likes
1,057

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