Skip to Content

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

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
Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    Posted on Oct 10, 2019 at 01:42 AM

    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_ServiceOrders?$select=ID,SourceLedger,CompanyCode,FiscalYear,AccountingDocument,LedgerGLLineItem,Ledger,TransactionCurrency,AmountInTransactionCurrency,GLAccount,CostCenter,DocumentDate,PostingDate,CreationDateTime,ServiceDocument,AccountingDocumentType,ProfitCenter,ReferenceDocument,ServiceDocumentType,ServiceDocumentItem,YY1_ProductLine2_COB&$filter=GLAccount 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2019 at 10:40 AM

    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


    60074-Doc1.docx (163.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2019 at 12:07 PM

    Hi Takahiro Yamauchi ,

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2019 at 02:03 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 10, 2019 at 12:43 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.