Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MM01/MM02 Function module for Views

Former Member
0 Likes
1,515

Hi

what is the function module to find the views of a meterial in MM01/MM02.

please let me know.

Thanks and Regards

Harish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,017

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.

5 REPLIES 5
Read only

Former Member
0 Likes
1,017

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

Read only

Former Member
0 Likes
1,017

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

Read only

Former Member
0 Likes
1,018

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.

Read only

Former Member
0 Likes
1,017

Hi,

Try ' BAPI_MATERIAL_DISPLAY'

Cheers,

Nilesh

Read only

ferry_lianto
Active Contributor
0 Likes
1,017

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.