<?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 Dynamic table as parameter  - checking type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175144#M1979366</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I recently came across an interesting mind-boggling issue. &lt;/P&gt;
  &lt;P&gt;Let's assume, we have a method that as one of the parameters has a table type TABLE.&lt;/P&gt;
  &lt;P&gt;During the runtime, one can check the type of the Table passed to the method in a pretty straightforward way. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA(typedescr) = cl_abap_typedescr=&amp;gt;describe_by_data( it_table ).
DATA(outtype) = typedescr-&amp;gt;absolute_name.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;As a result we have the absolute type of it_table which is fine. &lt;/P&gt;
  &lt;P&gt;However, how can we check if the input table is of type f.ex. lty_ztype.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        TYPES: BEGIN OF lty_ztype ,
                    first TYPE CHAR12
        TYPES END OF lty_ztype.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In case of the classes and objects we have keywords IS INSTANCE OF. &lt;BR /&gt;The above case can happen if we have a generic method used to process different table types in specific ways.&lt;/P&gt;
  &lt;P&gt;How can we handle such case?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 15:37:46 GMT</pubDate>
    <dc:creator>emil_lazarski</dc:creator>
    <dc:date>2020-05-20T15:37:46Z</dc:date>
    <item>
      <title>Dynamic table as parameter  - checking type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175144#M1979366</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I recently came across an interesting mind-boggling issue. &lt;/P&gt;
  &lt;P&gt;Let's assume, we have a method that as one of the parameters has a table type TABLE.&lt;/P&gt;
  &lt;P&gt;During the runtime, one can check the type of the Table passed to the method in a pretty straightforward way. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;DATA(typedescr) = cl_abap_typedescr=&amp;gt;describe_by_data( it_table ).
DATA(outtype) = typedescr-&amp;gt;absolute_name.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;As a result we have the absolute type of it_table which is fine. &lt;/P&gt;
  &lt;P&gt;However, how can we check if the input table is of type f.ex. lty_ztype.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        TYPES: BEGIN OF lty_ztype ,
                    first TYPE CHAR12
        TYPES END OF lty_ztype.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;In case of the classes and objects we have keywords IS INSTANCE OF. &lt;BR /&gt;The above case can happen if we have a generic method used to process different table types in specific ways.&lt;/P&gt;
  &lt;P&gt;How can we handle such case?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 15:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175144#M1979366</guid>
      <dc:creator>emil_lazarski</dc:creator>
      <dc:date>2020-05-20T15:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table as parameter  - checking type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175145#M1979367</link>
      <description>&lt;P&gt;Not on a system at the moment but wouldn't something like this work?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA line_of_table LIKE LINE OF it_table.
ASSIGN line_of_table TO FIELD-SYMBOL(&amp;lt;line&amp;gt;).

DATA(typedescr) = cl_abap_typedescr=&amp;gt;describe_by_data( &amp;lt;line&amp;gt; ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I do feel that there is a way directly from DATA(typedescr) = cl_abap_typedescr=&amp;gt;describe_by_data( it_table )&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 16:20:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175145#M1979367</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-05-20T16:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table as parameter  - checking type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175146#M1979368</link>
      <description>&lt;P&gt;After some debugging I found a way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA table_d type ref to cl_abap_tabledescr.
        table_d ?= CL_ABAP_TYPEDESCR=&amp;gt;describe_by_data( it_user_list ).
        DATA(line_descr) = table_d-&amp;gt;get_table_line_type( ).

&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it is in ABSOLUTE_NAME (\TYPE = ...)&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 16:21:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175146#M1979368</guid>
      <dc:creator>emil_lazarski</dc:creator>
      <dc:date>2020-05-20T16:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table as parameter  - checking type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175147#M1979369</link>
      <description>&lt;P&gt;or in method &lt;STRONG&gt;GET_RELATIVE_NAME&lt;/STRONG&gt;( ).&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 17:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-table-as-parameter-checking-type/m-p/12175147#M1979369</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-20T17:09:16Z</dc:date>
    </item>
  </channel>
</rss>

