<?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: Short Dump for Dynamic Select Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449033#M1249129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this way&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
       SELECT count(*) as v_cnt 
                FROM     (p_table)
                WHERE    (tab_cond)
                ORDER BY (tab_ord).
if v_cnt ne space.
  " Place your select dynamic select here
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2009 20:09:04 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2009-04-01T20:09:04Z</dc:date>
    <item>
      <title>Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449029#M1249125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a short dump for my dynamic select query at the end of the code. The error is "The types of operands "dbtab" and "itab" cannot be converted into one another."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code looks like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM get_ccnum_2  USING    p_tabname TYPE dd03l-tabname.

DATA: p_table(30)  TYPE c.

  FIELD-SYMBOLS:  &amp;lt;dyn_wa&amp;gt;,
                               &amp;lt;t&amp;gt; TYPE table.
  DATA: it_fldcat    TYPE lvc_t_fcat.

  TYPE-POOLS : abap.

  DATA: it_details   TYPE abap_compdescr_tab,
        wa_details   TYPE abap_compdescr.

  DATA: ref_descr    TYPE REF TO cl_abap_structdescr.

  DATA: new_table    TYPE REF TO data,
        new_line     TYPE REF TO data,
        wa_it_fldcat TYPE lvc_s_fcat.


 p_table = p_tabname.

  ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( p_table ).
  it_details[] = ref_descr-&amp;gt;components[].

  LOOP AT it_details INTO wa_details.
    CLEAR wa_it_fldcat.
    wa_it_fldcat-fieldname = wa_details-name .
    wa_it_fldcat-datatype  = wa_details-type_kind.
    wa_it_fldcat-intlen    = wa_details-length.
    wa_it_fldcat-decimals  = wa_details-decimals.

    APPEND wa_it_fldcat TO it_fldcat .
  ENDLOOP.


  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = it_fldcat
    IMPORTING
      ep_table        = new_table.

 ASSIGN new_table-&amp;gt;* TO &amp;lt;t&amp;gt;.

 CREATE DATA new_line LIKE LINE OF &amp;lt;t&amp;gt;.
  ASSIGN new_line-&amp;gt;* TO &amp;lt;dyn_wa&amp;gt;.

wa_cond = 'CCNUM &amp;lt;&amp;gt; '' '' '.
APPEND wa_cond TO tab_cond.

      SELECT * INTO TABLE &amp;lt;t&amp;gt;
               FROM     (p_table)
               WHERE    (tab_cond)
               ORDER BY (tab_ord).

ENDFORM.                    " GET_CCNUM_2&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:40:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449029#M1249125</guid>
      <dc:creator>former_member188001</dc:creator>
      <dc:date>2009-04-01T19:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449030#M1249126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to change the select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * INTO CORRESPONDING FIELDS OF TABLE &amp;lt;t&amp;gt;
               FROM     (p_table)
               WHERE    (tab_cond)
               ORDER BY (tab_ord).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:48:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449030#M1249126</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-04-01T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449031#M1249127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;still get the short dump.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:53:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449031#M1249127</guid>
      <dc:creator>former_member188001</dc:creator>
      <dc:date>2009-04-01T19:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449032#M1249128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this using 2 different tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) The table with some records - The query worked perfectly&lt;/P&gt;&lt;P&gt;2) The table without any records - The query gave me shortdump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables are dynamic, how can we know if the table are empty or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I inserted a vlaue in the empty table and executed the program again. I still get the shortdump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: salil vaidya on Apr 1, 2009 4:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 19:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449032#M1249128</guid>
      <dc:creator>former_member188001</dc:creator>
      <dc:date>2009-04-01T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449033#M1249129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this way&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
       SELECT count(*) as v_cnt 
                FROM     (p_table)
                WHERE    (tab_cond)
                ORDER BY (tab_ord).
if v_cnt ne space.
  " Place your select dynamic select here
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 20:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449033#M1249129</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-04-01T20:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449034#M1249130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to execute the code using table BSEGC and it gave a short dump..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the actual exception that shows in ST22 IS ..UNICODE_TYPES_NOT_CONVERTIBLE..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there is something wrong in the internal table creation..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the method cl_alv_table_create=&amp;gt;create_dynamic_table to create the dynamic table I used the following and it worked..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CREATE DATA new_table TYPE TABLE OF (p_table).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Comment begin  " Naren
*  ref_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( p_table ).
*  it_details[] = ref_descr-&amp;gt;components[].
*
*  LOOP AT it_details INTO wa_details.
*    CLEAR wa_it_fldcat.
*    wa_it_fldcat-fieldname = wa_details-name .
*    wa_it_fldcat-datatype  = wa_details-type_kind.
*    wa_it_fldcat-intlen    = wa_details-length.
*    wa_it_fldcat-decimals  = wa_details-decimals.
*
*    APPEND wa_it_fldcat TO it_fldcat .
*  ENDLOOP.
*
*
*  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
*    EXPORTING
*      it_fieldcatalog = it_fldcat
*    IMPORTING
*      ep_table        = new_table.

* Comment End.  " Naren

 CREATE DATA new_table TYPE TABLE OF (p_table).   " New code by naren&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 20:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449034#M1249130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-01T20:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449035#M1249131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect. It worked. Thanks a lot Naren.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 20:14:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449035#M1249131</guid>
      <dc:creator>former_member188001</dc:creator>
      <dc:date>2009-04-01T20:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449036#M1249132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try as Naren mentioned or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  call function 'LVC_FIELDCATALOG_MERGE'
    exporting
      i_structure_name       = p_table
      i_client_never_display = 'X'
    changing
      ct_fieldcat            = it_fldcat[].

  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = it_fldcat
    IMPORTING
      ep_table        = new_table.
 
 ASSIGN new_table-&amp;gt;* TO &amp;lt;t&amp;gt;.
 
 CREATE DATA new_line LIKE LINE OF &amp;lt;t&amp;gt;.
  ASSIGN new_line-&amp;gt;* TO &amp;lt;dyn_wa&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 20:16:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449036#M1249132</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-04-01T20:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump for Dynamic Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449037#M1249133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. This also works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2009 20:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-for-dynamic-select-query/m-p/5449037#M1249133</guid>
      <dc:creator>former_member188001</dc:creator>
      <dc:date>2009-04-01T20:25:03Z</dc:date>
    </item>
  </channel>
</rss>

