$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: true, vro: true, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

prompt event(s) for scripting?

Hello,

are somewhere events for prompt execution ("OK" / "Cancel" Button) available?

The scenario is: Application with a BEx Query Datasource (DS_1). The BEx Query has an input ready, mandatory, single value variable for 0FISCYEAR. In the application I want to show the selected year in a text box via the Script Code..

TEXT_1.setText(DS_1.getVariableValueExt("Z_VAR_0FISCYEAR_M_SV_M"));

Including this code in the "On Startup" event of the application works fine. The prompt dialog is shown in the beginning and the according text is set after I choose a year and press the OK-Button of the prompt. Unfortunately I am stuck when I want to enable the endusers to refresh the prompt without having to start the application all over again. E.g. by a button with the "On Click" script code..

APPLICATION.openPromptDialog(600, 600);

(like described in http://scn.sap.com/docs/DOC-41393)

First idea was to put the setText-method directly underneath the openPromptDialog-method in the "On Click" event of the button. But then the prompt is shown and the text is refreshed directly after that - with the selected year of the prior(!!!) prompt execution.

Executing the prompt via the button doesn't trigger the "On Startup" event of the application again.

So what I probably need is something like prompt events.. And I cannot find anything like that..

Any ideas are appreciated!

Best regards,

Marco

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 11, 2013 at 09:34 PM

    Hi Marco,

    the thing is that openPromptDialog is not a component (with properties and events to control),

    If you use the filterpanel component, you will notice that it has very handy events: "On Apply" and "On Cancel", maybe use this as a workaround?

    Or else you could create your own dropdown, there you can also use the event "On Select".

    Best regards,

    Victor

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Marco,

      if you have costcenters, too many to list you can use the inputbox or work with cascaded filters

      (see tutorial)

      With the inputbox your code would look like something like this

      APPLICATION.setVariableValueExt("Z_VAR_0FISCYEAR_M_SV_M", INPUTFIELD_1.getValue());

      In this case you can even input something like 800* if you want all the costcenters starting with 800.


  • Jun 15, 2013 at 06:06 AM

    Hi Marco,

    Any luck with prompt based actions?

    In my case, I cannot use dimension filter or filter panel as I dont want to filter out my data set, but pass a variable through prompt that will be used in a restricted key figure. I wanted to have text changed after the new variable value is submitted through prompt, but no way to do it.

    As shown below, I use the prompt to select one country and calculate value for this country and for all other countries.

    With the prompt, my gauge works fine with the default prompt value with on startup event

    When I change the country with the prompt, my gauge changes, but the % value is not able to change as there is no event to refresh it

    Also there is no way to get the prompt value to be used inside the application.

    Let me know if you found a way to tweak it.

    Thanks,

    Murali

    Add comment
    10|10000 characters needed characters exceeded

    • One thing I wanted to point out is:

      Query response after prompt value submission has to be fast, otherwise, setText from DS in the onclick event does not have the latest data, but the old data prior to the refreshing of the query.

      You are correct. openPromptDialog is not of much help without any related events.

  • avatar image
    Former Member
    Jun 27, 2013 at 06:16 PM

    Marco

    Forcing the datasource to load after accepting the prompt but before setting the text should help.

    APPLICATION.openPromptDialog(.....);

    DS_1.loadDataSource();

    TEXT_1.setText(DS_1.getVariableValueText("..."));

    Add comment
    10|10000 characters needed characters exceeded