<?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 Catch DBSQL_TABLE_UNKNOWN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295901#M1989828</link>
    <description>&lt;P&gt;We have a secondary database connected, using tc DBCO. Read access is set up and works fine.&lt;/P&gt;
  &lt;P&gt;We use some dynamic SELECT on different table names, where P_DBCON is the secondary database.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;*- Secondary database&lt;/P&gt;
  &lt;P&gt;TRY.&lt;BR /&gt;SELECT COUNT( * ) FROM (lv_tabname)&lt;BR /&gt;CONNECTION (p_dbcon).&lt;BR /&gt;CATCH cx_sy_dynamic_osql_semantics.&lt;BR /&gt;MESSAGE ….&lt;BR /&gt;ENDTRY.&lt;/P&gt;
  &lt;P&gt;Problems occur, if an invalid table-name is specified in LV_TABNAME. The system does note raise a catchable exception CX_SY_DYNAMIC_OSQL_SEMANTICS. Instead it creates a runtime error DBSQL_TABLE_UNKNOWN.&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;Is there a way to determine, whether table LV_TABNAME exists in the secondary db? Note that there is no metadata (e.g. a table DD02L) to access to find out.&lt;/LI&gt;
   &lt;LI&gt;Or is there any way to catch this scenario, so it won’t result in a dump?&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;Thank you in advance, Ulrich&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 09:55:22 GMT</pubDate>
    <dc:creator>former_member309012</dc:creator>
    <dc:date>2020-07-13T09:55:22Z</dc:date>
    <item>
      <title>Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295901#M1989828</link>
      <description>&lt;P&gt;We have a secondary database connected, using tc DBCO. Read access is set up and works fine.&lt;/P&gt;
  &lt;P&gt;We use some dynamic SELECT on different table names, where P_DBCON is the secondary database.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;*- Secondary database&lt;/P&gt;
  &lt;P&gt;TRY.&lt;BR /&gt;SELECT COUNT( * ) FROM (lv_tabname)&lt;BR /&gt;CONNECTION (p_dbcon).&lt;BR /&gt;CATCH cx_sy_dynamic_osql_semantics.&lt;BR /&gt;MESSAGE ….&lt;BR /&gt;ENDTRY.&lt;/P&gt;
  &lt;P&gt;Problems occur, if an invalid table-name is specified in LV_TABNAME. The system does note raise a catchable exception CX_SY_DYNAMIC_OSQL_SEMANTICS. Instead it creates a runtime error DBSQL_TABLE_UNKNOWN.&lt;/P&gt;
  &lt;UL&gt; 
   &lt;LI&gt;Is there a way to determine, whether table LV_TABNAME exists in the secondary db? Note that there is no metadata (e.g. a table DD02L) to access to find out.&lt;/LI&gt;
   &lt;LI&gt;Or is there any way to catch this scenario, so it won’t result in a dump?&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;Thank you in advance, Ulrich&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 09:55:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295901#M1989828</guid>
      <dc:creator>former_member309012</dc:creator>
      <dc:date>2020-07-13T09:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295902#M1989829</link>
      <description>&lt;P&gt;Are you sure that ABAP doesn't catch that, did you try with &lt;STRONG&gt;CATCH cx_root&lt;/STRONG&gt;? Check SAP notes or contact SAP support to make sure that it's not just a bug.&lt;/P&gt;&lt;P&gt;By the way, the ABAP documentation says:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;The database tables or views specified in the current ABAP SQL statement 
must be active in ABAP Dictionary in the current AS ABAP regardless of the
specified database connection. In a secondary database, an identically 
named and usable object with a suitable structure must exist for each 
database table or view specified in the current ABAP SQL statement. If not,
an exception is raised.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2020 11:12:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295902#M1989829</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-07-13T11:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295903#M1989830</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;yes, I tried to Catch w/ different exception classes, starting from CX_SY_DYNAMIC_OSQL_SEMANTICS (which Catchs on a primary db) and going up the class-tree to CX_ROOT. It still dumps &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The requirements named in the ABAP documentation are fulfilled: The secondary db is a subset of the primary db.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 06:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295903#M1989830</guid>
      <dc:creator>former_member309012</dc:creator>
      <dc:date>2020-07-14T06:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295904#M1989831</link>
      <description>&lt;P&gt;Please use COMMENT, the button ANSWER is reserved to propose a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 08:36:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295904#M1989831</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-07-14T08:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295905#M1989832</link>
      <description>&lt;P&gt;Hi Ulrich,&lt;/P&gt;&lt;P&gt;   Were you able to resolve?  I am encountering same issue and I too have tried with CATCH but nothing is being captured.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 19:37:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295905#M1989832</guid>
      <dc:creator>former_member747610</dc:creator>
      <dc:date>2022-06-28T19:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Catch DBSQL_TABLE_UNKNOWN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295906#M1989833</link>
      <description>&lt;P&gt;For dynamic sql, it is always a good choice to use class cl_abap_dyn_prg.&lt;/P&gt;&lt;P&gt;You can check the table name with the function &lt;/P&gt;&lt;P&gt; DDIF_NAMETAB_GET or DD_GET_NAMETAB_HEADER&lt;/P&gt;&lt;P&gt;In case your database system for your connection is HANA,&lt;/P&gt;&lt;P&gt;you can check the table name with the systemview tables:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from tables&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Thorsten&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 06:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-dbsql-table-unknown/m-p/12295906#M1989833</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-06-29T06:02:30Z</dc:date>
    </item>
  </channel>
</rss>

