<?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: SQLScript error triying dynamic schema in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946291#M1966007</link>
    <description>&lt;P&gt;I currently don't have a system to test, but I would try the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      it_data = SELECT T001K.MANDT, T001K.BUKRS, T001K.BWKEY
                  FROM :i_schema."T001K";&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Jun 2019 13:43:29 GMT</pubDate>
    <dc:creator>UweFetzer_se38</dc:creator>
    <dc:date>2019-06-24T13:43:29Z</dc:date>
    <item>
      <title>SQLScript error triying dynamic schema</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946290#M1966006</link>
      <description>&lt;P&gt;Hello! i'm triying to make a query from a different schema from default like this:&lt;/P&gt;
  &lt;P&gt;My class&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;definition of the method:  
methods BUSCA_BUKRS
    importing
      VALUE(I_FILTRO) type string " MANDT = '110' and BWKEY = '1000'
      VALUE(I_SCHEMA) type string "SLT_S4R
    exporting
      VALUE(O_BUKRS) type ZCL_TT_BUKRS .

implementation:
method BUSCA_BUKRS BY DATABASE PROCEDURE
                        FOR HDB
                        LANGUAGE SQLSCRIPT
                        OPTIONS READ-ONLY.
*     SQL script
      it_data = SELECT T001K.MANDT, T001K.BUKRS, T001K.BWKEY
                FROM "i_schema"."T001K";
      it_query = SELECT * FROM
                  :it_data AS A;
      O_BUKRS = APPLY_FILTER(:it_query, :I_FILTRO);
  endmethod.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;as you can see i'm using i_schema to assing my schema but i get thie error:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1699475-error.png" /&gt;&lt;/P&gt;
  &lt;P&gt;So i can't activate my class, i tried to activate obligatory this and run my program but i get a dump &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1699476-dump.png" /&gt;&lt;/P&gt;
  &lt;P&gt;And if i try to write my query like this it works (hard code)&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;      it_data = SELECT T001K.MANDT, T001K.BUKRS, T001K.BWKEY
                FROM "SLT_S4R"."T001K";
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;if i debbug in my scenario where i'm facing the error: i_schema = SLT_S4R so it's the same but i don't know why i'm getting an error :c . I am specifying the schema be cause those tables are not in the default schema that's why and i noticed this when i transported to QAS the schema there it's like SLT_S4Q. Any idea or different way to do this ???&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946290#M1966006</guid>
      <dc:creator>naotoxxx</dc:creator>
      <dc:date>2019-06-20T17:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQLScript error triying dynamic schema</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946291#M1966007</link>
      <description>&lt;P&gt;I currently don't have a system to test, but I would try the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      it_data = SELECT T001K.MANDT, T001K.BUKRS, T001K.BWKEY
                  FROM :i_schema."T001K";&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:43:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946291#M1966007</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2019-06-24T13:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQLScript error triying dynamic schema</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946292#M1966008</link>
      <description>&lt;P&gt;Yes i tried like that but i get this error in this line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FROM :i_schema."T001K";&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1702504-error-schema.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 19:08:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946292#M1966008</guid>
      <dc:creator>naotoxxx</dc:creator>
      <dc:date>2019-07-05T19:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: SQLScript error triying dynamic schema</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946293#M1966009</link>
      <description>&lt;P&gt;you may check bellow blog:&lt;/P&gt;&lt;P&gt;&lt;A href="https://sapyard.com/abap-for-sap-hana-part-23-how-to-access-database-schema-dynamically-using-amdp/https://sapyard.com/abap-for-sap-hana-part-23-how-to-access-database-schema-dynamically-using-amdp/" target="_blank"&gt;how-to-access-database-schema-dynamically-using-amdp&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 03:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sqlscript-error-triying-dynamic-schema/m-p/11946293#M1966009</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-07-08T03:25:29Z</dc:date>
    </item>
  </channel>
</rss>

