cancel
Showing results for 
Search instead for 
Did you mean: 

I am doing scripting for ZMM01.

Former Member
0 Kudos

My requirement is to create material in ZMM01. I have done basic recording from standard MM01 but i am not abale to create material.

Here iam attaching screen short and code  can any one suggest me to right direction.

//session.findById("wnd[0]/tbar[0]/btn[11]").press();

//Transaction MM01

//debugger;

session.findById("wnd[0]/usr/cmbRMMG1-MBRSH").key='1';

  

//var IndustrySector = session.findById("wnd[0]/usr/txtPersonas_1444402317691").text;

session.findById("wnd[0]/usr/cmbRMMG1-MTART").key='ERSA';

//var MaterialType  =  session.findById("wnd[0]/usr/txtPersonas_1444402325775").text;

//console.log(MBRSH);

// Basic Data1 tab

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB1:SAPLMGD1:1002/txtMAKT-MAKTX").text = "test";

//var materialdes = session.findById("wnd[0]/usr/txtPersonas_1443692959584").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MEINS").text = "ea";

//var BUM = session.findById("wnd[0]/usr/txtPersonas_1443693023651").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MATKL").text = "01";

//var materialgroup = session.findById("wnd[0]/usr/txtPersonas_1443694231198").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB2:SAPLMGD1:2001/ctxtMARA-MSTAE").text = "z1";

//var X-plantmatlstoragelocation = session.findById("wnd[0]/usr/txtPersonas_1443694267274").text;

//Purchasing Tab

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP09/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2313/txtMARC-WEBAZ").text = "1";

//var puchasinggroup = session.findById("wnd[0]/usr/txtPersonas_1443694358287").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP09/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2301/ctxtMARC-MMSTA").text = "z1";

//var spmatlstatus = session.findById("wnd[0]/usr/txtPersonas_1443694386413").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP09/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2302/ctxtMARA-EKWSL").text = "2";

//var purchasingvalu = session.findById("wnd[0]/usr/txtPersonas_1443694411205").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP09/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2301/ctxtMARC-EKGRP").text = "201";

//var GRprocessing =  session.findById("wnd[0]/usr/txtPersonas_1443694439249").text;

//MRP1 TAB

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/ctxtMARC-DISLS").text = "HB";

//var MRPGROUP = session.findById("wnd[0]/usr/txtPersonas_1443694617847").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/txtMARC-BSTMI").text = "1";

//var lotsize = session.findById("wnd[0]/usr/txtPersonas_1443694624481").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/txtMARC-BSTMA").text = "5";

//var minimumlotsize = session.findById("wnd[0]/usr/txtPersonas_1443694740168").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/txtMARC-MABST").text = "20";

//var maximumlotsize =  session.findById("wnd[0]/usr/txtPersonas_1443694787055").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2483/txtMARC-BSTRF").text = "1";

//var maximumstocklevel  =  session.findById("wnd[0]/usr/txtPersonas_1443694853041").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP12/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2481/ctxtMARC-DISGR").text = "0000";

//var roundingvalue = session.findById("wnd[0]/usr/txtPersonas_1443694999814").text;

//MRP2 TAB

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:2485/txtMARC-PLIFZ").text = "90";

//var storagelocEP = session.findById("wnd[0]/usr/txtPersonas_1443695065272").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-LGFSB").text = "0001";

//var stockdet.grp = session.findById("wnd[0]/usr/txtPersonas_1443695122594").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP13/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2484/ctxtMARC-EPRIO").text = "0001";

//var planneddelivtime = session.findById("wnd[0]/usr/txtPersonas_1443695151558").text ;

//MRP3 TAB

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP14/ssubTABFRA1:SAPLMGMM:2000/subSUB4:SAPLMGD1:2493/ctxtMARC-MTVFP").text = "z2";

//var availabilitycheck = session.findById("wnd[0]/usr/txtPersonas_1443695433245").text;

//PLANT DATA/STOR.2 TAB

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP20/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:5801/ctxtMARC-SERNP").text = "0001";

//var serialno.profile = session.findById("wnd[0]/usr/txtPersonas_1443697393604").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP20/ssubTABFRA1:SAPLMGMM:2000/subSUB3:SAPLMGD1:5801/ctxtMARC-LOGGR").text = "BULK";

//var handlinggroup = session.findById("wnd[0]/usr/txtPersonas_1443697426293").text;

//ACOUNTING2 TAB

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP24/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2800/subSUB2:SAPLMGD1:2802/ctxtMBEW-VPRSV").text = "s";

//var pricecontrol = session.findById("wnd[0]/usr/txtPersonas_1444388163362").text;

session.findById("wnd[0]/usr/tabsTABSPR1/tabpSP24/ssubTABFRA1:SAPLMGMM:2000/subSUB2:SAPLMGD1:2800/subSUB2:SAPLMGD1:2802/txtMBEW-STPRS").text = "10.09";

//var standardprice = session.findById("wnd[0]/usr/txtPersonas_1444388173476").text;

session.findById("wnd[0]").sendVKey(0);

session.findById("wnd[1]/usr/btnSPOP-OPTION1").press();

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sonar,

I hope your going to create Custom ZMM01 right. In that case what are the required inputs you required

in that custom ZMM01. and create material is required in the same screen?

former_member202682
Participant
0 Kudos

Murali,

Yes I will be creating a flavor somthing like a dashboard where user can select what type of material he/she wants to create and then was hoping to call another flavor and pass values from the dashboard flavor to mat type flavor.

Regards,

AShwini

Former Member
0 Kudos

What exactly goes wrong? Your screen shot doesn't make that clear. "Not able to create material" isn't very specific...

Steve.

Former Member
0 Kudos

while i am clicking on create button the above error is comming.

pls suggest me to go forward

Former Member
0 Kudos

Hi Steve,

please guide me.

Former Member
0 Kudos

The error says "control not found" and references a fields called "MBRSH". That suggests to me that you are trying to put a value in that field - industry sector - and it isn't on the current screen of the backend system. This is the first thing your script does, so something is going wrong right at the beginning.

You talk about ZMM01. What is that? A custom transaction? The name of the flavour you've built for MM01?

Steve.

Former Member
0 Kudos

Hi Steve,

shall i remove industry sector and material type from the existing screen.

ZMM01 it is the name of the flavor.

Former Member
0 Kudos

I'm not sure that will help. Your script is trying to put a value into the industry sector field and it isn't being found. The script you posted above is attached to the "create material" button, right? There's nothing else going on that might navigate away from this screen before the script starts?

I'm puzzled.

Further down in your script you don't seem to be navigating properly. For example, after completing the industry sector and material type you go straight to filling in data on basic data 1. You need to get there first! And you need to move from tape to tab as you complete the other data.

I'm inclined to suggest you start again. Record yourself creating a material, and then modify that recording to use data from this screen you've built.

I know this process in general works because we've built a flavour ourselves that does almost the same thing.

Steve.

former_member202682
Participant
0 Kudos

Steve,

I am trying to create a flavor for MM01- Material Creation. I will have to create a flavor for the MM01 Create Material initial screen and another flavor for Views seelcted.I can also switch flavor inside the first one but how do I pass the values example Material Number from MM01 Initial Flavor to the Views Flavor? Using session.utlis.put and session.utils.get will work in different flavor? or different scripts on same flavor? I tried using put in one flavor script and get in another but it didnt do anything for me. I defined the same variable in both flavor scprit.

If I create a custom flavor and call MM01 on my script button  , I want to call directly the view flavor but how do I pass the values from custom screen to the view flavor? Also if I want my view flavor to have recording for the first intial steps until it reach the views and then modify the view using tab merning,  where do I attach this script. How to assing ac script to the OnLoad Event of a screen?

I am trying things out but just coming to dead end! Please advise

Thanks,

AShwini