cancel
Showing results for 
Search instead for 
Did you mean: 

FreeHand SQL query with input parameters

jlopezm
Participant
555

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!

Accepted Solutions (0)

Answers (3)

Answers (3)

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.
JefB
Active Contributor

I believe SAC is not able yet to fully consume Odata parameters, hence you see this "Basic CDI Support" item on the product roadmap as 'future vision':

https://roadmaps.sap.com/board?PRODUCT=67838200100800006884&q=odata&range=CURRENT-LAST#;INNO=000D3AB... 

TuncayKaraca
Active Contributor
0 Kudos

Hi @jlopezm,

That's a good question! I'm inclined to think that parameters are not supported in SAC for SAP Datasphere OData connections. Although it seems that Freehand Query is a solution for CDS views with parameters on OData connections. Refer to 2936924 - Input Parameter on CDS Views does not work via Query Panel from SAP Analytics Cloud (SAC)

Have you tried? 

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

Please note that parameter values are case sensitive, if I'm not mistaken.

Thanks,
Tuncay