on 2024 Dec 06 6:30 PM
Hi,
I am trying to convert sap bo sdk operations to sap bo rest api. So I am using below url to get document parameters;
http://<server>:<port>/biprws/raylight/v1/documents/<DOCID>/parameters
When I try this url to getting document parameters for almost all documents everything is okey and same with sap bo sdk but when I want to list the parameters of some documents, when I run this url, the parameters as in the SDK do not come. Some parameters that say 'Select a context'.
Sample response below;
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<parameters>
<parameter optional="false" type="context" dpId="DP0" primary="true">
<id>0</id>
<technicalName>0</technicalName>
<name>Select a context</name>
<answer constrained="true" type="Text" keyType="Numeric">
<info cardinality="Single" keepLastValues="true" dynamic="false">
<lov hierarchical="false" partial="false" refreshable="true" searchable="false">
<values>
<value id="1">Vehicle Test</value>
<value id="2">Vehicle Correct</value>
</values>
</lov>
</info>
</answer>
</parameter>
<parameter optional="false" type="context" dpId="DP1" primary="true">
<id>1</id>
<technicalName>0</technicalName>
<name>Select a context</name>
<answer constrained="true" type="Text" keyType="Numeric">
<info cardinality="Single" keepLastValues="true" dynamic="false">
<lov hierarchical="false" partial="false" refreshable="true" searchable="false">
<values>
<value id="1">Vehicle Test</value>
<value id="2">Vehicle Correct</value>
</values>
</lov>
</info>
</answer>
</parameter>
<parameter optional="false" type="context" dpId="DP2" primary="true">
<id>2</id>
<technicalName>0</technicalName>
<name>Select a context</name>
<answer constrained="true" type="Text" keyType="Numeric">
<info cardinality="Single" keepLastValues="true" dynamic="false">
<lov hierarchical="false" partial="false" refreshable="true" searchable="false">
<values>
<value id="1">Vehicle Test</value>
<value id="2">Vehicle Correct</value>
</values>
</lov>
</info>
</answer>
</parameter>
</parameters>
What is the reason for this issue? How can I access the parameters of the same document, which are obtained when triggered with the SDK, via the REST API as well?
Request clarification before answering.
The way /parameters works is that if all prompts have been answered, then the refresh is executed. If any prompts remain unanswered, then the response includes the XML like you have in your question. The reason this is happening is that you need to select a context for each query (you have one context for each of two queries). Once you do that with another PUT, then you'll get another XML response for the actual prompts.
To submit the request with parameters, you just need to take the XML you got in the response, and plug the desired values into parameters/parameter/answer/values. You can literally copy/paste from parameters/parameter/answer/info/lov/values if there's an LOV value that you want to use (which should be the case with all context prompts). I took your example response from above, and added the three parameter values (in bold). Note that the entire "info" key is not needed in the PUT. You can remove it or just leave it there, as I did below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <parameters> <parameter optional="false" type="context" dpId="DP0" primary="true"> <id>0</id> <technicalName>0</technicalName> <name>Select a context</name> <answer constrained="true" type="Text" keyType="Numeric"> <info cardinality="Single" keepLastValues="true" dynamic="false"> <lov hierarchical="false" partial="false" refreshable="true" searchable="false"> <values> <value id="1">Vehicle Test</value> <value id="2">Vehicle Correct</value> </values> </lov> </info>
<values>
<value id="1">Vehicle Test</value>
</values> </answer> </parameter> <parameter optional="false" type="context" dpId="DP1" primary="true"> <id>1</id> <technicalName>0</technicalName> <name>Select a context</name> <answer constrained="true" type="Text" keyType="Numeric"> <info cardinality="Single" keepLastValues="true" dynamic="false"> <lov hierarchical="false" partial="false" refreshable="true" searchable="false"> <values> <value id="1">Vehicle Test</value> <value id="2">Vehicle Correct</value> </values> </lov> </info> <values>
<value id="1">Vehicle Test</value>
</values>
</answer> </parameter> <parameter optional="false" type="context" dpId="DP2" primary="true"> <id>2</id> <technicalName>0</technicalName> <name>Select a context</name> <answer constrained="true" type="Text" keyType="Numeric"> <info cardinality="Single" keepLastValues="true" dynamic="false"> <lov hierarchical="false" partial="false" refreshable="true" searchable="false"> <values> <value id="1">Vehicle Test</value> <value id="2">Vehicle Correct</value> </values> </lov> </info> <values>
<value id="1">Vehicle Test</value>
</values>
</answer> </parameter> </parameters>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
48 | |
6 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.