Application Development 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: 

Goods receipt.

Former Member
0 Kudos

Hello,

I am looking for the latest goods receipt for a material and plant combination. Please provide me the SAP table name and the field for determining the latest GR.

Thanks,

-A.Singh.

7 REPLIES 7

anversha_s
Active Contributor
0 Kudos

hi

u can check @ table level EKBE w.r.f PO number.

VGABE = 1 Goods receipt

2 Invoice receipt

Hope this helps and clarifies.

<b>BAPI FM for goods receipt - BAPI_GOODSMVT_CREATE</b>

<i>did u check the above BAPI</i>

regards

anver

if hlped pls mark points

0 Kudos

Hello Anver,

I have Mat.no. and plant as input parameter for searching,

no PO.

Thanks,

A.Singh

0 Kudos

hi,

check a samplde code.

You can go to BAPI BAPI_GOODSMVT_CREATE for this.

This piece of code may be helpful.

*

 Structures for BAPI
  data: gm_header  type bapi2017_gm_head_01.
  data: gm_code    type bapi2017_gm_code.
  data: gm_headret type bapi2017_gm_head_ret.
  data: gm_item    type table of
                   bapi2017_gm_item_create with header line.
  data: gm_return  type bapiret2 occurs 0.
  data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.
 
  clear: gm_return, gm_retmtd. refresh gm_return.
 
 
* Setup BAPI header data.
  gm_header-pstng_date = sy-datum.
  gm_header-doc_date   = sy-datum.
  gm_code-gm_code      = '06'.                              " MB11
 
* Write 551 movement to table
  clear gm_item.
  move '551'        to gm_item-move_type     .
  move '000000000040001234' to gm_item-material.
  move '1'        to gm_item-entry_qnt.
  move 'EA'       to gm_item-entry_uom.
  move '0004'     to gm_item-plant.
  move '4000'     to gm_item-stge_loc.
  move '201'      to gm_item-move_reas.
 
* Determine cost center per plant
  case xresb-werks.
    when '0004'.
      move '0000041430' to gm_item-costcenter.
    when '0006'.
      move '0000041630' to gm_item-costcenter.
    when '0007'.
      move '0000041731' to gm_item-costcenter.
    when '0008'.
      move '0000041830' to gm_item-costcenter.
  endcase.
 
  append gm_item.
 
* Call goods movement BAPI
  call function 'BAPI_GOODSMVT_CREATE'
       exporting
            goodsmvt_header  = gm_header
            goodsmvt_code    = gm_code
       importing
            goodsmvt_headret = gm_headret
            materialdocument = gm_retmtd
       tables
            goodsmvt_item    = gm_item
            return           = gm_return.
 
   call function 'BAPI_TRANSACTION_COMMIT'
       exporting
            wait = 'X'.

Regards

anver

if helped pls mark points

Former Member
0 Kudos

hi,

mseg -matnr ,

mseg-werks,

mseg-WEUNB,

mseg-BSTMG,

and check in table MKPF for the latest Gr.

these are the two tables u need to look in ..

regards.

Vijay

0 Kudos

Hello Vijay,

Thanks for the helpful reply.

I want to know the field out of the follwoing

which will give the latest GR

MSEG-BLDAT, MSEG-BUDAT, MSEG-CPUDT, MSEG-CPUTM.

Regards,

A.Singh

0 Kudos

Hello Vijay,

Thanks for the helpful reply.

I want to know the field out of the follwoing

which will give the latest GR

MKPF-BLDAT, MKPF-BUDAT, MKPF-CPUDT, MKPF-CPUTM.

Regards,

A.Singh

Former Member
0 Kudos

Hi its <b>mkpf-BUDAT</b>

<b>mkpf-BUDAT</b> posting date

dont forget to add this time .. this is very important ..

<b>mkpf-CPUTM</b>

<b>now say that on 06/10/2006 i have 5 grs for the same material and plant</b>

now to get the latest gr ..

to get the latest GR what we have to do is find the GR numbers with in a day for ur plant and material

into the <b>itab</b> ..

now

<b>Sort itab by budat descending cputm desecending ..</b>

will give u the latest GR on Day and Time ..

regards,

Vijay