<?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: Catching STOP error in function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706082#M2018712</link>
    <description>&lt;P&gt;It doesn't work because the default parameter value EXECUTE_DIRECT = ' ', RS_VARIANT_CONTENTS leads to a SUBMIT rs_variant_values, whose program will send the abort message A093(DB) with 'Literals across more than one line are n' (or text depends on ABAP version), and MESSAGE cannot be caught by the error_message exception if they run in different internal sessions.&lt;/P&gt;&lt;P&gt;It will work if you call RS_VARIANT_CONTENTS with parameter EXECUTE_DIRECT = 'X', there's no SUBMIT.&lt;/P&gt;</description>
    <pubDate>Sun, 21 May 2023 12:01:49 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2023-05-21T12:01:49Z</dc:date>
    <item>
      <title>Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706078#M2018708</link>
      <description>&lt;P&gt;I wrote up a program to perform mass updates on variants. I am using FM RS_VARIANT_CONTENTS to pass in report and variant from table VARID. &lt;/P&gt;
  &lt;P&gt;CALL FUNCTION 'RS_VARIANT_CONTENTS'&lt;BR /&gt; EXPORTING&lt;BR /&gt; report = gs_varid-report&lt;BR /&gt; variant = gs_varid-variant&lt;BR /&gt; move_or_write = 'M' &lt;BR /&gt; TABLES &lt;BR /&gt; valutab = gt_valtab&lt;BR /&gt; EXCEPTIONS&lt;BR /&gt; variant_non_existent = 1&lt;BR /&gt; variant_obsolete = 2&lt;BR /&gt; OTHERS = 3.&lt;/P&gt;
  &lt;P&gt;My main issue at the moment is that I am getting the below error when executing for all reports and variants in our DEV system. Did some debugging and found that one of (maybe many other programs) that passed through the FM is active but it contains a syntax-error: "Literals that take up more than one line are not permitted". I guess this trickles down into the RS_VARIANT_CONTENTS FM and I run into a hard stop and my program terminates. &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2168034-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Is there a way to catch this using TRY/CATCH or this is a non-catchable exception? Will I need to address the issue of the program being active with syntax issues to resolve it? &lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 16:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706078#M2018708</guid>
      <dc:creator>jmrtinz15</dc:creator>
      <dc:date>2023-05-19T16:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706079#M2018709</link>
      <description>&lt;P&gt;You could try to insure program is in a correct status before call of RS_VARIANT_CONTENTS FM&lt;/P&gt;&lt;P&gt;Some options&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Call the EDITOR_SYNTAX_CHECK FM or  even EXTENDED_PROGRAM_CHECK FM&lt;/LI&gt;&lt;LI&gt;Use statements READ REPORT followed by SYNTAX-CHECK&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(If that's not enough try REPS_OBJECT_ACTIVATE Fm or READ FREPORT FOLLOWED by INSERT REPORT)&lt;/P&gt;</description>
      <pubDate>Sat, 20 May 2023 19:35:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706079#M2018709</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2023-05-20T19:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706080#M2018710</link>
      <description>&lt;P&gt;Put the relevant code into an RFC enabled function module and call it STARTING NEW TASK...  When you get the error, the FM will fail with SYSTEM_FAILURE, which you can catch.&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 05:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706080#M2018710</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2023-05-21T05:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706081#M2018711</link>
      <description>&lt;P&gt;Call the function module with EXCEPTION error_message. That will catch messages within the function module and return these as an exception.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'RS_VARIANT_CONTENTS'
  EXPORTING
    report               = gs_varid-report
    variant              = gs_varid-variant
    move_or_write        = 'M'
  TABLES
    valutab              = gt_valtab
  EXCEPTIONS
    variant_non_existent = 1
    variant_obsolete     = 2
    error_message        = 3
    OTHERS               = 4.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 May 2023 08:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706081#M2018711</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2023-05-21T08:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706082#M2018712</link>
      <description>&lt;P&gt;It doesn't work because the default parameter value EXECUTE_DIRECT = ' ', RS_VARIANT_CONTENTS leads to a SUBMIT rs_variant_values, whose program will send the abort message A093(DB) with 'Literals across more than one line are n' (or text depends on ABAP version), and MESSAGE cannot be caught by the error_message exception if they run in different internal sessions.&lt;/P&gt;&lt;P&gt;It will work if you call RS_VARIANT_CONTENTS with parameter EXECUTE_DIRECT = 'X', there's no SUBMIT.&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 12:01:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706082#M2018712</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-05-21T12:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Catching STOP error in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706083#M2018713</link>
      <description>&lt;P&gt;RS_VARIANT_CONTENTS_RFC can be used.&lt;/P&gt;&lt;P&gt;Note that if the calling program runs in dialog, there will be one popup each time a syntax error happens.&lt;/P&gt;&lt;P&gt;Another solution is to call RS_VARIANT_CONTENTS with parameter EXECUTE_DIRECT = 'X' and handling of special exception ERROR_MESSAGE (as &lt;SPAN class="mention-scrubbed"&gt;jack.graus2&lt;/SPAN&gt; mentioned, although parameter EXECUTE_DIRECT = 'X' is missing).&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 12:04:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-stop-error-in-function-module/m-p/12706083#M2018713</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-05-21T12:04:37Z</dc:date>
    </item>
  </channel>
</rss>

