cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas - Event that fires after F4 help selection

Thomas_Mangler
Active Participant
0 Kudos

Is there a way to do some script action after a F4 help value was selected?
In many usecases you have to select a value with the F4 search help and then continue to the next screen with a button or the Enter Vkey.
I will implement this in one step.


With the onAfterRefresh - event it does not work properly.

Best regards

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

cris_hansen
Advisor
Advisor
0 Kudos

Hi Thomas,

Have you checked this blog?
And this wiki?

Kind regards,
Cris

Thomas_Mangler
Active Participant
0 Kudos

Hi Cristiano,

Thx for answering to my long time ago question.

My problem was not to create a code triggered F4 Help pop-up.
I wanted to do some coding after the manual selection of an F4 help pop-up value:


Scenario:
> klick any F4 Help
> select any value with double click
> after the value is taken over to the main Screen i want to do an automatic scripting.


I think at that time i have done this in two steps (double click the value and then press a scripting button)


best regards,

Thomas


cris_hansen
Advisor
Advisor
0 Kudos

Hi Thomas,

I'll have a look at this scenario during the week.

I'll come back to you until Friday.

Kind regards,

Cris

cris_hansen
Advisor
Advisor
0 Kudos

Hi Thomas,


I think I got it. Let me explain what I did.

1) Put a F4 Help Text Field and a Label in a new flavor. The F4 Help Text Field was linked to SUID_ST_BNAME table, BNAME field. The Label is meant to hold a text after I double click an item from the search help.

2) I wrote 2 scripts, for OnLoad and OnAfterRefresh screen events.


The scripts:

OnLoad:

var userID = session.findById("wnd[0]/usr/ctxtPersonas_152459447653923").text;
session.utils.put("user",userID);
session.findById("wnd[0]/usr/lblPersonas_152459451218351").text = "";

OnAfterRefresh:

var userID = session.utils.get("user");
var userF4 = session.findById("wnd[0]/usr/ctxtPersonas_152459447653923").text;

if (userID == userF4) {
return true;
}

session.utils.put("user",userF4);
session.findById("wnd[0]/usr/lblPersonas_152459451218351").text = userF4;

As you can see, when the screen is loaded, I get the text from the F4 Help Text Field and keep in memory. The label text is cleared.

When I use the search help and double click an element, the second script comes into action: I get the previous value, from memory, and compare with the actual result, already written in the field. If they are equal, I do nothing, otherwise I store the new value and display it in the label.

Is this something you already tried? Does it fit your needs?

Kind regards,

Cris