cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Personas speed optimization

Martin_Jaksa70
Explorer
0 Likes
820

Hi.

I have built a complex flavor with a lot of scripts and logic. Now I would like to optimize speed and backend requests. I have separated different topics into points.

I am working on ECC 6.8 with Personas SP17 (updated to the latest note), working with Slipstream Engine.

1. I have a problem with mobile flavor with speed. My flavor is working great on computer using Chrome. But when using a mobile handheld (in my case Crosscall Core-T4, that I checked all the settings), every click takes about 10 seconds, to 7 seconds to reach back-and and show (for example: run a transaction, skip selection screen, show alv results). I tried using WEB GUI, tried even the original screen but still the same problem. I searched the internet and some similar questions were there but no answer. Is there any possibility of seeing, why it is taking that long? Any debuger (monitor) available for Android? I tried the same scenario on my phone and it's working ok. So I suppose it's a tablet problem, but why? How to aproach to identify the long wait for every click?

2. Optimization of the script to reduce backand requests

I have simple script in many fields to read the script button value. Every time I press the button it goes to back-and and puts value in defined field (white screen shows). How should I skip back-and trips?

 

 

session.findById("wnd[0]/usr/ctxtGS_0210-ITEM-MAIN-VEHICLE_ID").text = '';
var objInputControl = session.findById("wnd[0]/usr/ctxtGS_0210-ITEM-MAIN-VEHICLE_ID");
objInputControl.text += source.text;

 

 

Martin_Jaksa_0-1706711579431.png

(by the way, I have Label + Script button overlapping, so it reads the script button text (invisible), but it shows label with text. Do you have any other approach, hot to use buttons to enter value?)

3. Using snapshot mode

I went through Open sap and a youtube video from Krists, showing how to use Snapshot, but it is for now to complicated for me, (not a programmer). Could you explaint to me how to use it with example. And if I think the right way to use this. As I understand, I use snapshot to send some request in back-end and it sends me back to front-and as package all the information. So if for example I have a simple script to start the transaction, fill up the data I want and send it in one shot back to front end. How would I build the script?

 

 

session.utils.startSnapshotMode();
session.startTransaction('ZWST_ORDER');
session.findById('wnd[0]/usr/ctxtS_HBUKRS-LOW').text = '02';
session.findById('wnd[0]/usr/ctxtS_HCAT-LOW').text = 'A';
session.findById('wnd[0]/usr/ctxtS_HTYPE-LOW').text = 'A';
session.findById('wnd[0]/usr/ctxtS_HSTAT-LOW').text = '1';
session.findById('wnd[0]/usr/txtP_VAR').text = '/POSTAVKA';
session.findById("wnd[0]/usr/radR_I").selected = true;
session.findById("wnd[0]/usr/ctxtS_ISTAT-LOW").text = "1";
session.utils.stopSnapshotMode();

 

Or am I totally of track?

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert

If the handheld is the only device where you experience the slow response time, then it is almost certain that the problem is with the device itself. Especially since as you wrote, not even with Original Screen is the performance acceptable, so the issue is clearly not caused by your flavor.
I don't know that Crosscall Core-T4, and unfortunately cannot offer a good method to troubleshoot the problem, but perhaps you can see something by using the Profiler in Slipstream. That may give you a clue where the time is spent.

As for the script optimization, it is important to ensure that you have no alternating read-write commands in your script, as much as that's possible. Those will trigger a backend roundtrip which is detrimental to performance. So, by first performing all read actions and then the writes, you are avoiding the extra roundtrips.

About the snapshot mode, I think the video from Krists explains really well what is happening and how this helps with complex navigation across multiple screens and actions, instead of doing them one at a time, which - again - will result in a lot of roundtrips that we want to avoid. I believe you are on the right track how this would be useful for your example; you just need to experiment a little to figure out what works best for you. In the snapshot, you'd want to include all actions you need to perform for the called transaction.

Martin_Jaksa70
Explorer
0 Likes

Tamas, Krists, I am still struggling with this snapshot mode. I simply can not get it to work. Could you please check my code, when I am gathering data from equipment different tabs, how should I enter snapshot to speed the read? Where to put start stop, how to take snapshot?

// 1. Read all serial numbers from the multiline input field var serijske = session.findById("wnd[0]/usr/textEditPersonas_175394649736346").text.split("\n"); // Final result array var output = []; // 2. Loop through all serial numbers for (var i = 0; i < serijske.length; i++) { var serijska = serijske[i].trim(); if (serijska === "") continue; // skip empty lines // Enter IH08 transaction session.callTransaction("IH08"); session.findById("wnd[0]/usr/txtSERNR-LOW").text = serijska; session.findById("wnd[0]/usr/ctxtEQTYP-LOW").text = "J"; session.findById("wnd[0]/tbar[1]/btn[8]").press(); // If no data is found, log only serial number with NOT_FOUND if (!session.idExists("wnd[0]/usr/tabsTABSTRIP/tabpT\\01/ssubSUB_DATA:SAPLITO0:0102/subSUB_0102B:SAPLITO0:1060/ctxtITOB-SUBMT")) { output.push(serijska + "\tNOT_FOUND"); session.findById("wnd[0]/tbar[0]/btn[3]").press(); // back session.utils.changeFlavor("00155D0207661FE08ACBD6B0C3DA437C"); continue; } // Read basic data from tab T01 var material = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\01/ssubSUB_DATA:SAPLITO0:0102/subSUB_0102B:SAPLITO0:1060/ctxtITOB-SUBMT').text; var opis = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\01/ssubSUB_DATA:SAPLITO0:0102/subSUB_0102B:SAPLITO0:1060/txtMINST-MAKTX').text; var crtnaeq = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\01/ssubSUB_DATA:SAPLITO0:0102/subSUB_0102B:SAPLITO0:1060/subSUB_1060A:SAPLITO0:1065/txtITOB-TIDNR').text; var obrat = "", strankaeq = ""; // Check if data is in tab T07 session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\07').select(); if (session.idExists("wnd[0]/usr/tabsTABSTRIP/tabpT\\07/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/txtEQBS-LBBSA")) { // Read from tab T07 obrat = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\07/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-B_WERK').text; strankaeq = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\07/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-KUNNR').text; } else { // Otherwise, read from tab T06 session.findById("wnd[0]/usr/tabsTABSTRIP/tabpT\\06").select(); obrat = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-B_WERK').text; strankaeq = session.findById('wnd[0]/usr/tabsTABSTRIP/tabpT\\06/ssubSUB_DATA:SAPLITO0:0122/subSUB_0122C:SAPLITO0:1220/ctxtEQBS-KUNNR').text; } // Save data in output array, separated by TAB output.push([serijska, material, opis, crtnaeq, obrat, strankaeq].join("\t")); // Exit IH08 and return to previous flavor session.findById("wnd[0]/tbar[0]/btn[3]").press(); session.findById("wnd[0]/tbar[0]/btn[3]").press(); session.utils.changeFlavor("00155D0207661FE08ACBD6B0C3DA437C"); } // 3. Write all collected results into the target multiline text field session.findById("wnd[0]/usr/textEditPersonas_175672128663647").text = output.join("\n");