Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should put your class A and B definitions and implementations inside separate includes, and include those along with the interface inside the report containing your main class. Like this: </p> <pre><code>report zzz_impl. include zzz_incl_interface. include zzz_incl_a. include zzz_incl_b. class lcl_main definition final create private. public section. class-methods: main. endclass. class lcl_main implementation. method main. data l_rif_test type ref to lif_test. create object l_rif_test type lcl_test_b. create object l_rif_test type lcl_test_a. endmethod. endclass. end-of-selection. lcl_main=&gt;main( ). </code></pre> <p>The reason for the shortdump, is because you're trying to use a variable of the type \PROGRAM=ZZZ_IMPL_<strong>B</strong>\INTERFACE=LIF_TEST to refer to an object which implements \PROGRAM=ZZZ_IMPL_<strong>A</strong>\INTERFACE=LIF_TEST.</p> <hr> <p>Edit: I'm not entirely sure what you mean with your comment, but maybe generating the entire report is possible for your use case? For example: </p> <pre><code>report zzz_impl_gen. data source_interface type standard table of char255. append `interface lif_test.` to source_interface. append ` methods:` to source_interface. append ` test.` to source_interface. append `endinterface.` to source_interface. data source_class_a type standard table of char255. append `class lcl_test_a definition final.` to source_class_a. append ` public section.` to source_class_a. append ` interfaces:` to source_class_a. append ` lif_test.` to source_class_a. append `endclass.` to source_class_a. append `class lcl_test_a implementation.` to source_class_a. append ` method lif_test~test.` to source_class_a. append ` endmethod.` to source_class_a. append `endclass.` to source_class_a. data source_class_b type standard table of char255. append `class lcl_test_b definition final.` to source_class_b. append ` public section.` to source_class_b. append ` interfaces:` to source_class_b. append ` lif_test.` to source_class_b. append `endclass.` to source_class_b. append `class lcl_test_b implementation.` to source_class_b. append ` method lif_test~test.` to source_class_b. append ` endmethod.` to source_class_b. append `endclass.` to source_class_b. data source_main type standard table of char255. append `class lcl_main definition final create private.` to source_main. append ` public section.` to source_main. append ` class-methods:` to source_main. append ` main.` to source_main. append `endclass.` to source_main. append `class lcl_main implementation.` to source_main. append ` method main.` to source_main. append ` data l_rif_test type ref to lif_test.` to source_main. append ` create object l_rif_test type lcl_test_b.` to source_main. append ` create object l_rif_test type lcl_test_a.` to source_main. append ` write: / 'Hello, World!'.` to source_main. " Just to test if it works append ` endmethod.` to source_main. append `endclass.` to source_main. data source_form type standard table of char255. append `form main.` to source_form. append ` lcl_main=&gt;main( ).` to source_form. append `endform.` to source_form. data source_all type standard table of char255. append `program subpool.` to source_all. append lines of source_interface to source_all. append lines of source_class_a to source_all. append lines of source_class_b to source_all. append lines of source_main to source_all. append lines of source_form to source_all. data generated_program type string. data message type string. data sid type string. generate subroutine pool source_all name generated_program message message shortdump-id sid. perform ('MAIN') in program (generated_program) if found. " Important, subroutine name must be in upper case! </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload