out->write
in the main
method of classes that implement interface if_oo_adt_classrun
in order to write the content of ABAP data objects to a text console.if_demo_output
implemented by class cl_demo_output
that also offers a method write
that does mostly the same.cl_demo_output
are two sides of the same coin. When the ABAP console was introduced some years ago, its internal implementation was copied from cl_demo_output
and cl_demo_output_stream
(the latter produces an output-friendly XML). But since ADT used an early stage of cl_demo_output
, it missed its continuous improvements that took place in the meantime. An example is the implicit retrieval of the data object's name if no name is passed explicitly.cl_demo_output
was invigorated significantly by being able to handle any ABAP data object including complex types like nested structures or tables and data as well as object references (see the blog CL_DEMO_OUTPUT invigorated). In the blog it is still stated that the new features are available in HTML mode of cl_demo_output
only. Meanwhile, even that has changed. A clever working student (a physicist) has done it and "reprogrammed a browser in cl_demo_output_text
"! With other words, the content of arbitrary ABAP data objects can be displayed in a console-type text format.cl_demo_output
instead. As a result, you don't have to care about your data types anymore. And the best is, you have to do nothing for that. The enhancement comes for free.if_demo_output
, you might also know that it contains much more methods than if_oo_adt_classrun
that is the standard type of parameter out
which allows to call methods WRITE
and GET
only. In order to stay compatible, the interface if_oo_adt_classrun
was not changed. Nevertheless, if_demo_output
can also be used for the ABAP console; Instead of implementing if_oo_adt_classrun
in your class, you can inherit from the new abstract class cl_demo_classrun
and redefine its method main
. In cl_demo_classrun
you have access to an intance attribute out
of type if_demo_output
and thus you can use all methods of cl_demo_output
. cl_demo_classrun
and if_demo_output
are released for ABAP Cloud with 2311/2023.cl_demo_classrun
(but not to if_oo_adt_classrun
). Simply press F8 and you get the HTML-output in one go:You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |