cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple transaction codes

babowden
Explorer
0 Kudos

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. 😞

Accepted Solutions (0)

Answers (5)

Answers (5)

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

babowden
Explorer
0 Kudos

Hi All,

I have cracked it! 🙂 Using MIGO instead of MB11 seemed to have worked.

The only thing i would like to add is the ability to return the Performance Assistance message detailing the material document number in a text field bellow my script button.

Is this possible?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I think you could try reading the table data from the popup into an array, parse it and extract the created document number from it. I never tried this though so this is just a guess.

Alternatively, perhaps reading the memory parameter MBN via an RFC may work, since that should be set when a new material document is created.

babowden
Explorer
0 Kudos

Hi Tamas,

Thank you for your reply. I am not completely sure what or where the script is going wrong, but it seems to get stuck at the point of applying the serial number. And i have noticed that i am unable to inspect this field and obtain the `text string` for me to link the `SERN` (Serial Number) i have obtained from IE03.

In theory this seems like a simple script to apply. And if i can crack this, it will open a raft of opportunity for us to streamline business processes.

I appreciate any help anyone can provide on this.

Many Thanks,

Ben

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Looks like the best would be to create a support incident and provide access to the system, with a full description on how to reproduce the issue, screen shots etc. That way our support team can look at the problem.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Benjamin,

You say that "something is not working". What is this "something", i.e. what is the exact problem you are experiencing?

Also, are those

// An OnLoad or OnAfterRefresh script was executed.

lines just comments in your script or come from somewhere else?

Damean
Active Contributor
0 Kudos

Personally, I never have much success when it comes to inter-transaction scripts i.e. If I launch another transaction\session; I just couldn't figure out how to make that new transaction\session communicate back to my original transaction\session.

To get around this; I typically end up using an RFC call. i.e. Create an RFC that mimic your call to IE03; and then return the result directly to the Personas Script.

HTH ...