Ansicht
Dokumentation

ABENDYNPRO_CFW_ABEXA - DYNPRO CFW ABEXA

ABENDYNPRO_CFW_ABEXA - DYNPRO CFW ABEXA

RFUMSV00 - Advance Return for Tax on Sales/Purchases   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

- CFW

The example illustrates the use of different GUI controls in a dynpro.

Source Code

Execute

Description

The screen of dynpro 100 contains a custom control named CUSTOM_CONTROL that covers the entire screen area. In the flow logic, both dialog modules status_0100 and cancel are called. The addition AT EXIT-COMMAND is used at PAI.

In the GUI status SCREEN_100, the usual symbols of the standard tool bar are filled with function codes of the type E. The PAI module is only used to exit the program. The most important action at PBO is calling the static method create_screen of the local class screen_handler, in which an object of this class is created.

The instance constructor of the class screen_handler creates container controls for a picture control and a tree control and afterwards both application controls themselves.

  • First, a docking control is created with the local reference variable l_docking. By passing the constant dock_at_left of the class CL_GUI_DOCKING_CONTAINER to the parameter side, a new area is created on the left side of the screen layout with a width of 135 pixels.
  • This screen area is split into two horizontal areas. This is done using the local reference variable l_splitter, which creates an object of the class CL_GUI_SPLITTER_CONTAINER and passes the reference to the docking control to the parameter parent.
  • Using the functional method get_container, the references to both areas of the splitter control are determined in the local reference variables l_container_top and l_container_bottom. Afterwards, the application controls picture and tree are created, at which the parameter parent of each constructor receives one of the references to the areas of the splitter control.

By calling the method set_registered_events, the double-click event for the nodes of the tree is activated as a system event. The method handle_node_double_click is registered as the event handler.

When the instance constructor is exited, all reference variables are deleted. However, the control objects created in the constructor with local reference variables are not collected by the Garbage Collector, since they are persisted by references from the CFW.

The method fill_picture imports an image file in GIF format from the MIME Repository into a byte string l_pict_wa, which is then filled into an internal table l_pict_tab. The function module DP_CREATE_URL creates an URL address for this table in the local variable l_url, which is passed to the method load_picture_from_url of the picture control.

The method fill_tree creates the tree structure of the tree control in the internal table l_node_table of the line structure ABDEMONODE. Every line of the table describes a node of the tree structure and must have a unique node key node_key. The components relatkey and relatship describe the relationships between the nodes.

The node table is generated from the content of the database table SPFLI. In the subnodes, the standard icons for non-expanded and expanded nodes are replaced with aircraft icons.

The event handler method handle_node_double_click imports the parameter node_key of the event node_double_click of the class CL_GUI_SIMPLE_TREE, which contains the key of the selected node. Depending on the content, the methods fill_html or fill_list are called.

When the method fill_html is called for the first time, it creates an object of the class CL_GUI_HTML_VIEWER and links the associated HTML control with the area of the container control to which the reference in container_html points, namely with the custom control on the dynpro. In accordance with the selected node, the web address of an airline is read and passed to the method show_url of the HTML control, which displays the Homepage of the airline.

The method fill_list creates a dialog box container and an ALV grid control that is displayed in the dialog box. The event handler close_box is registered for the dialog box container. Activation using the method set_registered_events is not necessary here, as the event is activated by the class itself as system event when the object is created. A list is created for the selected node. By assigning values to some components of the structure l_list_layout of the type lvc_s_layo, it is determined that the list title is displayed in a small format, and that the column width of the list is optimized, and that the list should not have an application toolbar. By calling the method set_table_for_first_display of the ALV grid control, the list is displayed in the dialog box.

The event handler method close_box closes the dialog box. To do this, the methods free of the controls involved are called one after another and the associated reference variables initialized. After that, if a node is selected to create a list, both controls are created again in the method fill_list. All other controls of the program cannot be deleted by the user and are available until the program ends.

Note

The class CL_SALV_TABLE and other classes with the prefix CL_SALV_ offer more convenient ways of displaying ALV controls.






ROGBILLS - Synchronize billing plans   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 6058 Date: 20240419 Time: 035314     sap01-206 ( 132 ms )