<?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: Dynamic SQL in AMDP/HANA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932005#M1796380</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax of the method body of AMDP is SQL Script. You can see this mentioned in &lt;A __default_attr="88320" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="ABAP News for Release 7.40 - ABAP and SAP HANA." href="https://community.sap.com/" modifiedtitle="true" title="ABAP News for Release 7.40 - ABAP and SAP HANA."&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jens promises more details later "&lt;SPAN style="color: #333333; font-size: 12.222222328186035px;"&gt;&lt;EM&gt;More details for AMDP will follow &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="color: #0000ff; font-size: 12.222222328186035px; font-family: inherit;"&gt;&lt;STRONG&gt;soon&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12.222222328186035px;"&gt; and can be found in a detailed document here in SCN ( &lt;/SPAN&gt;&lt;/EM&gt;&lt;A _jive_internal="true" data-containerid="2491" data-containertype="14" data-objectid="51612" data-objecttype="102" href="https://answers.sap.com/docs/DOC-51612" style="font-size: 12.222222328186035px; color: #3778c7;"&gt;&lt;EM&gt;ABAP Managed Database Procedures&lt;/EM&gt;) &lt;/A&gt;" in his blog &lt;A __default_attr="100585" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content=" New ABAP for HANA features in SAP NW 7.4 SP5." href="https://community.sap.com/" modifiedtitle="true" title=" New ABAP for HANA features in SAP NW 7.4 SP5."&gt;&lt;/A&gt;You can see a glimpse of what would be possible with respect to "read_only" in the picture there and in the video &lt;A href="http://www.youtube.com/watch?v=22PDDf2x80I"&gt; Introduction into ABAP Managed Database Procedures on SAP HANA.&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jan 2014 14:15:13 GMT</pubDate>
    <dc:creator>former_member2839</dc:creator>
    <dc:date>2014-01-28T14:15:13Z</dc:date>
    <item>
      <title>Dynamic SQL in AMDP/HANA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932004#M1796379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Is it possible to apply a dynamic where clause in AMDP like ABAP &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;ex: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;SELECT c1 c2.. from T1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;where(&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;STRONG&gt;my_dynamic_where_clause)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="apple-converted-space"&gt; &lt;/SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I dint' get proper documentation on AMDP dynamic sql's&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;STRONG&gt;Query 2:-&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I see that&amp;nbsp; there's&lt;SPAN class="apple-converted-space"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;STRONG&gt;EXEC 'sql_query'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="apple-converted-space"&gt; &lt;/SPAN&gt; in stored procedures.we cannot use EXEC in&lt;SPAN class="apple-converted-space"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;STRONG&gt;read only procedures&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;when i try to create a procedure , in the wizard it's always "read_only" procedure that is created., How to create a&amp;nbsp; read-write procedure?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Is it authorization issue ? If not what am i missing here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Saurabh&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 11:44:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932004#M1796379</guid>
      <dc:creator>former_member473759</dc:creator>
      <dc:date>2013-12-31T11:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in AMDP/HANA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932005#M1796380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax of the method body of AMDP is SQL Script. You can see this mentioned in &lt;A __default_attr="88320" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content="ABAP News for Release 7.40 - ABAP and SAP HANA." href="https://community.sap.com/" modifiedtitle="true" title="ABAP News for Release 7.40 - ABAP and SAP HANA."&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jens promises more details later "&lt;SPAN style="color: #333333; font-size: 12.222222328186035px;"&gt;&lt;EM&gt;More details for AMDP will follow &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="color: #0000ff; font-size: 12.222222328186035px; font-family: inherit;"&gt;&lt;STRONG&gt;soon&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-size: 12.222222328186035px;"&gt; and can be found in a detailed document here in SCN ( &lt;/SPAN&gt;&lt;/EM&gt;&lt;A _jive_internal="true" data-containerid="2491" data-containertype="14" data-objectid="51612" data-objecttype="102" href="https://answers.sap.com/docs/DOC-51612" style="font-size: 12.222222328186035px; color: #3778c7;"&gt;&lt;EM&gt;ABAP Managed Database Procedures&lt;/EM&gt;) &lt;/A&gt;" in his blog &lt;A __default_attr="100585" __jive_macro_name="blogpost" class="jive_macro jive_macro_blogpost" data-orig-content=" New ABAP for HANA features in SAP NW 7.4 SP5." href="https://community.sap.com/" modifiedtitle="true" title=" New ABAP for HANA features in SAP NW 7.4 SP5."&gt;&lt;/A&gt;You can see a glimpse of what would be possible with respect to "read_only" in the picture there and in the video &lt;A href="http://www.youtube.com/watch?v=22PDDf2x80I"&gt; Introduction into ABAP Managed Database Procedures on SAP HANA.&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 14:15:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932005#M1796380</guid>
      <dc:creator>former_member2839</dc:creator>
      <dc:date>2014-01-28T14:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in AMDP/HANA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932006#M1796381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A colleague pointed out to me that specifics of your question is not answered in the references I offered earlier. Let me try to rectify that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please check out APPLY_FILTER in the&lt;A href="http://help.sap.com/hana/SAP_HANA_SQL_Script_Reference_en.pdf."&gt; SAP HANA SQL Script reference&lt;/A&gt;. This might be what you are looking for. In this case you will not need to use "EXEC 'sql_string'. You can do the following instead:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;temp_result = &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;SELECT c1 c2.. from T1 &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;...;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;result = APPLY_FILTER(:temp_result, :my_dynamic_where_clause)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;Don't be afraid that &lt;SPAN style="font-family: terminal, monaco;"&gt;temp_result&lt;/SPAN&gt; will be fetched and later filtered. If you do not read &lt;SPAN style="font-family: terminal, monaco;"&gt;temp_result&lt;/SPAN&gt; only &lt;SPAN style="font-family: terminal, monaco;"&gt;result&lt;/SPAN&gt; will be fetched after applying the filter. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hope this answers your query better.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2014 06:25:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932006#M1796381</guid>
      <dc:creator>former_member2839</dc:creator>
      <dc:date>2014-02-20T06:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in AMDP/HANA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932007#M1796382</link>
      <description>&lt;P&gt;The best practice is the opposite. First the filter is created and then the query&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*...Filtro
    ex_it_vbak_filter = APPLY_FILTER (vbak,:ip_filter_vbeln_auart);

*...Select Data
    ex_it_vbak = SELECT vbeln,auart
                 FROM :ex_it_vbak_filter&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Oct 2019 19:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-sql-in-amdp-hana/m-p/9932007#M1796382</guid>
      <dc:creator>ocossio</dc:creator>
      <dc:date>2019-10-29T19:32:29Z</dc:date>
    </item>
  </channel>
</rss>

