cancel
Showing results for 
Search instead for 
Did you mean: 

How to set parameters through API created from a Custom CDS View

takahiroyamauchi
Explorer
0 Kudos

Hello,experts,

I am searching how to set parameters through API created from my Custom CDS View in S/4HANA Cloud (MTE ver.1908).

But I cannot find it.

Is there a way to set parameters through API created from my Custom CDS View ?

If there is it ,would you be so kind to tell me how to do? I understood the following contents to some extent. ・how to create custom CDS View ・how to create custom communication scenario ・how to create communication arrangement Best regard, Takahiro Yamauchi

Accepted Solutions (1)

Accepted Solutions (1)

Amith_Nair
Advisor
Advisor
0 Kudos

Hi Takahiro,

I think we have the answer already as highlighted by Jacky and Feras. Now, that you have the communication scenario linked to the communication Arrangement, you can test this using postman as an external OData service.

So this is an example I can demonstrate using the Whitelisted CDS view: G/L Line Items Cube and I named my Tax_Alt_ServiceOrder for which I have a Comm.scenario that is linked to Comm. Arrangement.

And here are my 'Selection' Parameters and Filter Criteria that gets added to my external link:

https://myxxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/YY1_TAX_ALT_SERVICEORDERS_CDS/YY1_Tax_Alt... eq'5xxxxxx0' and ServiceDocument eq '8xxxxxxxx0' and AccountingDocument eq'2xxxxxxxx9' and YY1_ProductLine2_COB eq '12'

Make sure you have the comm.user and the corresponding password entered while fetching the OData Service.

I hope this (also)gives you some direction to your efforts.

Let us know if this helps.

Thank You!

Amith Nair

takahiroyamauchi
Explorer
0 Kudos

Hi,Amith,

Thank you for the reply.

Also thank you for giving me sample.

I will try it to refer sample URL.

Thank you,

Best regard,

Takahiro Yamauchi

takahiroyamauchi
Explorer
0 Kudos

Hi,Amith,

I'm sorry that replied so late.

I try it to refer your sample URL

and can set parameters !

Thank you for your advice.

I choose your comment best answer.

Thank you,

Best regard,

Takahiro Yamauchi

Answers (4)

Answers (4)

Feras_Al-Basha
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi takahiroyamauchi ,

Thank you for reaching out to the community. You could add your own custom parameters when using the app "custom CDS views" under the section "parameters."

That said, according to the below note, "It is not possible to add a custom parameter if the External API option has been checked for the custom CDS view."

https://launchpad.support.sap.com/#/notes/0002754674

As a side note, the below note could also come in handy when dealing with pre-built parameters in a CDS view during API consumption:

https://launchpad.support.sap.com/#/notes/2600276

Hope this helps,

Thank you,

Feras

takahiroyamauchi
Explorer
0 Kudos

Hi Feras,

Thank you for the reply.

I understand it is not possible to add a custom parameter for my custom CDS View.

I will try it to refer note 2600276.

If I cannot do it,I will contact you again.

Thank you,

Best regard,

Takahiro Yamauchi

Jacky_Liu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, Yamauchi ,

We don't need to set parameter when we define a CDS view which need to openned as a odata . But when calling a cds view odata or other odata , we can use filter to input condition as the attachment .

Best regards!

Jacky

takahiroyamauchi
Explorer
0 Kudos

Hi Jacky,

Thank you for the reply.

I didn't know filter.

I will try it to refer your attachment file.

If I cannot do it,I will contact you again.

Thank you,

Best regards,

Takahiro Yamauchi

former_member132363
Active Contributor
0 Kudos

Please see the note on [Creating Custom CDS Views for Analytical Scenarios] (https://launchpad.support.sap.com/#/notes/2657021)

I hope this answered your question! If it did, please mark it as the 'Best Answer' so I can continue learning and answering questions in the community.

former_member132363
Active Contributor
0 Kudos

Please see the note on [Creating Custom CDS Views for Analytical Scenarios] (https://launchpad.support.sap.com/#/notes/2657021)

I hope this answered your question! If it did, please mark it as the 'Best Answer' so I can continue learning and answering questions in the community.