05-18-2006 4:25 PM
Hi
what is the function module to find the views of a meterial in MM01/MM02.
please let me know.
Thanks and Regards
Harish
05-18-2006 4:34 PM
TABLES : t130m,
t134.
DATA: kstatus LIKE t130m-pstat,
hstatus LIKE t130m-pstat,
tkstatus LIKE t130m-pstat,
bildsequenz LIKE t133k-bilds,
berecht_akt(2) TYPE c.
DATA: BEGIN OF ztab_new OCCURS 30.
INCLUDE STRUCTURE mbildtab.
DATA: END OF ztab_new.
CLEAR t134.
SELECT SINGLE * FROM t134 WHERE mtart = <mtart>.
CALL FUNCTION 'MATERIAL_INIT'
EXPORTING
tcode = 'MM01' or MM02
kz_berprf = 'X'
IMPORTING
it130m = t130m
tkstatus = tkstatus
EXCEPTIONS
no_authority = 1
wrong_call = 2
kstatus_empty = 3
tkstatus_empty = 4
aktyp_tcode_mismatch = 5
tcode_not_found = 6
material_article_mismatch = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'BILDSEQUENZ_IDENTIFY'
EXPORTING
materialart = 'HALB' "Material Type
tcode_ref = t130m-trref
IMPORTING
bildsequenz = bildsequenz.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = bildsequenz
pflegestatus = t134-pstat "tkstatus
TABLES
bildtab = gt_bild
EXCEPTIONS
call_wrong = 1
empty_selection = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
05-18-2006 4:30 PM
Hi,
Use <b>BAPI_MATERIAL_DISPLAY</b>, just enter the material number and it will display the corresponding material in the material transaction.
<b>Reward points if it helps.</b>
Regards,
Amit Mishra
05-18-2006 4:33 PM
Hi,
you can check the views in table MSTA
field is STATM is the field will hold the views
....
A Work scheduling
B Accounting
C Classification
D MRP
E Purchasing
F Production resources/tools
G Costing
K Basic data
L Storage
P Forecasting
Q Quality management
S Warehouse management
V Sales
X Plant stocks
Z Storage location stocks
regards
vijay
05-18-2006 4:34 PM
TABLES : t130m,
t134.
DATA: kstatus LIKE t130m-pstat,
hstatus LIKE t130m-pstat,
tkstatus LIKE t130m-pstat,
bildsequenz LIKE t133k-bilds,
berecht_akt(2) TYPE c.
DATA: BEGIN OF ztab_new OCCURS 30.
INCLUDE STRUCTURE mbildtab.
DATA: END OF ztab_new.
CLEAR t134.
SELECT SINGLE * FROM t134 WHERE mtart = <mtart>.
CALL FUNCTION 'MATERIAL_INIT'
EXPORTING
tcode = 'MM01' or MM02
kz_berprf = 'X'
IMPORTING
it130m = t130m
tkstatus = tkstatus
EXCEPTIONS
no_authority = 1
wrong_call = 2
kstatus_empty = 3
tkstatus_empty = 4
aktyp_tcode_mismatch = 5
tcode_not_found = 6
material_article_mismatch = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'BILDSEQUENZ_IDENTIFY'
EXPORTING
materialart = 'HALB' "Material Type
tcode_ref = t130m-trref
IMPORTING
bildsequenz = bildsequenz.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = bildsequenz
pflegestatus = t134-pstat "tkstatus
TABLES
bildtab = gt_bild
EXCEPTIONS
call_wrong = 1
empty_selection = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
05-18-2006 4:35 PM
05-18-2006 4:37 PM
Hi Sirivaram,
Please check this view <b>VCM_T133A</b> or tables <b>T133A</b> and <b>T133B</b>.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.