Skip to Content
0
Former Member
May 31, 2007 at 05:14 AM

regarding the reversal of material document number

85 Views

hi experts,

i am developing a report in which user wants that the GR , which is reversed wont show in the output list ,,it means,FOR EG.. the movement type 102 (against which material document no and 101) will not be displayed in the output list..for this i have coded , no doubt it is working fine but i have to write more than one select statement ,,what i want can we do something new so that complete result will come in one select statement...here i m giving my codes...

itab_mkpf_rcvdate-p_date2 = s_date - 1.

select mblnr

mjahr

blart

budat from mkpf into

table itab_mkpf_rcvdate where

budat eq itab_mkpf_rcvdate-p_date2

and blart in

('WA','WE','WL').

if not itab_mkpf_rcvdate[] is initial.

select matnr

erfmg

mblnr

ebeln

werks

lgort

bwart

lfbnr

smbln from mseg into table itab_101

for

all entries in itab_mkpf_rcvdate

where mblnr = itab_mkpf_rcvdate-mblnr and

bwart in ('101','531') and werks = s_werks.

endif.

select mandt

bwart

matnr

ebeln

lfbnr

smbln from mseg client specified into

table itab3 for

all entries in itab_101 where ebeln =

itab_101-ebeln and bwart in ('102','532') and mandt = sy-mandt .

loop at itab_101.

read table itab3 with key lfbnr = itab_101-mblnr.

if sy-subrc = 0.

delete itab_101.

continue.

endif.

read table itab3 with key smbln = itab_101-mblnr.

if sy-subrc = 0.

delete itab_101.

continue.

endif.

endloop.

sort itab_101 by matnr.

PLZ HELP ME......

null