Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

MM01/MM02 Function module for Views

Hi

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

please let me know.

Thanks and Regards

Harish

Tags:
Former Member
Former Member replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question