10

Two queries with same custom script, one works the other won't validate

 2 years ago
source link: https://answers.sap.com/questions/13676132/two-queries-with-same-custom-script-one-works-the.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
3 days ago

Two queries with same custom script, one works the other won't validate

33 Views

Hey guys, hope someone can help me out with this because I'm starting to tear my hair out over it.

I built a query for a report with the SAP BI Webi in a chrome bowser, and I needed to add some custom script. To do so I added the fields that I wanted to add custom filters on and set them to be prompts with descriptive names so that I would remember the custom SQL I used;

sapforums-01.png

Then I opened the View Script and toggled it to Use custom sapforums-02.png and subbed in the following over the prompt;

dbo.Data.Date >= DateAdd(month, -2, DateAdd(day, -DAY(GetDate())+1, GetDate()))
AND dbo.Data.Date <= DateAdd(day, -DAY(GetDate()), GetDate())

This works and brings back the previous two months of data no matter when in the current month that I run the report.

I needed to implement this same logic in another report so I did the same steps as before, but when I click the validate script or save buttons, the application just spins and never completes the validation or save.

I've tried making the query from scratch a few times and it will not let me either.

Anyone got any ideas what I need to do to be able to write over the generated SQL with my own, I don't think anything about my permissions would have changed.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK