My tiny HPGL console based on SAPGUI
I still remember my first learned programming language in my primary school – the Logo programming language which is an educational programming language, designed in 1967 by Wally Feurzeig, Seymour Papert and Cynthia Solomon.
Perhaps I practiced it in Pentium 386? I could not remember it clearly.
And in SAPGUI there is a very old graph package which providing graph solution based on good-old SAPGUI ( last changed on: 22 years ago )
See its SAP help for detail.
In this package there is an interface for HPGL, which allows you to play around with HPGL (Hewlett-Packard Graphics Language, often written as HPGL, which is a printer control language created by Hewlett-Packard ) within SAPGUI.
And in my opinion, Logo and HPGL have many commonalities regarding their commands with different syntax but the same idea to draw line and shape.
Here below is the source code of my tiny HPGL console, which calls function module GRAPH_HPGL to draw graph using HPGL.
REPORT z. DATA: go_text_edit TYPE REF TO cl_gui_textedit, go_cust_container TYPE REF TO cl_gui_custom_container, ok_code TYPE sy-ucomm. DATA lt_text(256) TYPE c OCCURS 0. DATA: BEGIN OF lt_hpgl OCCURS 1, entry(128), END OF lt_hpgl. CALL SCREEN 0101. MODULE status_0101 OUTPUT. SET PF-STATUS 'JERRY_CONSOLE'. SET TITLEBAR 'JERRY_TITLEBAR'. IF go_cust_container IS INITIAL. go_cust_container = NEW #( container_name = 'CUSTOM_CONTROL' ). CREATE OBJECT go_text_edit EXPORTING parent = go_cust_container wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position wordwrap_to_linebreak_mode = cl_gui_textedit=>false. ENDIF. ENDMODULE. MODULE user_command_0101 INPUT. ok_code = sy-ucomm. CASE ok_code. WHEN 'BACK' OR 'QUIT' OR 'EXIT'. LEAVE TO SCREEN 0. WHEN 'EXECUTE'. CLEAR: lt_text, lt_hpgl. go_text_edit->get_text_as_r3table( IMPORTING table = lt_text ). LOOP AT lt_text ASSIGNING FIELD-SYMBOL(<text>). APPEND INITIAL LINE TO lt_hpgl ASSIGNING FIELD-SYMBOL(<hpgl>). <hpgl>-entry = <text>. ENDLOOP. CALL FUNCTION 'GRAPH_HPGL' TABLES data = lt_hpgl. WHEN OTHERS. ENDCASE. ENDMODULE.
The PBO and API for screen 101:
The layout of screen 101, just one container named “CUSTOM_CONTROL”:
The screen status:
Once you have created the report using information above, execute it, click icon “Load local file” in text edit control, and load “Doraemon.txt” ( you can download it here )
Once loaded, execute the report, the execution file in this folder is launched to render the picture drawn by HPGL.
“C:\Program Files (x86)\SAP\FrontEnd\SAPgui\gnhpx.exe”