Hi all,
i have a need to stop printing my smartform, according to the criteria that for a particular Ref. Doc., i have to see the list of Material Document.
If the last value of Material Document have a movement type "102", then it wouldn't get printed.
I have written this code but not getting desired result, please anyone correct my code(after seeing the screenshot).
DATA : ls_mseg type mseg,
it_mseg type mseg,
it_mseg1 type mseg,
it_mseg2 type mseg.
LOOP AT RG_MBLNR.
clear: ls_mseg.
select single * from mseg into ls_mseg
where mblnr in RG_MBLNR.
select single lfbnr from mseg into it_mseg where lfbnr = mseg-belnr.
select * from mseg into it_mseg1 where lfbnr = mseg-lfbnr.
select max( belnr ) from mseg into it_mseg2 where belnr = RG_MBLNR.
ENDSELECT.
IF sy-subrc eq 0.
DELETE RG_MBLNR.
ENDIF.
ENDLOOP.