You can use the cl_gui_html_viewer
class to display XML code in the SAP GUI. This control uses Internet Explorer by default to display HTML content, and is also capable of showing XML content.
Here's some quick-and-dirty sample code to get you started. It's part of a program which has one screen 100
, containing a custom control named XMLDEMO
(height 27, width 120).
The report zxmldemo:
report zxmldemo.
include zxmldemo_status_0100o01.
start-of-selection.
set screen '100'.
And the include zxmldemo_status_0100o01:
module status_0100 output.
data xmlstringtable type standard table of char255.
append '<?xml version="1.0" encoding="ISO-8859-1"?>' to xmlstringtable.
append '<note><to>Tove</to><from>Jani</from>' to xmlstringtable.
append '<heading>Reminder</heading>' to xmlstringtable.
append '<body>Don''t forget me this weekend!</body></note>' to xmlstringtable.
data container type ref to cl_gui_custom_container.
create object container
exporting
container_name = 'XMLDEMO'.
data htmlviewer type ref to cl_gui_html_viewer.
create object htmlviewer
exporting
parent = container.
data url(1024) type c value 'test.xml'.
htmlviewer->load_data( exporting url = url type = 'text' subtype = 'xml'
changing data_table = xmlstringtable ).
htmlviewer->show_url( url ).
endmodule.
I don't think it's possible to show and move the cursor.