Skip to Content
0

Scripting Change Using session.utils.showOptionDialog

Feb 26 at 05:21 PM

73

avatar image

Good afternoon.

In SP3 we were using session.utils.showOptionDialog with "undefined, undefined" to present simple error checking messages to the users.

Now that we have moved to SP6, we find the "undefined, undefined" parameter is no longer working and the pop ups no longer present.

Has anyone encountered this issue?

This is the error:

Error during script execution:
InvalidArgument - showOptionDialog(): Please provide five parameters (title, text, msgIcon, msgType, onOptionDialogClose).

Kind Regards,

Cristin

session.utils.showOptionDialog("Error", "Error Message", 
session.utils.MESSAGE_TYPE_ERROR, session.utils.MESSAGE_OPTION_OK, undefined, undefined);
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Tamas Hoznek
Feb 26 at 10:28 PM
0

This works:

session.utils.showOptionDialog("Error", "Error Message", session.utils.MESSAGE_TYPE_ERROR, session.utils.MESSAGE_OPTION_OK, onOptionDialogClose, "1");

function onOptionDialogClose(decision, ID){}
Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thank you, Tamas! That seems to work well.

Would you be able to comment on when the scripting changed to no longer use "undefined, undefined"? Are there any release notes that address this?

We've been following examples from an SAP Wiki.

https://wiki.scn.sap.com/wiki/display/Img/SAP+Screen+Personas+3.0+Scripting+-+Information+Pop-Ups

Kind Regards,

Cristin

0
Cristin Charbonneau

Hi Cristin,

Please see the answer from Clemens below about the reason why the syntax changed.

0

That's not good news Tamas ;(

I used the "undefined" style in nearly every script. So I'm not looking forward to SP06 ;)
There are many places which refer to the "undefined" coding, even in the personas wiki:

https://wiki.scn.sap.com/wiki/display/Img/SAP+Screen+Personas+3.0+Scripting+-+Information+Pop-Ups

Best regards,

Thomas

0

Hi Thomas,

Please see the answer from Clemens below about the reason why the syntax changed.

1
Clemens Gantert
Feb 28 at 08:36 PM
2

Hello Cristin,


this works too:

session.utils.showOptionDialog("Error", "Error Message", session.utils.MESSAGE_TYPE_ERROR, session.utils.MESSAGE_OPTION_OK, null, null);


We had to disallow "undefined" because the SAP GUI for Windows has an issue with it as method parameter values and we are tying to ensure that scripts are written in a manner that will make them execute in all supported GUIs.

Best Regards,

Clemens

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thx Clemens,

the notation with "null" is much easier to change in the scripts.

0