IF sy-subrc NE 0. CALL FUNCTION ‘POPUP_TO_INFORM’ EXPORTING titel = ‘Automation Queue failure'(801) txt1 = ‘Internal error:'(802) txt2 = ‘A method in the automation queue'(803) txt3 = ’caused a failure.'(804). ENDIF. ENDMODULE. ” PBO OUTPUT
MODULE status_0100 OUTPUT. SET PF-STATUS ‘100_STATUS’. SET TITLEBAR ‘100_TITLE’. ENDMODULE. ” STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT. CASE sy-ucomm. WHEN ‘BACK’. LEAVE TO SCREEN 0. ENDCASE. ENDMODULE. ” USER_COMMAND_0100 INPUT
CALL METHOD me->create_field_cat. “Field catalog of the tree CALL METHOD me->create_header. “Create tree header
CALL METHOD gr_tree->set_table_for_first_display EXPORTING is_hierarchy_header = gwa_header CHANGING it_fieldcatalog = gt_fieldcat it_outtab = gi_flights. “This table should be empty, it will be filled when adding nodes
CALL METHOD me->register_events. “register events of the tree CALL METHOD me->create_nodes. “Create hierarchy CALL METHOD gr_tree->frontend_update. ENDMETHOD.
METHOD CREATE_NODES. DATA: lwa_flights LIKE LINE OF gr_data->gi_flights. DATA: lwa_flights_tmp LIKE LINE OF gr_data->gi_flights.
DATA: lv_carrid_key TYPE lvc_nkey, lv_connid_key TYPE lvc_nkey, lv_node_text TYPE lvc_value.
*sort the data table according to the node hierarchy SORT gr_data->gi_flights BY carrid connid fldate.
LOOP AT gr_data->gi_flights INTO lwa_flights.
*folder for every air line code AT NEW carrid. lv_node_text = lwa_flights-carrid. CALL METHOD gr_tree->add_node EXPORTING i_relat_node_key = ” “no parent node i_relationship = cl_gui_column_tree=>relat_last_child i_node_text = lv_node_text is_outtab_line = lwa_flights_tmp IMPORTING e_new_node_key = lv_carrid_key. ENDAT.
*leaves of the tree which is connection no lv_node_text = lwa_flights-connid.
FIELD-SYMBOLS: <fs_fieldcat> LIKE LINE OF gt_fieldcat. *get the field catalog CALL FUNCTION ‘LVC_FIELDCATALOG_MERGE’ EXPORTING i_structure_name = ‘ZSFLIGHT_ISURU’ CHANGING ct_fieldcat = gt_fieldcat.
LOOP AT gt_fieldcat ASSIGNING <fs_fieldcat>. CASE <fs_fieldcat>-fieldname. WHEN ‘CARRID’. <fs_fieldcat>-no_out = ‘X’. “Node field should be hidden WHEN ‘CONNID’. <fs_fieldcat>-no_out = ‘X’. WHEN ‘CREATE’. <fs_fieldcat>-icon = ‘X’. “Icon field and hot spot <fs_fieldcat>-hotspot = ‘X’. ENDCASE. ENDLOOP. ENDMETHOD.
DATA: li_events TYPE cntl_simple_events, lwa_events like LINE OF li_events.
*get the standard registerd events call method gr_tree->get_registered_events importing events = li_events.
*append the hot-spot click (link click) event lwa_events-eventid = cl_gui_column_tree=>eventid_link_click. APPEND lwa_events TO li_events.
Hi, I am Isuru Fernando, Senior SAP Integration Consultant with 10 years of SAP full-cycle implementation and support project experience.From the early days, I had a passion for coding, software development, and everything tech-related. I started my carrier as an ABAP developer and soon found my love for system integration when I learned SAP XI 3.0 in 2008. Playing a variety of roles from an offshore technical consultant (ABAP, PI/PO, BW, BOBJ) at the beginning of my career to a technical lead managing a team of consultants in different countries, I have gained immense experience in SAP project implementation life cycle.Having the opportunity to work on SAP implementation projects in USA, EU, and Asia, I learned valuable ins and outs of global business processors in Sales and Distribution (SD), Material Management, Retail, Customer Relationship Management (CRM), and Finance and Controlling (FICO).Through this blog, I want to share my expertise in SAP technical areas such as SAP ABAP, PI/PO, AIF, and Basis. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world!