Skip to Content
0
Former Member
Jun 16, 2011 at 12:20 PM

how to get GR value

781 Views

Hello experts,

I am creating a PO/GR customized report in which I need GR value to appear.

I already has following field values from table MSEG, EKBE, MKPF after join condition based on user entries on selection screen.

mmatnr mbukrs mebeln mlifnr merfmg merfme

mwerks mzeile mprctr mebelp m1mblnr m1budat evgabe mbwart e~shkzg

m = mseg

m1 = mkpf

e = ekbe

Now, I need to fetch GR value based on above fields, I found that GR values are stored in BSEG table in WRBTR field.

I am writing the following query:

loop at it_header into wa_header.

select wrbtr shkzg from bseg into corresponding fields of wa_grval

WHERE ebeln eq wa_header-ebeln

and bukrs eq wa_header-bukrs

and lifnr eq wa_header-lifnr

and matnr eq wa_header-matnr

and ebelp eq wa_header-ebelp

and werks eq wa_header-werks

and prctr eq wa_header-prctr.

append wa_grval into it_grval.

endloop.

After using above code I am getting gr values for different accounting document no. but I need to filter GR( WRBTR ) field values based on accounting document no. or material document no.

How can I get WRBTR field from BSEG based on fields listed above.

Or if there is any other table or logic to fetch GR value then please tell.

Thank You.