<?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: Call Scalar or Table Function in AMDP method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-scalar-or-table-function-in-amdp-method/m-p/12815397#M2025892</link>
    <description>&lt;P&gt;Be careful with your ABAP formatting, it's incorrectly done.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2023 12:16:03 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-12-27T12:16:03Z</dc:date>
    <item>
      <title>Call Scalar or Table Function in AMDP method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-scalar-or-table-function-in-amdp-method/m-p/12815396#M2025891</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;
  &lt;P&gt; I am trying to call Scalar or Tabular function in AMDP Method. but when i try to use it is giving syntax error.&lt;/P&gt;
  &lt;P&gt;may i know what is the way to call in AMDP method.&lt;/P&gt;
  &lt;P&gt;Here is the sample code which i tried.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;CLASS z10102_cl_scalar_test DEFINITION&lt;/P&gt;
  &lt;P&gt; PUBLIC&lt;/P&gt;
  &lt;P&gt; FINAL&lt;/P&gt;
  &lt;P&gt; CREATE PUBLIC .&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; PUBLIC SECTION.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; INTERFACES if_amdp_marker_hdb.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; CLASS-METHODS: scalar_function_test&lt;/P&gt;
  &lt;P&gt; FOR SCALAR FUNCTION z10102_scalar_fun.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; CLASS-METHODS amdp_test&lt;/P&gt;
  &lt;P&gt; AMDP OPTIONS CLIENT INDEPENDENT&lt;/P&gt;
  &lt;P&gt; EXPORTING&lt;/P&gt;
  &lt;P&gt; VALUE(res) TYPE s_smax_b.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; PROTECTED SECTION.&lt;/P&gt;
  &lt;P&gt; PRIVATE SECTION.&lt;/P&gt;
  &lt;P&gt;ENDCLASS.&lt;/P&gt;
  &lt;P&gt;CLASS z10102_cl_scalar_test IMPLEMENTATION.&lt;/P&gt;
  &lt;P&gt; METHOD scalar_function_test BY DATABASE FUNCTION FOR HDB LANGUAGE SQLSCRIPT&lt;/P&gt;
  &lt;P&gt; OPTIONS READ-ONLY.&lt;/P&gt;
  &lt;P&gt; result = seatsmax_b + seatsocc_b + seatsmax_f + seatsocc_f ;&lt;/P&gt;
  &lt;P&gt; ENDMETHOD.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; METHOD amdp_test BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT&lt;/P&gt;
  &lt;P&gt; OPTIONS READ-ONLY.&lt;/P&gt;
  &lt;P&gt; DECLARE s char(2);&lt;/P&gt;
  &lt;P&gt; SELECT Z10102_SCALAR_FUN( res=&amp;gt;res ) as abc from dummy;&lt;/P&gt;
  &lt;P&gt; s = 'A';&lt;/P&gt;
  &lt;P&gt; ENDMETHOD.&lt;/P&gt;
  &lt;P&gt;ENDCLASS.&lt;/P&gt;
  &lt;P&gt;Getting following error&lt;/P&gt;
  &lt;P&gt;The syntax check detected a use of the database object "Z10102_SCALAR_FUN".&lt;/P&gt;
  &lt;P&gt;If a database object managed by ABAP or DDIC is to be used here, its use must be declared in the USING clause of the METHOD statement.&lt;/P&gt;
  &lt;P&gt;If instead a parameter or variable is addressed in this position, it must be prefixed with the character ":".&lt;/P&gt;
  &lt;P&gt;I tried these ways but getting different errors&lt;/P&gt;
  &lt;P&gt;another try&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; METHOD amdp_test1 BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT&lt;/P&gt;
  &lt;P&gt; OPTIONS READ-ONLY.&lt;/P&gt;
  &lt;P&gt; DECLARE s char(2);&lt;/P&gt;
  &lt;P&gt; SELECT "Z10102_SCALAR_FUN"( res=&amp;gt;res ) as abc from dummy;&lt;/P&gt;
  &lt;P&gt; s = 'A';&lt;/P&gt;
  &lt;P&gt; ENDMETHOD.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;another try&lt;/P&gt;
  &lt;P&gt; DECLARE s char(2);&lt;/P&gt;
  &lt;P&gt; SELECT "Z10102_SCALAR_FUN"( res=&amp;gt;res ) as abc from dummy;&lt;/P&gt;
  &lt;P&gt; s = 'A';&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;kiran rachamalla.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 11:16:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-scalar-or-table-function-in-amdp-method/m-p/12815396#M2025891</guid>
      <dc:creator>RachamallaKiran</dc:creator>
      <dc:date>2023-12-27T11:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Call Scalar or Table Function in AMDP method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-scalar-or-table-function-in-amdp-method/m-p/12815397#M2025892</link>
      <description>&lt;P&gt;Be careful with your ABAP formatting, it's incorrectly done.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 12:16:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-scalar-or-table-function-in-amdp-method/m-p/12815397#M2025892</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-12-27T12:16:03Z</dc:date>
    </item>
  </channel>
</rss>

