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

mm02 view position

Former Member
0 Likes
866

hi,

i need to know the view position for mm02 upload as it is changing for diiferent materilas ........is there any way tho find out the postion of the view depending on type of the material.....

but,depending on type of material i ubsoreved for HALB type it is different for two different HALB type materials please do suggest .................

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
685

Try this code it may be useful

data: begin of bildtab occurs 30.
        include structure mbildtab.
data: end of bildtab.
data: tkstatus(15),
      dispstatus like t130m-pstat.
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             = ITAB-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.
DELETE BILDTAB WHERE KZANZ = ''.
READ TABLE BILDTAB WITH KEY DYTXT = 'MRP 1'.

3 REPLIES 3
Read only

Former Member
0 Likes
686

Try this code it may be useful

data: begin of bildtab occurs 30.
        include structure mbildtab.
data: end of bildtab.
data: tkstatus(15),
      dispstatus like t130m-pstat.
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             = ITAB-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.
DELETE BILDTAB WHERE KZANZ = ''.
READ TABLE BILDTAB WITH KEY DYTXT = 'MRP 1'.

Read only

GauthamV
Active Contributor
0 Likes
685

hi,

open OMT3U transaction and click on view selction.there u can check the views.

Read only

Former Member
0 Likes
685

hi ,

i got the answer.....

we can use..

MATERIAL_BTCI_SELECTION_NEW fm...