<?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 Re: CDS view Field value to get from using  a Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438603#M1998511</link>
    <description>&lt;P&gt;Any idea how the same can achieved in Netweaver 7.5? I am not able to use virtual elements there. I think it was introduced later on. I need to call a function module and change the value of the field.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 10:26:36 GMT</pubDate>
    <dc:creator>former_member821871</dc:creator>
    <dc:date>2023-03-09T10:26:36Z</dc:date>
    <item>
      <title>CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438597#M1998505</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a requirement that, I need to get a field value in CDS view using a Function module.&lt;BR /&gt;What is the best approach for this other than using ODATA service?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 12:44:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438597#M1998505</guid>
      <dc:creator>former_member764771</dc:creator>
      <dc:date>2021-09-02T12:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438598#M1998506</link>
      <description>&lt;P&gt;Welcome to the SAP
Community! We wanted to give you the opportunity to take the tutorial
to get &lt;A href="https://developers.sap.com/tutorials/community-qa.html"&gt;started in SAP &lt;/A&gt;&lt;A href="https://developers.sap.com/tutorials/community-qa.html"&gt;Community&lt;/A&gt;, as it provides tips for preparing
questions that draw responses from our members.&lt;/P&gt;&lt;P&gt;Additionally,
by adding a picture to your profile you
encourage readers to respond to your question. Learn more about your profile using &lt;A href="https://developers.sap.com/tutorials/community-profile.html"&gt;Profile
Tutorial &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 12:44:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438598#M1998506</guid>
      <dc:creator>former_member751591</dc:creator>
      <dc:date>2021-09-02T12:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438599#M1998507</link>
      <description>&lt;P&gt;If I've understood you correctly, you're looking for a virtual element in you CDS view. There you're specifying an ABAP class that then provides the value. And in this class you can for example call your function module.&lt;/P&gt;&lt;P&gt;E. g.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  @ObjectModel.virtualElement: true
  @ObjectModel.virtualElementCalculatedBy: 'ZCL_CALC_CLASS'
  &lt;STRONG&gt;cast(&lt;/STRONG&gt; ''  &lt;STRONG&gt;as&lt;/STRONG&gt; &lt;EM&gt;abap&lt;/EM&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;EM&gt;&lt;U&gt;char&lt;/U&gt;&lt;/EM&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;255&lt;STRONG&gt;))&lt;/STRONG&gt;  &lt;STRONG&gt;as&lt;/STRONG&gt; function_value&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Sep 2021 13:04:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438599#M1998507</guid>
      <dc:creator>AlexFrank</dc:creator>
      <dc:date>2021-09-02T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438600#M1998508</link>
      <description>&lt;P&gt;Hi Frank,&lt;BR /&gt;Thanks for you are response.&lt;BR /&gt;I tried adding the virtual element but the particular field value is always being blank.&lt;BR /&gt;Here is my code can you please check it once.&lt;BR /&gt;define view ZCDS_EXAMPLE as select from table1 as t1&lt;BR /&gt; {
&lt;BR /&gt;  key t1.field1 as f1,
&lt;BR /&gt;t1.field2 as  f2,
&lt;BR /&gt;t1.feild3 as f3, &lt;BR /&gt;t1.field4 as f4,&lt;BR /&gt;t1.feild5 as f5 , &lt;BR /&gt;t1.field6  as f6,&lt;BR /&gt;t1.field7 as f7,&lt;BR /&gt; @ObjectModel.virtualElement: true
&lt;BR /&gt;  @ObjectModel.virtualElementCalculatedBy: 'ZCL_CLASS1'
&lt;BR /&gt;  cast( ''  as abap.char(255))  as final_date&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;And in class the the logic I want to implement is to fetch the date using 'NET_DUE_DATE_GET' function module.&lt;BR /&gt;and My ABAP class is..&lt;BR /&gt;&lt;BR /&gt;class ZCL_CLAS1 definition
&lt;BR /&gt;  public
&lt;BR /&gt;  final
&lt;BR /&gt;create public .
&lt;BR /&gt;public section.
&lt;BR /&gt;    interfaces : if_sadl_exit_calc_element_read.
&lt;BR /&gt;  protected section.
&lt;BR /&gt;  private section.
&lt;BR /&gt;ENDCLASS.
&lt;BR /&gt;&lt;BR /&gt;CLASS ZCL_CLASS1 IMPLEMENTATION.&lt;BR /&gt;
  method if_sadl_exit_calc_element_read~calculate.&lt;BR /&gt;
&lt;BR /&gt;data lt_original_data type table of ZCDS_EXAMPLE with default key.&lt;BR /&gt;
    lt_original_data = corresponding #( it_original_data ).
&lt;BR /&gt;    loop at lt_original_data assigning field-symbol(&amp;lt;ls_data&amp;gt;).
&lt;BR /&gt;      call function 'NET_DUE_DATE_GET'
&lt;BR /&gt; EXPORTING&lt;BR /&gt;
          I_ZFBDT = &amp;lt;ls_data&amp;gt;-f2&lt;BR /&gt; I_ZBD1T = &amp;lt;ls_data&amp;gt;-f3&lt;BR /&gt; I_ZBD2T = &amp;lt;ls_data&amp;gt;-f4&lt;BR /&gt; I_ZBD3T = &amp;lt;ls_data&amp;gt;-f5&lt;BR /&gt; I_SHKZG = &amp;lt;ls_data&amp;gt;-f6&lt;BR /&gt; I_REBZG = &amp;lt;ls_data&amp;gt;-f7 &lt;BR /&gt;IMPORTING
&lt;BR /&gt;          E_FAEDT = &amp;lt;ls_data&amp;gt;-final_date.&lt;BR /&gt;
IF sy-subrc = 0.
&lt;BR /&gt;        APPEND &amp;lt;ls_data&amp;gt; TO lt_original_data.
&lt;BR /&gt;      ENDIF.
    endloop.
&lt;BR /&gt;    ct_calculated_data = lt_original_data.&lt;BR /&gt;
  endmethod.
&lt;BR /&gt;&lt;BR /&gt;  method if_sadl_exit_calc_element_read~GET_CALCULATION_INFO.&lt;BR /&gt;&lt;BR /&gt;
  endmethod..&lt;BR /&gt;&lt;BR /&gt;
ENDCLASS.&lt;BR /&gt;Can you please tell me where the problem is?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 14:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438600#M1998508</guid>
      <dc:creator>former_member764771</dc:creator>
      <dc:date>2021-09-02T14:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438601#M1998509</link>
      <description>&lt;P&gt;HI frank,&lt;BR /&gt;Thanks for you are response.&lt;BR /&gt;I tried using the virtual element concept but that particular field value is always being blank.&lt;BR /&gt;Here is the same code template I followed Can you please check it once let me know where the problem is?&lt;BR /&gt;&lt;BR /&gt;@AbapCatalog.sqlViewName: 'CDS1'&lt;BR /&gt;@AbapCatalog.compiler.compareFilter: true&lt;BR /&gt;@AbapCatalog.preserveKey: true&lt;BR /&gt;@AccessControl.authorizationCheck: #CHECK&lt;BR /&gt;@Metadata.allowExtensions: true&lt;BR /&gt;@EndUserText.label: 'final cds'&lt;BR /&gt;define view ZCDS_EXAMPLE as select from table1 as t1&lt;BR /&gt; { &lt;/P&gt;&lt;P&gt;key t1.field1 as f1,&lt;/P&gt;&lt;P&gt;t1.field2 as f2,&lt;BR /&gt;t1.field3 as f3,&lt;/P&gt;&lt;P&gt;t1.field4 as f4,&lt;/P&gt;&lt;P&gt;t1.field5 as f5,&lt;/P&gt;&lt;P&gt;t1.field6 as f6,&lt;/P&gt;&lt;P&gt;t1.field7 as f7,&lt;BR /&gt;@ObjectModel.virtualElement: true&lt;/P&gt;&lt;P&gt;@ObjectModel.virtualElementCalculatedBy: 'ZCL_CLASS1'&lt;/P&gt;&lt;P&gt;cast( '' as abap.char(255)) as final_date&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;Here the final_date value need to be fetch from the function module 'NET_DUE_DATE_GET'.&lt;BR /&gt;So I used this FM in calculate method of ABAP class as follow.&lt;/P&gt;&lt;P&gt;class ZCL_CLASS1 definition&lt;BR /&gt;public&lt;BR /&gt;final&lt;BR /&gt;create public .&lt;BR /&gt;public section.&lt;BR /&gt;interfaces : if_sadl_exit_calc_element_read.&lt;BR /&gt; protected section.&lt;BR /&gt; private section.&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;CLASS ZCL_CLASS1 IMPLEMENTATION.&lt;BR /&gt; method if_sadl_exit_calc_element_read~calculate.&lt;BR /&gt; data lt_original_data type table of ZCDS_EXAMPLE with default key.&lt;BR /&gt;lt_original_data = corresponding #( it_original_data ).&lt;BR /&gt;loop at lt_original_data assigning field-symbol(&amp;lt;ls_data&amp;gt;).&lt;/P&gt;&lt;P&gt;call function 'NET_DUE_DATE_GET'&lt;BR /&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_ZFBDT = &amp;lt;ls_data&amp;gt;-f2&lt;BR /&gt;I_ZBD1T = &amp;lt;ls_data&amp;gt;-f3           &lt;BR /&gt;I_ZBD2T = &amp;lt;ls_data&amp;gt;-f4&lt;BR /&gt;I_ZBD3T = &amp;lt;ls_data&amp;gt;-f5&lt;BR /&gt;I_SHKZG = &amp;lt;ls_data&amp;gt;-f6&lt;BR /&gt; I_REBZG = &amp;lt;ls_data&amp;gt;-f7&lt;/P&gt;&lt;P&gt;IMPORTING&lt;BR /&gt; E_FAEDT = &amp;lt;ls_data&amp;gt;-final_date.&lt;BR /&gt;IF sy-subrc = 0.&lt;BR /&gt; APPEND &amp;lt;ls_data&amp;gt; TO lt_original_data.&lt;BR /&gt;ENDIF.&lt;BR /&gt; endloop.&lt;BR /&gt;ct_calculated_data = corresponding #( lt_original_data ).&lt;BR /&gt; endmethod.&lt;BR /&gt;&lt;BR /&gt;method if_sadl_exit_calc_element_read~GET_CALCULATION_INFO.&lt;BR /&gt;&lt;BR /&gt;endmethod.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;But I'm getting  blank values as output in final_date.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 14:53:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438601#M1998509</guid>
      <dc:creator>former_member764771</dc:creator>
      <dc:date>2021-09-02T14:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438602#M1998510</link>
      <description>&lt;P&gt;Virtual fields cannot be viewed via Eclipse only via SADL framework, i.e. through an ODATA service, which may be the reason you are not seeing the field.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 23:19:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438602#M1998510</guid>
      <dc:creator>stephenl1</dc:creator>
      <dc:date>2022-10-03T23:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438603#M1998511</link>
      <description>&lt;P&gt;Any idea how the same can achieved in Netweaver 7.5? I am not able to use virtual elements there. I think it was introduced later on. I need to call a function module and change the value of the field.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 10:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438603#M1998511</guid>
      <dc:creator>former_member821871</dc:creator>
      <dc:date>2023-03-09T10:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: CDS view Field value to get from using  a Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438604#M1998512</link>
      <description>&lt;P&gt;As mentioned by Alexander, virtual elements could be one solution. Additionally you could fill the element on DPC_EXT level, if you have built the service using SEGW: &lt;A href="https://help.sap.com/docs/SAP_NETWEAVER_750/cc0c305d2fab47bd808adcad3ca7ee9d/ed2ed4e2cbc54ffdba3aead4f3a73640.html?version=latest" target="test_blank"&gt;https://help.sap.com/docs/SAP_NETWEAVER_750/cc0c305d2fab47bd808adcad3ca7ee9d/ed2ed4e2cbc54ffdba3aead4f3a73640.html?version=latest&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 09:21:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-view-field-value-to-get-from-using-a-function-module/m-p/12438604#M1998512</guid>
      <dc:creator>dominikeiraelias</dc:creator>
      <dc:date>2023-03-10T09:21:03Z</dc:date>
    </item>
  </channel>
</rss>

