<?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: How to test cds table function? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068185#M1969858</link>
    <description>&lt;P&gt;SAP does not support unit test for table function?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2019 11:17:08 GMT</pubDate>
    <dc:creator>friendlycoder</dc:creator>
    <dc:date>2019-11-01T11:17:08Z</dc:date>
    <item>
      <title>How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068171#M1969844</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;I've created the CDS table function and would like to write unit test for it:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;define table function Z_COMP_CODE
  with parameters
    @Environment.systemField: #CLIENT
    clnt    : abap.clnt,
    sel_opt : abap.char( 1000 )
returns
{
  Client         : abap.clnt;
  CompanyCodeOld : bukrs;
  ProfitCenter   : prctr;
  ValidFrom      : datab;
  ValidTo        : datbi;
  CompanyCodeNew : bukrs;
}
implemented by method
  ycl_cme_table_function=&amp;gt;QUERY_COMPANY_CODE; &lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Is it possible to write unit test for table functions? &lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 08:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068171#M1969844</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-10-31T08:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068172#M1969845</link>
      <description>&lt;P&gt;Hello &lt;A href="https://answers.sap.com/users/764486/bifunctor.html"&gt;Anujit Marty&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Of Course you can, One simple way is write a test program where you have the required fields in the select Option. Now dynamically you have to wrap the select Option and feed into the parameters of CDS. Inside the table function method you have to use APPLY_FILTER function to apply the select options.&lt;/P&gt;&lt;P&gt;You can refer the below Blog which will guide you on the same.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2018/03/21/select-options-in-cds-using-table-function/"&gt;CDS_TABLE_FUNCTION&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 08:48:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068172#M1969845</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2019-10-31T08:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068173#M1969846</link>
      <description>&lt;P&gt;You have to use Test Double Framework &lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/saphelp_nw751abap/7.51.0/en-US/4f/39ef2a0cfa45538681e900accb6ca8/frameset.htm"&gt;https://help.sap.com/doc/saphelp_nw751abap/7.51.0/en-US/4f/39ef2a0cfa45538681e900accb6ca8/frameset.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 08:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068173#M1969846</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-10-31T08:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068174#M1969847</link>
      <description>&lt;P&gt;In case the hyperlink goes wrong in the future, the chapter is "Writing Unit Tests Using CDS Test Double Framework"&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:08:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068174#M1969847</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-10-31T10:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068175#M1969848</link>
      <description>&lt;P&gt;There is always dead link in the forum, wonder if we could create it differently ... &lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068175#M1969848</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-10-31T10:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068176#M1969849</link>
      <description>&lt;P&gt;How to create abap test class for table function? &lt;/P&gt;&lt;P&gt;On the CDS View, you  can create a ABAP Test Class but for table function not: &lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1741704-2019-10-31-11-41-39.png"&gt;2019-10-31-11-41-39.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068176#M1969849</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-10-31T10:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068177#M1969850</link>
      <description>&lt;P&gt;I never try, it is a next chapter of my book &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  &lt;/P&gt;&lt;P&gt;Core Data Services for ABAP (SAP Press) &lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068177#M1969850</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-10-31T11:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068178#M1969851</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/764486/bifunctor.html"&gt;Anujit Marty&lt;/A&gt; The documentation of method INSERT_TEST_DATA of IF_CDS_TEST_ENVIRONMENT says: "If the dependency is of type cds view or &lt;STRONG&gt;cds table function&lt;/STRONG&gt; with input parameters, also provide the test data for the input parameters. Test_data for parameters will get matched against the actual parameter values by which the dependent CDS View or CDS table function is called during execution. If only both matches, the double will return the test_data."&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 12:33:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068178#M1969851</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-10-31T12:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068179#M1969852</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; Could you please try to create a cds table function and then create in addition ABAP Test Class. &lt;BR /&gt;I can not even create the ABAP Test Class. It is impossible, please try. &lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:58:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068179#M1969852</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-10-31T13:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068180#M1969853</link>
      <description>&lt;P&gt;You have a blog on this subject here &lt;A href="https://blogs.sap.com/2018/08/30/cds-doubles-writing-unit-tests-for-abap-cds/"&gt;https://blogs.sap.com/2018/08/30/cds-doubles-writing-unit-tests-for-abap-cds/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the interface if_cds_test_environment is unknown in my SAP Release&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 14:17:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068180#M1969853</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2019-10-31T14:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068181#M1969854</link>
      <description>&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;: this answer is wrong because I don't test the CDS Table Function, I just mock it. Thank you &lt;SPAN class="mention-scrubbed"&gt;szebenyi_balint&lt;/SPAN&gt; for notifying (see comments). Currently, I don't know how to test the CDS Table Function, sorry !&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original obsolete answer:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I could make the Unit Test of CDS Table Function work.&lt;/P&gt;&lt;P&gt;I had to wrap it in a CDS View.&lt;/P&gt;&lt;P&gt;I created a test environment for this CDS view, and inserted data for the CDS Table Function: you inject data to be returned based on the input parameters.&lt;/P&gt;&lt;P&gt;CDS Table Function:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;define table function Z_COMP_CODE
  with parameters
    @Environment.systemField: #CLIENT
    clnt    : abap.clnt,
    sel_opt : abap.char( 1000 )
returns
{
  mandt : abap.clnt;
  carrid : s_carr_id;
}
implemented by method
  ycl_cme_table_function=&amp;gt;QUERY_COMPANY_CODE;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;AMDP Class:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS ycl_cme_table_function DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .
  PUBLIC SECTION.
    INTERFACES: if_amdp_marker_hdb.
    CLASS-METHODS query_company_code FOR TABLE FUNCTION z_comp_code.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.
CLASS ycl_cme_table_function IMPLEMENTATION.
  METHOD query_company_code BY DATABASE FUNCTION FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY
  USING scarr.
    lt_scarr = apply_filter( scarr, :sel_opt );
    RETURN SELECT mandt, carrid FROM :lt_scarr;
  ENDMETHOD.
ENDCLASS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;CDS View:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;@AbapCatalog.sqlViewName: 'Z_COMP_CODEVIEW2'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'CDS view'
define view Z_COMP_CODE_VIEW
    with parameters sel_opt : abap.char(1000)
as select from Z_COMP_CODE( clnt: $session.client, sel_opt: $parameters.sel_opt) {
    mandt,
    carrid
}&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;ABAP code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS lcl_app DEFINITION.
  PUBLIC SECTION.
    TYPES: ty_s_carrid        TYPE RANGE OF scarr-carrid,
           ty_z_comp_code_tab TYPE STANDARD TABLE OF z_comp_code WITH EMPTY KEY.
    METHODS get_z_comp_code_tab
      IMPORTING
        s_carrid               TYPE ty_s_carrid
      RETURNING
        VALUE(z_comp_code_tab) TYPE ty_z_comp_code_tab.
ENDCLASS.
CLASS lcl_app IMPLEMENTATION.
  METHOD get_z_comp_code_tab.
    DATA : lt_tab  TYPE TABLE OF z_comp_code,
           l_where TYPE string.
    " Example if s_carrid = VALUE #( ( sign = 'I' option = 'CP' low = 'A*' ) )
    " and current client = '100', l_where will have value: MANDT = '100' AND ( CARRID LIKE 'A%')
    l_where = cl_shdb_seltab=&amp;gt;combine_seltabs(
          it_named_seltabs = VALUE #( ( name = 'CARRID' dref = REF #( s_carrid[] ) ) )
          iv_client_field = 'MANDT' ).
    SELECT *
        FROM z_comp_code_view( sel_opt = @l_where )
        INTO TABLE @z_comp_code_tab
        ##db_feature_mode[amdp_table_function].
  ENDMETHOD.
ENDCLASS.

CLASS ltc_main DEFINITION
      FOR TESTING
      DURATION SHORT
      RISK LEVEL HARMLESS.
  PRIVATE SECTION.
    METHODS: setup,
      test FOR TESTING.
    CLASS-DATA: environment TYPE REF TO if_cds_test_environment.
    CLASS-METHODS: class_setup,
      class_teardown.
ENDCLASS.
CLASS ltc_main IMPLEMENTATION.
  METHOD class_setup.
    environment = cl_cds_test_environment=&amp;gt;create(
        i_for_entity = 'Z_COMP_CODE_VIEW' ). " The CDS view (calling the table function)
  ENDMETHOD.
  METHOD test.
    TYPES: ty_scarr_tab TYPE STANDARD TABLE OF scarr WITH EMPTY KEY.
    environment-&amp;gt;insert_test_data( " stub the CDS Table Function Z_COMP_CODE
        i_data = VALUE lcl_app=&amp;gt;ty_z_comp_code_tab(
            ( carrid = 'AY' ) )
        i_parameter_values = VALUE #(
            ( parameter_name = 'CLNT'    parameter_value = sy-mandt )
            ( parameter_name = 'SEL_OPT' parameter_value = |MANDT = '{ sy-mandt }' AND ( CARRID LIKE 'A%')| ) ) ).
    DATA(z_comp_code_tab) = NEW lcl_app( )-&amp;gt;get_z_comp_code_tab( VALUE #( ( sign = 'I' option = 'CP' low = 'A*' ) ) ).
    cl_abap_unit_assert=&amp;gt;assert_equals(
        act = z_comp_code_tab
        exp = VALUE lcl_app=&amp;gt;ty_z_comp_code_tab( ( carrid = 'AY' ) ) ).
  ENDMETHOD.
  METHOD class_teardown.
    environment-&amp;gt;destroy( ).
  ENDMETHOD.
  METHOD setup.
    environment-&amp;gt;clear_doubles( ).
  ENDMETHOD.
ENDCLASS.

DATA : carrid TYPE scarr-carrid.
SELECT-OPTIONS : s_carrid FOR carrid.

START-OF-SELECTION.
  NEW lcl_app( )-&amp;gt;get_z_comp_code_tab( s_carrid[] ). 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Oct 2019 15:40:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068181#M1969854</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-10-31T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068182#M1969855</link>
      <description>&lt;P&gt;I've tried as follow: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD query_with_valid_data.
    data lo_environment type ref to if_cds_test_environment.
    lo_environment = cl_cds_test_environment=&amp;gt;create( i_for_entity = 'YCME_FN_COMP_CODE' ).
    break-POINT.
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the compiler complains: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Testing of table functions is not supported&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Oct 2019 15:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068182#M1969855</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-10-31T15:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068183#M1969856</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/764486/bifunctor.html"&gt;Anujit Marty&lt;/A&gt; See my reply, in a distinct answer. In fact, the CDS test double framework doesn't seem to work for table functions... (at least in my S/4HANA 7.52 SP0 system)&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 16:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068183#M1969856</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-10-31T16:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068184#M1969857</link>
      <description>&lt;P&gt;I couldn't successfully unit test the CDS table function. I recommend to ask the SAP author in this blog post: &lt;A href="https://blogs.sap.com/2016/10/19/introduction-cds-test-double-framework-write-unit-tests-abap-cds-entities/"&gt;https://blogs.sap.com/2016/10/19/introduction-cds-test-double-framework-write-unit-tests-abap-cds-entities/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 16:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068184#M1969857</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-10-31T16:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068185#M1969858</link>
      <description>&lt;P&gt;SAP does not support unit test for table function?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 11:17:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068185#M1969858</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-11-01T11:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068186#M1969859</link>
      <description>&lt;P&gt;EDIT: &lt;A href="https://answers.sap.com/users/764486/bifunctor.html"&gt;Anujit Marty&lt;/A&gt; oops sorry, I was wrong. I edited my distinct answer, with a working example.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068186#M1969859</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-11-01T12:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068187#M1969860</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/764486/bifunctor.html"&gt;Anujit Marty&lt;/A&gt; No, sorry, it works. See the last version of my answer.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:16:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068187#M1969860</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-11-01T12:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068188#M1969861</link>
      <description>&lt;P&gt;I agree with &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;. Following the metioned blog you can make your test  &lt;SPAN class="mention-scrubbed"&gt;bifunctor&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068188#M1969861</guid>
      <dc:creator>raphael_almeida</dc:creator>
      <dc:date>2019-11-01T12:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068189#M1969862</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; Awesome thanks a lot.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 08:15:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068189#M1969862</guid>
      <dc:creator>friendlycoder</dc:creator>
      <dc:date>2019-11-04T08:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to test cds table function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068190#M1969863</link>
      <description>&lt;P&gt;Sorry but this is not testing the table function. The table function is mocked out and it stands in the comment in the ABAP code as well. If you stub out the tf behind the view then you are not testing the logic in the table function!&lt;/P&gt;&lt;P&gt;Observe that the test environment holds a double for the tf. Try putting an AMDP breakpoint in the AMDP method it won't stop there while unit testing, since that is mocked out, but when you run the report it will stop at the AMDP breakpoint during that real usage.&lt;/P&gt;&lt;P&gt;So this example is not good for unit testing it lures you into the illusion that your tf works whereas what you are doing is you are telling the system that the tf will always give back AY which you then verify that it indeed gives back AY - this is definitely a false hope regarding the tf's behaviour.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 09:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-test-cds-table-function/m-p/12068190#M1969863</guid>
      <dc:creator>szebenyib</dc:creator>
      <dc:date>2021-03-24T09:17:30Z</dc:date>
    </item>
  </channel>
</rss>

