Code: Alles auswählen.
* ======================================================================
* FUBA: Klassen-Objekte anzeigen anhand Objektvorgaben
* ======================================================================
* Anhand der Vorgaben werden die entsprechenden Objekte im WB-Manager
* angezeigt. Dies erfolgt über Request-Aufbau für den WB-Manager.
* ======================================================================
* HINWEIS: Umsetzung erfolgte durch BREAK-POINT in der Methode
* CL_WB_MANAGER=>PROCESS_REQUEST_QUEUE und Analyse der Request-Definitionen!
* Dabei Aufruf einer Klasse aus SE24 / Interface-Aufruf / Doppelklick
* auf eine Methode ...
* ======================================================================
DATA: ld_class TYPE seoclsname,
ld_method TYPE seomtdname,
ld_name TYPE progname,
ld_cnt TYPE i,
ld_edit_mode TYPE xflag,
ld_obj_defined TYPE xflag,
ld_class_exist TYPE xflag,
ld_meth_exist TYPE xflag,
ld_is_intf TYPE xflag,
ls_poolinc TYPE zst_tuit_clas_includes_extend,
ls_methinc TYPE zst_tuit_clas_includes_extend.
DATA: lro_request TYPE REF TO cl_wb_request,
lt_wb_request_set TYPE swbm_wb_request_set,
ld_object_name TYPE seu_objkey,
ld_object_type TYPE seu_objtyp,
ld_operation TYPE seu_action,
lro_container TYPE REF TO cl_wb_data_container,
ls_error TYPE wberror.
* =>Prüfungen ...
IF id_obj_name IS INITIAL.
EXIT.
ENDIF.
* =>Verarbeitung anstossen; Objekt-Namen festlegen
ld_name = id_obj_name.
* =>Reduce falls nicht direkt Klassenname übergeben wurde
CALL FUNCTION 'Z_FB_TUIT_CLASS_OVERLAY_REDUCE'
CHANGING
cd_rep_inc = ld_name.
ld_class = ld_name.
ld_method = id_method.
ld_edit_mode = id_edit_mode.
* =>Existensprüfung + Prüfung ob Interface!
CALL FUNCTION 'Z_FB_TUIT_CLASS_EXIST_SPECIAL'
EXPORTING
id_obj_name = ld_class
id_method = ld_method
CHANGING
cd_class_exist = ld_class_exist
cd_is_intf = ld_is_intf
cd_method_exist = ld_meth_exist.
CHECK NOT ld_class_exist IS INITIAL.
* =>Klassen-Includes und Details ermitteln
CALL FUNCTION 'Z_FB_TUIT_CLASS_GET_ALL_INCL'
EXPORTING
id_obj_name = ld_class
id_method = ld_method
CHANGING
cs_cls_inc_method = ls_methinc
cs_cls_inc_pool = ls_poolinc.
* ======================================================================
* =>Objekt zur Verarbeitung festlegen anhand Vorgaben
* ======================================================================
CLEAR ld_obj_defined.
IF NOT id_class_obj IS INITIAL.
* ====================================================================
* =>Objekt: Klassen Objekt gewünscht
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_class. "OC => Klasse
ELSE.
ld_object_type = swbm_c_type_interface. "OI => Interface
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_poolinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_poolinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
CLEAR ld_obj_defined.
IF NOT id_class_def_obj IS INITIAL.
* ====================================================================
* =>Objekt: Klassen Eigenschaften gewünscht
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_cls_definition. "OCD => Klasse-Eigenschaften
ELSE.
ld_object_type = swbm_c_type_cls_definition. "OCD => Klasse-Eigenschaften
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_poolinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_poolinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
CLEAR ld_obj_defined.
IF NOT id_class_attr_obj IS INITIAL.
* ====================================================================
* =>Objekt: Klassen Attribute gewünscht
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_cls_attribute. "OA => Klasse-Attribute
ELSE.
ld_object_type = swbm_c_type_intf_attribute. "IA => Interface-Attribute
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_poolinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_poolinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
CLEAR ld_obj_defined.
IF NOT id_class_type_obj IS INITIAL.
* ====================================================================
* =>Objekt: Klassen Typen gewünscht
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_cls_type. "OT => Klasse-Typen
ELSE.
ld_object_type = swbm_c_type_intf_type. "IT => Interface-Typen
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_poolinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_poolinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
CLEAR ld_obj_defined.
IF NOT id_meth_imp_obj IS INITIAL AND NOT ld_meth_exist IS INITIAL.
* ====================================================================
* =>Objekt: Methoden-Implementierung gewünscht
* Hinweis: Macht nur Sinn bei CLAS nicht INTF
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_cls_mtd_impl. "OM => Methoden
ELSE.
ld_object_type = swbm_c_type_intf_mtd_def. "IO => Interface-Methode
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_key_component2 = ld_method
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_methinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_methinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
CLEAR ld_obj_defined.
IF NOT id_meth_para_obj IS INITIAL AND NOT ld_meth_exist IS INITIAL.
* ====================================================================
* =>Objekt: Objekt: Methoden-Parameter gewünscht
* ====================================================================
IF ld_is_intf IS INITIAL.
ld_object_type = swbm_c_type_cls_mtd_param. "OOP => Methoden-Parameter
ELSE.
ld_object_type = swbm_c_type_intf_mtd_param. "IOP => Interface Methoden-Parameter
ENDIF.
* =>Objektname aufbauen
CALL METHOD cl_wb_object_type=>get_concatenated_key_from_id
EXPORTING
p_key_component1 = ld_class
p_key_component2 = ld_method
p_external_id = ld_object_type
RECEIVING
p_key = ld_object_name
EXCEPTIONS
too_many_key_components = 1
objecttype_not_existing = 2
key_component_too_long = 3
OTHERS = 4.
IF sy-subrc <> 0.
CLEAR ld_obj_defined.
ELSE.
ld_obj_defined = gsx.
ENDIF.
* =>Edit-Mode oder Display?
IF NOT ld_edit_mode IS INITIAL.
IF NOT id_chk_permission IS INITIAL.
* =>Check Permission durchführen (COMPLEX)
CALL FUNCTION 'Z_FB_TUIT_PROG_OBJ_CHK_ACCESS'
EXPORTING
id_prog_obj = ls_methinc-name
id_object_class = 'ABAP'
id_chk_main_obj = gsp
id_edit_mode = ld_edit_mode
id_chk_system = gsx
CHANGING
cd_permission = ld_edit_mode.
ELSE.
* =>Check Permission durchführen (SIMPLE)
IF NOT ls_methinc-is_sap_incl IS INITIAL.
CLEAR ld_edit_mode.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* ======================================================================
* =>Requests für WB-Manager aufbauen
* ======================================================================
IF NOT ld_obj_defined IS INITIAL.
IF NOT ld_edit_mode IS INITIAL.
ld_operation = swbm_c_op_edit. "'EDIT'
ELSE.
ld_operation = swbm_c_op_display. "'DISPLAY'
ENDIF.
CREATE OBJECT lro_request
EXPORTING
p_object_type = ld_object_type
p_object_name = ld_object_name
p_operation = ld_operation.
APPEND lro_request TO lt_wb_request_set.
ENDIF.
* ======================================================================
* =>WB Call durchführen
* ======================================================================
* =>Realer WB Call nur falls nun Request für WB vorliegen!
DESCRIBE TABLE lt_wb_request_set LINES ld_cnt.
IF ld_cnt IS INITIAL.
EXIT.
ENDIF.
CREATE OBJECT lro_container.
CLASS cl_wb_startup DEFINITION LOAD.
CALL METHOD cl_wb_startup=>start
EXPORTING
p_wb_request_set = lt_wb_request_set
IMPORTING
p_wb_error = ls_error
CHANGING
p_wb_data_container = lro_container
EXCEPTIONS
manager_not_yet_released = 1.
IF sy-subrc = 0.
EXIT.
ENDIF.
ENDFUNCTION.