cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple transaction codes

babowden
Explorer
0 Kudos
319

Hello, I have been trying to write a script to complete the following in MB11.

1. Using a text field enter an equipment record number the click 'SEND' button.

2. This will then goto IE03 and grab the following data, Material Master, Serial Number, Plant, and Storage Location.

3. Return to MB11 and then apply the above data to the relevant fields (vendor number will be always the same) and then post.

Ideally I would like the message then displayed below the text field where we applied the Equipment Record in step 1.

Is this possible in personas scripting? Your help is greatly appreciated.

Regards,

Ben

kmagons
Advisor
Advisor

Hi Benjamin,

The described requirement generally sounds like a typical SAP Screen Personas automation case.

Could you please share some additional details on what have you tried and where are you stuck with the implementation?

Thank you!

Best regards,

Krists Magons

SAP Screen Personas Dev Team

babowden
Explorer
0 Kudos

Hi Krists,

Thank you for replying to my question.

I have applied the following script, but something is not working,

// copy ER from text box; assign to variable "EQUIP"

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

// enter IE03 into OKcode field, press enter. paste ER on IE03, press enter

session.findById("wnd[0]/tbar[0]/okcd").text = "/NIE03";

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

session.findById("wnd[0]/usr/ctxtRM63E-EQUNR").text = EQUIP;

session.findById("wnd[0]/usr/ctxtRM63E-EQUNR").setFocus();

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

session.findById("wnd[0]/usr/subSUB_EQKO:SAPLITO0:0152/subSUB_0152A:SAPLITO0:1520/ctxtITOBATTR-EQUNR").setFocus();

session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06").select();

// grab serial number, material number, plant and sloc

var SERN = session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122A:SAPLITO0:1521/txtITOB-SERNR").text;

var MAT = session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122A:SAPLITO0:1521/ctxtITOB-MATNR").text;

var PLANT = session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-B_WERK").text;

var SLOC = session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-B_LAGER").text;

// return to MB11 and paste equipment record data

session.findById("wnd[0]/tbar[0]/okcd").text = "/NMB11";

session.findById("wnd[0]/usr/subSUB_EQKO:SAPLITO0:0152/subSUB_0152A:SAPLITO0:1520/ctxtITOBATTR-EQUNR").setFocus();

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

// An OnLoad or OnAfterRefresh script was executed.

session.findById("wnd[0]/usr/ctxtRM07M-BWARTWA").text = "541";

session.findById("wnd[0]/usr/ctxtRM07M-WERKS").text = PLANT;

session.findById("wnd[0]/usr/ctxtRM07M-LGORT").text = SLOC;

session.findById("wnd[0]/usr/ctxtRM07M-LGORT").setFocus();

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

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-MATNR[0,7]").text = MAT;

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/txtMSEG-ERFMG[0,26]").text = "1";

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-ERFME[0,44]").text = "EA";

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-ERFME[0,44]").setFocus();

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

session.findById("wnd[0]/usr/ctxtMSEGK-LIFNR").text = "1012280";

session.findById("wnd[0]/usr/ctxtMSEGK-LIFNR").setFocus();

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

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-ERFME[0,44]").setFocus();

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

session.findById("wnd[1]/usr/tblSAPLIPW1TC_SERIAL_NUMBERS/ctxtRIPW0-SERNR[0,0]").setFocus();

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

session.findById("wnd[0]/usr/txtSERNR-LOW").text = SERN;

session.findById("wnd[0]/usr/txtSERNR-LOW").setFocus();

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

session.findById("wnd[1]/usr/tblSAPLIPW1TC_SERIAL_NUMBERS/ctxtRIPW0-SERNR[0,0]").setFocus();

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

session.findById("wnd[0]/usr/sub:SAPMM07M:0421/txtMSEG-ERFMG[0,26]").setFocus();

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

// An OnLoad or OnAfterRefresh script was executed.

session.findById("wnd[0]/usr/txtPersonas_163776937692570").text = "";

babowden
Explorer
0 Kudos

I think it is getting stuck on the Maintain Serial Numbers box.

Thomas_Mangler
Active Participant
0 Kudos

try to use

session.callTransaction("IE03");

instead of

session.findById("wnd[0]/tbar[0]/okcd").text = "/NIE03";

session.callTransaction opens a new dependant session. With F3 or a back-Command you get back to your start transaction MB11

babowden
Explorer
0 Kudos

Hi Thomas,

Thank you. I have applied this change and i still seem to be facing a backend log problem, I.e. it still doesnt work. 😞

View Entire Topic
babowden
Explorer
0 Kudos

Hi Tamas,

Thank you, this has worked perfectly.

While i have your expert attention, may i ask how to apply two drop down boxes and when i populate one with say the `PLANT`, the other drop down box values `STORAGE LOCATION` change depending on the PLANT selection?

Many Thanks,

Ben