@Prompt Function in Business Objects

What do you do when your report needs an input (filter) from user in order to run report. You use @prompt function.

Ex: User does not want to see all 10 years of data that we have in our data mart. Instead he/she would enter or option to select year value before report run.

Prompts can be used to restrict the data or to make large value objects easier to use. You use the @Prompt function in the WHERE clause for an object. It forces a user to enter a value for a restriction when that object is used in a query, or to select a value or a list of values. When the user runs the query, a prompt
box appears asking for a value to be entered.

It is used as an interactive filter ( condition ) in the report, which allows user to enter value. Query will be executed and results will be displayed in the report based on the prompt value.

It limits the result set based on user response. It improves the performance as pulling limited data.

@prompt function syntax:

Minimal use of the @Prompt function:
@Prompt(‘Displayed text ‘,’A’,,,)

Using the @Prompt with a LOV without default values:
@Prompt(‘Displayed text ‘,’A’,{‘Paris’,’London’,’Madrid’},,)

Using the @Prompt with a LOV and one default value:
@Prompt(‘Displayed text ‘,’A’,{‘Paris’,’London’,’Madrid’},,,,{‘Paris’})

Using the @Prompt with an object and a default value:
@Prompt(‘Displayed text ‘,’A’,’Store\City’,,,,{‘Paris’})

Using the @Prompt with all possible settings:
@Prompt(‘Displayed text ‘,’A’,’Store\City’,Mono,Constrained,Persistent,{‘Paris’})

Using the @Prompt with a LOV containing pairs of values, without default values:
@Prompt(‘Displayed text ‘,’A’:’N’,{‘Paris’:’12’,’London’:’7′,’Madrid’:’15’},,)

Using the @Prompt with a LOV containing pairs of values, and one default
pair of values:
@Prompt(‘Displayed text ‘,’A’:’N’,{‘Paris’:’12’,’London’:’7′,’Madrid’:’15’},,,,{‘Paris’:’12’})

Leave a Reply