cancel
Showing results for 
Search instead for 
Did you mean: 

FreeHand SQL query with input parameters

jlopezm
Participant
402

Good morning SAP Analytics Cloud and Datasphere experts.

I recently created a successful OData connection from a view with Datasphere parameters to use the data in an SAP Analytics Cloud Planning model.

The problem I have is that I want to select the parameters from a FreeHand query when creating the model and I get different errors.

I am testing several syntaxes:

CV_MOV_CCEE_RD_WP(P_MANDT='100',P_DATE_FROM=1980-01-01,P_DATE_TO=1980-01-01)/Set

And I get this error:

jlopezm_0-1725617951529.png

If I use this syntax

CV_MOV_CCEE_RD_WP/CV_MOV_CCEE_RD_WP(P_MANDT='100',P_DATE_FROM=1980-01-01,P_DATE_TO=1980-01-01)/Set

I get an error like this:

jlopezm_1-1725618011379.png

When I use this syntax:

CV_MOV_CCEE_RD_WP(P_MANDT='100',P_DATE_FROM=1980-01-01,P_DATE_TO=1980-01-01)

I get this error:

jlopezm_2-1725618095902.png

So I understand that the syntax here is incorrect.

I have tried ending the statement with /Results but it doesn't work either.

I have consulted other questions and documentation such as these:

But I have not been able to find a solution

What would I have to do to be able to do the freehand query for views with input parameters coming from Datasphere over OData connections?

Thank you very much!

View Entire Topic
XaviPolo
Active Contributor

If the object is a VIEW then try with:

SELECT * FROM CV_MOV_CCEE_RD_WP( 
	PLACEHOLDER.P_MANDT=>'100', 
	PLACEHOLDER.P_DATE_FROM=>'1980-01-01', 
	PLACEHOLDER.P_DATE_TO=>'1980-01-01' 
)

Regards,

 

TuncayKaraca
Active Contributor
@XaviPolo I just noticed another good point in your example: the parameter values should be in single quotes.