Anzeige einer Klasse und/oder Methode (Globale Klassen)

Die Frage ist als "gelöst" markiert. Den entsprechend Beitrag findest du hier.

Alles rund um die Sprache ABAP®: Funktionsbausteine, Listen, ALV
4 Beiträge • Seite 1 von 1
4 Beiträge Seite 1 von 1

Anzeige einer Klasse und/oder Methode (Globale Klassen)

Beitrag von hfahrian (ForumUser / 53 / 7 / 0 ) »
Hallo zusammen,
ich suche nach einer Möglichkeit per FUBA oder Klasse eine existierende globale Klasse (angelegt über SE24) anzuzeigen.
Desweiteren sollte eine Möglichkeit (per FUBA oder Klasse) eine Klasse und Methode vorzugeben. Mit diesen Vorgaben sollte das Methodencoding angezeigt werden.
Habe mehrere Möglichkeiten versucht, war allerdings bisher erfolglos.
Vielleicht kennt jemand eine FUBA der dies auslöst.
Vielen Dank für alle Ideen!
Henry
Henry Fahrian
Director Innovate ITC - SAP Consulting/Development
Mauritius

gesponsert
Stellenangebote auf ABAPforum.com schalten
kostenfrei für Ausbildungsberufe und Werksstudenten


Re: Anzeige einer Klasse und/oder Methode (Globale Klassen)

Beitrag von gtoXX (Specialist / 213 / 44 / 36 ) »
Hallo Henry,

ein Absprung in die SE24 genügt nicht ?

Gruß,

GTO
"Code lügt nicht ^^"

Re: Anzeige einer Klasse und/oder Methode (Globale Klassen)

Beitrag von hfahrian (ForumUser / 53 / 7 / 0 ) »
Ich konnte nun eine sehr effiziente Lösung umsetzen:
Es werden passende Request für den WB-Manager anhand von Vorgaben aufgebaut und abschliessen der WB-Manager über die Klasse cl_wb_startup versorgt.
Funktioniert perfekt.

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.
Henry Fahrian
Director Innovate ITC - SAP Consulting/Development
Mauritius

Re: Anzeige einer Klasse und/oder Methode (Globale Klassen)

Beitrag von ewx (Top Expert / 4846 / 311 / 642 ) »
Danke für's Teilen!
Allerdings ist der Code nur teilweise sinnvoll, wenn man nicht weiß, was deine ganzen Z_FB_TUIT-Bausteine im Detail machen...
Einige Machen nur Berechtigungsprüfungen, aber was machen diese:
- Z_FB_TUIT_CLASS_EXIST_SPECIAL
- Z_FB_TUIT_CLASS_GET_ALL_INCL
- Z_FB_TUIT_CLASS_OVERLAY_REDUCE

??

Seite 1 von 1

Vergleichbare Themen

20
Antw.
2677
Views
Globale Klassen oder Lokale Klassen
von ZF_SAPler » 29.11.2022 13:47 • Verfasst in ABAP® für Anfänger
1
Antw.
2470
Views
Lokale Klasse autom. in globale Klasse ändern
von JohnLocklay » 09.01.2019 09:10 • Verfasst in ABAP Objects®
33
Antw.
12107
Views
Globale Klassen mit Zugriff auf Screen
von Danny Winn » 27.01.2017 18:15 • Verfasst in ABAP Objects®
1
Antw.
1579
Views
Globale Klasse
von Malaqi » 06.02.2009 20:50 • Verfasst in ABAP® für Anfänger
1
Antw.
1733
Views
Aufruf Event-Methode aus verschiedenen Klassen
von brueno66 » 11.02.2007 11:53 • Verfasst in ABAP Objects®

Über diesen Beitrag


Die Frage ist als "gelöst" markiert. Den entsprechend Beitrag findest du hier.

Unterstütze die Community und teile den Beitrag für mehr Leser und Austausch

Newsletter Anmeldung

Keine Beiträge verpassen! Wöchentlich versenden wir lesenwerte Beiträge aus unserer Community.
Die letzte Ausgabe findest du hier.
Details zum Versandverfahren und zu Ihren Widerrufsmöglichkeiten findest du in unserer Datenschutzerklärung.

Unbeantwortete Forenbeiträge

aRFC im OO-Kontext
vor 4 Wochen von ralf.wenzel 1 / 2405
Hilfe bei SWEC/SWE2
September 2024 von retsch 1 / 8995