<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get CDS parameter names in ABAP program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473443#M2001213</link>
    <description>&lt;P&gt;Hello, &lt;/P&gt;
  &lt;P&gt;My task is to select from a CDS view that has parameters. &lt;/P&gt;
  &lt;P&gt;I have the values in a Key_tab with name/value. Is there a way to read the name of parameters of CDS so I can then pass the values? &lt;/P&gt;
  &lt;P&gt;I tried using RTTD class cl_abap_structdescr but the CDS input parameters are not included in the response. &lt;/P&gt;
  &lt;P&gt;DATA(lt_components) = CAST cl_abap_structdescr( cl_abap_typedescr=&amp;gt;describe_by_name( 'C_CashFlowItem' ) )-&amp;gt;components.&lt;/P&gt;
  &lt;P&gt;Any suggestions what I could use? &lt;/P&gt;
  &lt;P&gt;thanks in advance,&lt;/P&gt;
  &lt;P&gt;Lucian&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 10:53:58 GMT</pubDate>
    <dc:creator>former_member196892</dc:creator>
    <dc:date>2021-06-11T10:53:58Z</dc:date>
    <item>
      <title>Get CDS parameter names in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473443#M2001213</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;
  &lt;P&gt;My task is to select from a CDS view that has parameters. &lt;/P&gt;
  &lt;P&gt;I have the values in a Key_tab with name/value. Is there a way to read the name of parameters of CDS so I can then pass the values? &lt;/P&gt;
  &lt;P&gt;I tried using RTTD class cl_abap_structdescr but the CDS input parameters are not included in the response. &lt;/P&gt;
  &lt;P&gt;DATA(lt_components) = CAST cl_abap_structdescr( cl_abap_typedescr=&amp;gt;describe_by_name( 'C_CashFlowItem' ) )-&amp;gt;components.&lt;/P&gt;
  &lt;P&gt;Any suggestions what I could use? &lt;/P&gt;
  &lt;P&gt;thanks in advance,&lt;/P&gt;
  &lt;P&gt;Lucian&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 10:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473443#M2001213</guid>
      <dc:creator>former_member196892</dc:creator>
      <dc:date>2021-06-11T10:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get CDS parameter names in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473444#M2001214</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi Lucian,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;you can find the Parameters of a CDS View in table DD10B. You can also use the class cl_dd_sobject_factory. Maybe there are other possibilities, but I use this two solutions. Works for example in a ABAP 1909 system.&lt;/P&gt;&lt;P&gt;Short example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA lr_handler TYPE REF TO cl_dd_ddl_handler.
  DATA l_viewname TYPE viewname.
  DATA l_entityname TYPE ddstrucobjname.
  DATA lt_sobjnames TYPE if_dd_sobject_types=&amp;gt;ty_t_sobjnames.
  DATA lr_sobject TYPE REF TO if_dd_sobject.
  DATA lt_dd10bvtab TYPE dd10bvtab.

* get the entityname of the ddl
  lr_handler ?= cl_dd_ddl_handler_factory=&amp;gt;create( ).

  lr_handler-&amp;gt;if_dd_ddl_handler~get_ddl_content_object_names(
    EXPORTING
      ddlname        = 'ZFOE_A_MASS_CHANGE'
    IMPORTING
      entityname     = l_entityname ).

  APPEND l_entityname TO lt_sobjnames.

* get parameters tab
  lr_sobject = cl_dd_sobject_factory=&amp;gt;create( ).
  lr_sobject-&amp;gt;read(
    EXPORTING
      get_state      = 'M'
      sobjnames      = lt_sobjnames
    IMPORTING
      dd10bv_tab    = lt_dd10bvtab ).

  write: / lines( lt_dd10bvtab ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Jun 2021 09:32:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473444#M2001214</guid>
      <dc:creator>foessleitner</dc:creator>
      <dc:date>2021-06-12T09:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Get CDS parameter names in ABAP program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473445#M2001215</link>
      <description>&lt;P&gt;Thank you Johann, exactly what I was looking for! &lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 08:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-cds-parameter-names-in-abap-program/m-p/12473445#M2001215</guid>
      <dc:creator>former_member196892</dc:creator>
      <dc:date>2021-06-14T08:20:37Z</dc:date>
    </item>
  </channel>
</rss>

