cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

eric_festinger
Contributor
0 Kudos

hello Kristof,

Your remark makes sense: we would need to discuss about that internally.

Regards,

eric

Former Member
0 Kudos

Thanks Eric.

Also, I meant to refer to the @hierarchical attribute instead of @refreshable, but I can't seem to edit the original post anymore.

former_member197386
Active Contributor
0 Kudos

Hello Kristof,

Do you need further help?

Best regards,

Anthony

Former Member
0 Kudos

Hi Anthony,

Judging from your previous reply, I'm guessing that there's currently no way to determine whether or not to provide index values. I take it this will be something that might be added in a future release.

Kind regards,

Kristof Speeckaert

Former Member
0 Kudos

Hi Anthony,

Just FYI, I've also noticed that when you have 2 BEx variables, and you only define 1 of them as a prompt (using the BEx variable window in the Webi Query Panel), the REST SDK will still report all of BEx variables as prompts, instead of the 1 variable that was checked as prompt.

(this happens in BI 4.1 SP4 Patch 4)

In the query panel:

  1. Uncheck Use BEx query defined default values at runtime
  2. Uncheck the Set as prompt checkbox for the second variable.

REST SDK output for GET /biprws/raylight/v1/documents/{docid}/parameters?lovInfo=false :

{

  "parameters": {

    "parameter": [

      {

        "@dpId": "DP0",

        "@type": "sapVariable",

        "@optional": "false",

        "id": 0,

        "technicalName": "ZMXXXX",

        "name": "XXXXX",

        "answer": {

          "@type": "Text",

          "@constrained": "true",

          "info": {

            "@cardinality": "Multiple",

            "lov": {

              "@refreshable": "true",

              "@hierarchical": "true",

              "id": "UNIVERSELOV_DS0.:M:STR:ZMXXXX"

            }

          }

        }

      },

      {

        "@dpId": "DP0",

        "@type": "sapVariable",

        "@optional": "false",

        "id": 1,

        "technicalName": "ZYYYYYY",

        "name": "YYYYYYYY",

        "answer": {

          "@type": "Text",

          "@constrained": "true",

          "info": {

            "@cardinality": "Multiple",

            "lov": {

              "@refreshable": "true",

              "@hierarchical": "true",

              "id": "UNIVERSELOV_DS0.:M:STR:ZYYYYYY"

            }

          }

        }

      }

    ]

  }

}

former_member197386
Active Contributor
0 Kudos

Hi Kristof,

Thanks a lot for raising this issue.

Saritha told me she will have a closer look soon to reproduce it in house.

Best regards,

Anthony

eric_festinger
Contributor
0 Kudos

hi Kristof...  (and Anthony )

Maybe it should be moved to a new discussion, but... the fix regarding the SAP variables not set as prompts, is done now, and should be available starting 4.1 SP5 Patch 7.

Regards,

eric

Former Member
0 Kudos

Hi Eric,

Thanks for letting me know!

Kind regards,

Kristof

Answers (0)