Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Support for catch of prompt answer

I work on a report based on a query with three prompts:

In my example below the prompts are:

  1. "Räkenskapsår//period"
  2. "Ansvarigt Kostnadsställe/grupp (Optional)"
  3. "Företag (Optional)"

I want to catch the user respons for each promptanswer.

With the function PromptSummary I catch:

" *** Query Name:Ack ***

    Räkenskapsår/period SEP 2015

    Ansvarigt Kostnadsställe/grupp (Optional)INFORMATION MANAGEME

    Företag (Optional)"

On Bob I found this:

Replace(Replace(
Substr( PromptSummary() ; Pos( PromptSummary() ; "    " ) ;
( Length(PromptSummary()) +2 - (Pos( PromptSummary() ; "    " )*NumberOfDataProviders())) / NumberOfDataProviders() )
; ";" ; ", ");"    ";"")


wich results in

"Räkenskapsår/period SEP 2015

Ansvarigt Kostnadsställe/grupp (Optional)INFORMATION MANAGEME

Företag (Optional)"

That's a start, but not what I want.

Instead I were trying with this:

=Substr(PromptSummary();Pos( PromptSummary() ; "period" )+7;8)

This gets exactly what I want: "SEP 2015"

Not so nice to search for a word in the promptstring, and not so nice to manually enter how many characters to add for start of substring.

When it comes to next promptanswer it's harder to perform:

With this try:

=Substr(PromptSummary();Pos( PromptSummary() ; "grupp" )+16;100)

I get not only the promptanswer, I get the hole tail of the string. Of course I could try to check how long the string is. But I am at the point to ask for a function I haven't found in webi:

I want a function that takes care of this, something like:

promptanswer(dataprovider;promptdimension;headeroption;userrespons)

In my case

prompt_period=promptanswer(query_A;räkenskapsår/period;No;Value)

which would give me "SEP 2015" from my example.

This function would be permissive for if the query or object would change name or structure. I think its cool with all the substringing but its very intolerant. 

Or is there any other way that I have found yet?

/Henrik

replied

Hey Henrik,

Create the below 3 variables to get the prompts answers separately. Make sure you have the exact same text as you see in the prompt, you can't miss anything, except for that "Optional," if you didn't add that manually.

  1. v_UserResponseforPrompt1 = Userresponse("Räkenskapsår//period")
  2. v_UserResponseforPrompt2 = Userresponse("Ansvarigt Kostnadsställe/grupp")
  3. v_UserResponseforPrompt3 = Userresponse("Företag")

Thanks,
Mahboob Mohammed

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question