cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel infinite error on event onFinalize in SAP SCREEN PERSONAS

alexandreourth
Active Participant
0 Kudos
221

Hello,

I'm using the sap training developpement environement for SAP SCREEN PERSONAS. I have created a flavor for the SMEN and i'm trying to understand how to handle when a script is in error and how to get the hand back on my flavor so i can edit the script back and correct the error.

I have done on purpose an error on the onFinalize event of my flavor by calling a function with one missing parameter.

alexandreourth_0-1742592092132.png

Even if i close this popup, the system tries de reprocess the script and i'm stuck in a infinite loop.

I'm using Chrome dev tool, i see the script calling onFinalize

alexandreourth_1-1742592242406.png

Please provide me guidance on this because i'm sure there will be a case in real situation where this will happen...What can i do to to have the hand again on my flavor to edit it?

Thanks a lot for your time.

Regards,

Alexandre

 

Accepted Solutions (1)

Accepted Solutions (1)

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Instead of the hacking, the simple addition of URL parameter sap-personas-ignoreloadevents=X would have allowed you to avoid the endless loop upon the error, since that prevents firing the onLoad, onAfterRefresh and onFinalize events 🙂

alexandreourth
Active Participant

Well well...I knew this parameter i think i talk about it somewhere and also i have the documentation with all the parameters possible but where i failed is that to fill this parameter, at the end of "https://iccsrm.sap.com:44300/sap/bc/se/m/index.html" i had an & instead of a ?...& for next parameters and ? for the first, wrong copy/paste with my  URL samples.. Well at least i learned to use dev chrome tool a lot so that's not a total loss of time...i guess..

Thanks again for your time Tamas. 

Answers (3)

Answers (3)

alexandreourth
Active Participant
0 Kudos

Everyone,

I didn't found the perfect solution, like excluding the onFinalize event/script in the JS components but i've found ONE solution 🍾. The result of many hours trying things and debugging led me to this : 

alexandreourth_0-1742653895800.png

Check my breakpoint, at one point, you fall in this method when onFinalize is triggered (BE CAREFUL, this method is not triggered only by onFinalize so you have to check if it's the relevant http request you are handling). I've found out the t parameter contains a lot of things but mainly here, the faulty script that the framework try to load and raise each time an error!

You have to modify the t.body in the console of dev chrome tool. Right click on t.body -> copy content as literal then you open an editor like VLC, you paste everything and almost at the end of the file, you will see your script! you delete everything or you correct the anomaly. You put the correction back to t.body and you F8 in debug.

You do this every time (yes it triggers several times) until you reach flavor editor and then REMOVE the d*mn script associated to the onFinalize Event of the screen for you to apply corrections!

This led me to better understand chrome dev tools and how i can see/manipulate things so it's not a total loss of time.

I hope this will help others. Good luck

Alexandre

alexandreourth
Active Participant
0 Kudos

I tried a new error like this one :

alexandreourth_0-1742598801824.png

and now i have this message

alexandreourth_1-1742598828477.png

It must be another kind of error and here i can't change the JS content using. Don't know what to do....

Edit i know why...it's because i'm on my sub adaptative flavor where i can't modify JS file....still stuck

alexandreourth
Active Participant
0 Kudos

I have a partial answer : 

I found my onFinalize script in chrome dev tool

alexandreourth_0-1742597264171.png

i changed the json content, i save (Ctr+S) + right clic on the file and i chose "Override content". 

=> OK i'm back on the PERSONAS menu but when i tried to change the flavor, it triggered another time the script but in the adaptative flavor that i have underneath my main flavor...

alexandreourth_1-1742597552320.png

And THIS script was NOT editable. Maybe because it's the same when you are editing an adaptative flavor, it says that script can be edited only in main flavor....I/WE need a solution for this please, this is last missing step before i find my peace of mind!