cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction MM02

Former Member
0 Kudos

HI All,

I am using below FM to call transaction MM02 with relevant material master view.

CALL FUNCTION 'MATERIAL_MAINTAIN_DIALOGUE'

EXPORTING

irmmg1 = lwa_rmmg1

kz_ein_dark = c_x

t_tcode = c_mm02

p_pstat = p_pstat

TABLES

iauswg = li_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.

I am going at required screen such as MRP 1, MRP 2 etc when I call this FM.

But lets say user is in MRP 2 and from there he navigated to BASIC DATA 1 and from there he made some changes and saved data. Then when I next time call the FM for MRP 2 then also it goes to BASIC DATA 1.

I am clearing all the variables properly before calling this FM.

Can anybody tell me what may be the problem and how can I handle it.

Thanks in advance.

Atish

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

HI Amit

I also tried with the Submit and it works fine. Thanks for your help.

Can you please tell me what may be the reason of such a strange condition.

Regards,

Atish

Former Member
0 Kudos

Hi Atish,

The reason must be like this. The function group in which you have the FM MATERIAL_MAINTAIN_DIALOGUE has a number of global variables. These take control while the execution of the actual screen. These needs to be accessed from your program which is surely not advisable as the control gets lost.

Hence when you recall the same function module the history values will be used and hence you were not able to comeback to MRP1.

Amit, please let me know in case you have a different view.

Regards,

Srikanth

Message was edited by: Srikanth Lodd

Former Member
0 Kudos

Hi again,

1. Ya

2. Function Group

contains global variables

which cannot be accessed from our programs.

3. This global variables

get filled

when we call any FM once.

4. But after this,

probably,

they don't get cleared / REFRESHED / new values

, and hence, the old screen sequence.

5. One MORE REASON can be,

the many transactions

store the last data / screen sequcne / default values

of the user / per session.

6. so if we call the dialogue FM

twice,

the PROCESS / SESSION

remains the same, and, hence, old screen sequence.

7. But due to our SUBMIT concept,

the process/session

is new everytime

and hence, proper screen sequnce.

regards,

amit m.

Former Member
0 Kudos

Hi atish,

1. I understood your problem.

2. There is a WORKAROUND,

which works fantastic. (i just tried it)

3. For this, u will have to create two progams.

1. Z1 - which calls the FM with required prameters

2. Z2 - wrapper program which SUBMITS Z1 and return.

4. code for z2 should be somethig like this

in a loop :

REPORT abc.

submit zam_temp00 and return.

submit zam_temp00 and return.

5. Regarding

the different parameters,

u should use parameter ID or Extensions of SUBMIT

eg. SUBMIT (report)

WITH SELECTION-TABLE rsparams

(important is SELECTION-TABLE to pass parameters

for selection screenN0

6. Do this and your problem will get solved. !

regards,

amit m.

Former Member
0 Kudos

HI Sudheer,

I am calling this FM in AT LINE SELECTION Event.

So when I am making changes in Basic Data 1 and coming back and after selecting the same record it should go to MRP 1 but it is still going in Basic Data 1 view.

I am using FREE memory statement also but the same thing is happening.

Former Member
0 Kudos

Hi Atish,

I tried using this function module in my program.

MATERIAL_MAINTAIN_DIALOGUE

cOMMIT WORK.

call function 'MATERIAL_MAINTAIN_DIALOGUE'

exporting

IRMMG1 = l_rmmg1

IRMMG1_REF = l_ref

  • KZ_EIN_DARK = ' '

t_tcode = 'MM02'

  • FLG_MATNR_RES = ' '

P_PSTAT = 'D'

  • FLG_STAT_ALL = ' '

  • CALL_MODE2 = ' '

IMPORTING

MATERIAL_NO = L_MATNR

UPDATE_OK = L_KZREF

  • TABLES

  • IAUSWG =

EXCEPTIONS

NO_AUTHORITY = 1

OTHERS = 2

COMMIT WORK.

When I execute the program it goes to MRP1 view. I navigated to basic data1 screen and changed information and saved.

When I executed the progam for the second time it went to MRP1 view.

It is working for me.

I think you need to use FREE memory statement after calling the funtion module.

Regards,

Sudheer

Former Member
0 Kudos

Hi

You should run this fm in debug mode, probably some variables of that fm are not cleared, so they have old values in the next call.

Max