<?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: Syntax check Class at runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578356#M861427</link>
    <description>&lt;P&gt;Yes, but in case of classes tedious.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapsyntax-check_for_itab.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapsyntax-check_for_itab.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You must compose the includes of the class pool into the internal table. I've done it and it works. &lt;/P&gt;</description>
    <pubDate>Fri, 26 Nov 2021 06:51:13 GMT</pubDate>
    <dc:creator>retired_member</dc:creator>
    <dc:date>2021-11-26T06:51:13Z</dc:date>
    <item>
      <title>Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578349#M861420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is i have program which calls a method on a class. But if the class has a syntax error the program dumps.&lt;/P&gt;&lt;P&gt;I want the program to finish its run even though the class dumps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to syntax check an ABAP Class before using it?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 06:48:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578349#M861420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T06:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578350#M861421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's a local class i don't think so, but use a global class with SE24.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578350#M861421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578351#M861422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a global class.&lt;/P&gt;&lt;P&gt;But I need some code on how to check the class at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards &lt;/P&gt;&lt;P&gt;Rasmus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 10:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578351#M861422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T10:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578352#M861423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone else ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 12:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578352#M861423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T12:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578353#M861424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the class. SO that we can check and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the method you are using .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 12:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578353#M861424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T12:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578354#M861425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok here goes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The is a dynamic method call to a class which implements the interface ZBWIF_VAR_EXIT&lt;/P&gt;&lt;P&gt;First i select all classes that implements 'ZBWIF_VAR_EXIT'&lt;/P&gt;&lt;P&gt;Then i try to run the method from the interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is to check if a the class should be used to call the next method(contains the variable i want to reach).&lt;/P&gt;&lt;P&gt;If my_var is in the class i will call another method on the class.&lt;/P&gt;&lt;P&gt;if not i just go to next class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select CLSNAME
into  l_clsname
from VSEOIMPLEM
where REFCLSNAME = 'ZBWIF_VAR_EXIT'.

  try.
      call method (l_clsname)=&amp;gt;('ZBWIF_VAR_EXIT~VAR_RESP')
        EXPORTING
          i_vnam = i_vnam
          i_step   = i_step
        IMPORTING
          e_my_var = l_my_var.
    catch cx_root into lex_root.
      clear l_my_var.
  endtry.
  if l_my_var = 'X'.
    exit.
  endif.
endselect .

*** next method called
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If for some reason a class fails the syntax check this code dumps when i try to call the method.&lt;/P&gt;&lt;P&gt;All project/solutions implements the interface in a class. So it is accros the entire system if the code dumps.&lt;/P&gt;&lt;P&gt;Even if some class fail the code should still continue because it could be that the correct variable is in another class. Thoose class that are ok should still work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i need to check if the l_clsname is syntax wise correct before i call the method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 11:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578354#M861425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T11:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578355#M861426</link>
      <description>&lt;P&gt;Call function module SEO_CLASS_CHECK_CLASSPOOL&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 18:14:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578355#M861426</guid>
      <dc:creator>thomas_rinneberg</dc:creator>
      <dc:date>2021-11-25T18:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578356#M861427</link>
      <description>&lt;P&gt;Yes, but in case of classes tedious.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapsyntax-check_for_itab.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapsyntax-check_for_itab.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You must compose the includes of the class pool into the internal table. I've done it and it works. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 06:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578356#M861427</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2021-11-26T06:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578357#M861428</link>
      <description>&lt;P&gt;How ? why ? managing an error in a method of a class ?  it is not a nonsens!  you cannot import a TR containing error in the code. Why do you want to manage it  ?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 07:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578357#M861428</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-11-26T07:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578358#M861429</link>
      <description>&lt;P&gt;@Frederic Girod to solve the requesters initial problem: Check the syntax of a class programmatically before attempting to call it dynamically.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 07:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578358#M861429</guid>
      <dc:creator>thomas_rinneberg</dc:creator>
      <dc:date>2021-11-26T07:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578359#M861430</link>
      <description>&lt;P&gt;I agree with Frederic, I wouldn't answer a non-sense question &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but maybe you can write a new question so that it makes more sense to do a syntax check (e.g. in my case I created a program which extracts data from all SM30 tables/views and sometimes there are some invalid programs which make the program fails), and answer it.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 10:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578359#M861430</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-11-26T10:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check Class at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578360#M861431</link>
      <description>&lt;P&gt;I am sorry, please explain why the original question would make no sense? In fact, I had the very same issue - I am providing a service that calls a certain interface method on all implementations of a particular interface in order to find the correct implementation for a particular question. In fact, that is even a common programming pattern. &lt;/P&gt;&lt;P&gt;Now if I call that interface-method for a class, which has syntax errors, there is no way to catch them, the whole program is torn down. Hence the only way to provide a result and not a short dump is to pre-check each implementing class for syntax errors, and if there are any, not to call the method for that class. The mentioned function module does exactly this, it checks the syntax of a given class.&lt;/P&gt;&lt;P&gt;However, there is a flaw, it is not very quick. So if your answer is time critical (i.e. subsecond), that is not the way to go, but instead you rather live with the dump and notify the person who provided the faulty implementation of your interface to fix it. Because naturally, such issues occur in development systems only which is probably important to note.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 11:07:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-check-class-at-runtime/m-p/3578360#M861431</guid>
      <dc:creator>thomas_rinneberg</dc:creator>
      <dc:date>2021-11-26T11:07:24Z</dc:date>
    </item>
  </channel>
</rss>

