Skip to Content
0
Former Member
Apr 10, 2015 at 07:57 AM

How do you differentiate between indexed and non-indexed prompts?

28 Views

Hi,

I'm trying to fill Webi parameters dynamically, using the Webi REST SDK (4.1 SP04). This environment runs on top of SAP BW and uses BICS to connect to the BEx query.

When the prompt is implemented as a BEx variable, the call to GET /biprws/raylight/v1/documents/{docid}/parameters will show @type: sapVariable, which tells me it requires the values to be passed as an ID and (optionally) their description.

Prompts that are defined in the Webi query panel, return @type: prompt. This however doesn't indicate if they need the prompt value IDs or just their plain values.

Example (JSON):

{

"parameters": {

"parameter": [

{

"@dpId": "DP0",

"@type": "prompt",

"@optional": "false",

"id": 2,

"technicalName": "psTestPrompt",

"name": "TestPrompt",

"answer": {

"@type": "Text",

"@constrained": "false",

"info": {

"@cardinality": "Single",

"lov": {

"@refreshable": "false",

"@hierarchical": "false",

"id": "UNIVERSELOV_DS0.DO1a6"

}

}

}

}

]

}

}


In this case, I'll look at the value for @refreshable; if it's true, the prompt requires IDs, if false, just the plain values.

It's only when a prompt does not have an LOV associated with it (disabled in the prompt properties, see screenshot below), I won't have the lov information when retrieving the parameter information and thus won't be able to determine whether to pass value IDs or just plain values.

FYI, replying with prompt value IDs looks something like this:

{

"parameters": {

"parameter": [

{

"id": 2,

"answer": {

"values": {

"value": {

"@id": "000000123456",

"$": "123456"

}

}

}

}

]

}

}

Plain values looks like this:

{

"parameters": {

"parameter": [

{

"id": 2,

"answer": {

"values": {

"value": 123456

}

}

}

]

}

}

In short: how do I determine whether to pass values by ID or just their plain value given the prompt template retrieved through a GET /biprws/raylight/v1/documents/{docid}/parameters call?