Application Development 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: 

Transaction MM02

Former Member
0 Kudos

Hi All,

In one of our program it is required to navigate to the particular view of MM02 transaction. The view selection depends upon the type of error for the material.

I tried with the FM MATERIAL_MAINTAIN_DIALOGUE but using this I can only enter all the basic views such as basic data 1, MRP1, Costing1, etc.

My requirement is to enter the other views also (MRP2, Costing2, etc).

I thought of BDC but it will make a big code.

Is there another simple way of doing this?

If anyone has worked on such requirement then please get back to me.

Thanks in advance.

Regards

Atish

3 REPLIES 3

Former Member
0 Kudos

Hi,

Welcome to SDN !!

I think you can still achieve what you want with MATERIAL_MAINTAIN_DIALOGUE...

See the following test program,

REPORT zsritest.

TABLES mara.

DATA: lv_bilds LIKE t133a-bilds,

ls_t130m LIKE t130m,

ls_rmmg1 LIKE rmmg1,

lwa_view TYPE mbildtab,

lwa_auswg TYPE mgauswg,

lt_views TYPE STANDARD TABLE OF mbildtab INITIAL SIZE 0,

lt_auswg TYPE STANDARD TABLE OF mgauswg INITIAL SIZE 0.

PARAMETERS: p_matnr LIKE mara-matnr,

p_werks LIKE marc-werks,

p_dytxt LIKE mbildtab-dytxt.

SELECT SINGLE * FROM mara WHERE matnr EQ p_matnr.

CHECK sy-subrc EQ 0.

CALL FUNCTION 'T130M_SINGLE_READ'

EXPORTING

tcode = 'MM03'

kzrfb = 'X'

IMPORTING

wt130m = ls_t130m

EXCEPTIONS

not_found = 1

wrong_call = 2

OTHERS = 3.

CALL FUNCTION 'BILDSEQUENZ_IDENTIFY'

EXPORTING

branche = mara-mbrsh

materialart = mara-mtart

tcode_ref = ls_t130m-trref

  • KZRFB = ' '

IMPORTING

bildsequenz = lv_bilds

  • KZ_BILDS_CHANGED =

EXCEPTIONS

wrong_call = 1

not_found = 2

OTHERS = 3.

CALL FUNCTION 'SELECTION_VIEWS_FIND'

EXPORTING

bildsequenz = lv_bilds

pflegestatus = mara-pstat

TABLES

bildtab = lt_views[]

EXCEPTIONS

call_wrong = 1

empty_selection = 2

OTHERS = 3.

ls_rmmg1-matnr = mara-matnr.

ls_rmmg1-werks = p_werks.

READ TABLE lt_views INTO lwa_view WITH KEY dytxt = p_dytxt.

CHECK sy-subrc EQ 0.

lwa_auswg-auswg = lwa_view-auswg.

APPEND lwa_auswg TO lt_auswg.

CALL FUNCTION 'MATERIAL_MAINTAIN_DIALOGUE'

EXPORTING

irmmg1 = ls_rmmg1

  • IRMMG1_REF = ' '

KZ_EIN_DARK = 'X'

t_tcode = 'MM03'

  • FLG_MATNR_RES = ' '

p_pstat = mara-pstat

  • FLG_STAT_ALL = ' '

  • CALL_MODE2 = ' '

  • IMPORTING

  • MATERIAL_NO =

  • UPDATE_OK =

TABLES

iauswg = lt_auswg[]

EXCEPTIONS

no_authority = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Try with a material, plant and "MRP 2" as p_dytxt. Use this code as reference to arrive at your own logic based on the data you have at hand at the time of call.

Hope this helps..

Sri

Former Member
0 Kudos

HI

I am using FM MATERIAL_MAINTAIN_DIALOGUE with tcode as MM02, but when I am changing data it gives message that material data changed and saved but it is not reflecting in the actual material master.

Can anybody tell what may be the issue.

Thanks in advance.

Atish

0 Kudos

Try to Use Commit.

after calling this FM.

Regards

vijay