|
This program lists the views for a particular material. Table MOFF stores the views that have not yet been created for a particular material.
tables: mara,t134,t133a. data: begin of bildtab occurs 30. include structure mbildtab. data: end of bildtab. data: tkstatus(15), dispstatus like t130m-pstat. parameters: p_matnr like mara-matnr. call function 'MATERIAL_INIT' exporting tcode = 'MM02' kz_berprf = 'X' importing tkstatus = tkstatus exceptions no_authority = 01. call function 'SELECTION_VIEWS_FIND' exporting bildsequenz = '21' pflegestatus = tkstatus"mara-pstat tables bildtab = bildtab. *select single * from mara where matnr = p_matnr. call function 'MARA_SINGLE_READ' exporting matnr = p_matnr "material importing wmara = mara exceptions lock_on_material = 01 lock_system_error = 02 not_found = 03 others = 04. call function 'MARA_DUMMY_STATUS' exporting wmara_in = mara importing wmara_out = mara exceptions call_wrong = 1 imara_error = 2 tmara_error = 3 others = 4. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif. select single * from t134 where mtart = mara-mtart. call function 'ANZGSTATUS_SETZEN' exporting aktyp = 'V' marastatus = mara-vpsta t134status = t134-pstat tkstatus = tkstatus "mara-pstat importing anzgstatus = dispstatus tkbstatus = tkstatus. translate dispstatus using ' $'. loop at bildtab. if bildtab-pstat ca dispstatus. if bildtab-kzanz is initial. bildtab-kzanz = 'X'. modify bildtab. endif. else. if not bildtab-kzanz is initial. clear bildtab-kzanz. modify bildtab. endif. endif. endloop.
Related Items:
|