cancel
Showing results for 
Search instead for 
Did you mean: 

refreshing a document (REST) with a date sapVariable

Former Member
0 Kudos

Hello,

we are trying to refresh a document (set prompts) that contains a date sapVariable but get back a "(400) Bad Request.":

In the document are two parameters (one datetime and one LOV) - the datetime parameter is causing the "Bad Request" behavior.

The WebI is a 4.1SP2 system.

response to/biprws/raylight/v1/documents/.../parameters (GET):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

  <parameters>

  <parameter dpId="DP4" type="sapVariable" optional="false">

  <id>0</id>

  <technicalName>ZBXKDT</technicalName>

  <name>Key Due Date</name>

  <answer type="Date" constrained="false">

  <info cardinality="Single">

  <previous><value>2015-01-20T01:00:00.000+01:00</value></previous>

  </info>

  <values>

  <value>2015-01-20T01:00:00.000+01:00</value>

  </values>

  </answer>

  </parameter>

- <parameter dpId="DP4" type="sapVariable" optional="false">

  ... other parameter that works

  </parameter>

  </parameters>

I try to set the parameter with the following XML. the type="sapVariable" is not documented in the REST API docs, I tried it without type but it did not work either.

<parameters>

     <parameter optional="false" type="sapVariable">

          <id>0</id>

          <answer type="DateTime"><values><value id="1">2015-01-20T01:00:00.000+01:00</value></values></answer>

     </parameter>

     <parameter optional="false" type="sapVariable">

          <id>1</id>

          <answer type="Text"><values><value id="1">M Bags Steti</value></values></answer>

     </parameter>

</parameters>

I can't see any error in my request nevertheless i do get the "Bad Request" response.

Has anybody an idea what i could change to get that working?

Best regards,

Rainer

Accepted Solutions (1)

Accepted Solutions (1)

eric_festinger
Contributor
0 Kudos

hello Rainer,

Answering with the following XML:


<parameters>

     <parameter>

          <id>0</id>

          <answer><values><value>2015-01-20T01:00:00.000+01:00</value></values></answer>

     </parameter>

     <parameter>

          ...

</parameters>

.. should be enough.


Please note that I removed the id from the given values (...<value id="1">2015-0...), as it seems from the GET answer that your values are not indexed.

However, as Saritha previously wrote, we'd need more information, like at least the error message from the answer, or even better, the stack trace (you may activate it, and the logs as well through CMC -> Servers -> Web Application Container Server -> properties).

Regards,

eric festinger

Former Member
0 Kudos

Hello,

i tried it with the following value (as suggested):

<parameters><parameter><id>0</id><answer><values><value id="1">2015-01-20T01:00:00.000+01:00</value></values></answer></parameter><parameter><id>1</id><answer><values><value id="1">M Bags Steti</value></values></answer></parameter></parameters>

I get the same exception (I'm using C# as programming language)

System.Net.WebException: The remote server returned an error: (400) Bad Request.

   at System.Net.HttpWebRequest.GetResponse()

...

I try to get any server logfiles i can get - but since this a client production machine it might take a while to get the rights for that.

As additional info: The same C# code is used to update a lot of reports on a

daily basis - but it's the first time we try to update an report accessing BW and

containing a prompt thats an 'sapVariable' - which is also not specified

in the REST docs.

Thank you,

Rainer

eric_festinger
Contributor
0 Kudos

My suggestion was to remove the id from the given values (...<value id="1">2015-0...)...

Meanwhile you try to get the rights to activate the log files and stack trace, can you copy/paste the textual error returned (not only the HTTP value).

Something like:

<error>

    <error_code>xxx</error_code>

    <message>xxx</message>

</error>


Thanks,

eric festinger

Former Member
0 Kudos

Hello,

the response content is:

<error>

    <error_code>102</error_code>

    <message>Illegal argument (Invalid answers. System "FW3": "ERROR BRAIN (629): Specify a value for variable Company Code (Multiple Values)

  MSGV1: Company Code (Multiple Values)&#13;

".)</message>

</error>

That seems to indicate that it is the other parameter that is not working. I will investigate that - and come back if I have any issues.

Thank for the help - the tip that even with an HTTP 400 error there is a content associated was very helpfull.

Best regards,

Rainer

eric_festinger
Contributor
0 Kudos

Thanks Rainer!

Some more questions on my side 🙂

  1. Your previous answer was made with or without the id n the <value...> elements?
  2. What is the exact version of your server?
  3. Can you try with "?refresh=false" at the end of the PUT call URL, and copy/paste the output?

eric

eric_festinger
Contributor
0 Kudos

And a 4th question: does the document refresh well through WebI UI?

Former Member
0 Kudos

Hello,

thanks for your effort - the tip with the error message in the response content was great.

It turned out that the problem was the other parameter (not the date parameter as i initially

thought). We submitted an invalid value there.

Now everything runs fine!

Thank you all for contributing to the solution.

Rainer

Answers (2)

Answers (2)

eric_festinger
Contributor
0 Kudos

Yes... the "Company Code" 😉


Great you find it!

eric

former_member197386
Active Contributor
0 Kudos

Great to see this problem has been troubleshooted as fast

Thanks to Saritha and Eric !

Anthony

Former Member
0 Kudos

Hello Rainer,

Could you please share a few more details - error message, trace, etc which will be of help???

Thanks,

Saritha