SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Display Active Customer Function Exits & (SMOD/CMOD)



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Enhancement and Modification | Расширения и модификация
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sun Nov 04, 2007 7:07 pm    Post subject: Display Active Customer Function Exits & (SMOD/CMOD) Reply with quote

ZMS_ACTIVE_EXITS - This report shows displays the active exits in a ABAP system along with the corresponding SAP Enhancement (SMOD) and Customer Project (CMOD)

Code:

*&---------------------------------------------------------------------*
*& Report ZMS_ACTIVE_EXITS
*&---------------------------------------------------------------------*
*& This report displays all the active customer enhancements in the
*& system and also displays whether they are active or implemented
*&---------------------------------------------------------------------*
REPORT zms_active_exits.
* Data decleration
TYPES: BEGIN OF s_function,
fname LIKE mod0-funcname,
ftext LIKE tftit-stext,
impl,
active,
example,
END OF s_function.
TYPES : BEGIN OF display_str,
project TYPE modact-name,
enhancement TYPE modact-member,
fm TYPE modsap-member,
status TYPE char20,
END OF display_str.
DATA : lt_member TYPE TABLE OF modact-member,
ls_member LIKE LINE OF lt_member,
lt_fm TYPE TABLE OF modsap-member,
ls_fm LIKE LINE OF lt_fm,
lt_modname TYPE TABLE OF modact-name,
ls_modname LIKE LINE OF lt_modname,
lt_display TYPE TABLE OF display_str,
ls_display LIKE LINE OF lt_display,
ls_function TYPE s_function,
field1(30).

START-OF-SELECTION.
* Select active customer enhancement.
  SELECT name FROM modattr INTO ls_modname
  WHERE status = 'A'.
    APPEND ls_modname TO lt_modname.
    CLEAR ls_modname.
  ENDSELECT.
  IF lt_modname IS INITIAL.
    WRITE / 'no active enhancements'.
  ENDIF.
* Determine the details about the customer enhancement.
  LOOP AT lt_modname INTO ls_modname.
    CLEAR : ls_display.
    SELECT member FROM modact INTO ls_member WHERE name = ls_modname.
      SELECT member FROM modsap INTO ls_fm WHERE name = ls_member AND typ =
      'E'.
        ls_display-project = ls_modname.
        ls_display-enhancement = ls_member.
        ls_display-fm = ls_fm.
        CLEAR : ls_function.
        ls_function-fname = ls_fm.
        PERFORM get_impl_status USING ls_function.
        IF ls_function-impl = 'X'.
          ls_display-status = 'Implemented'.
        ELSE.
          ls_display-status = 'Active'.
        ENDIF.
        APPEND ls_display TO lt_display.
      ENDSELECT.
    ENDSELECT.
  ENDLOOP.
* Displaying results
  FORMAT COLOR = 1.
  WRITE : 'Please double-click on the object for follow-on action'.
  NEW-LINE. ULINE.
WRITE : 'Customer Project', AT 30 'SAP Enhancement', AT 60 'Exit
Function Modul
e', AT 100 'Active/Implemented'.
  ULINE.
  FORMAT COLOR = 0.
  LOOP AT lt_display INTO ls_display.
    NEW-LINE.
    WRITE : ls_display-project, AT 30 ls_display-enhancement, AT 60
    ls_display-fm,
    AT 100 ls_display-status.
  ENDLOOP.
* For calling transaction CMOD / SMOD / SE37.
AT LINE-SELECTION.
  GET CURSOR FIELD field1.
  CASE field1.
    WHEN 'LS_DISPLAY-PROJECT'.
      SET PARAMETER ID 'MON_KUN' FIELD sy-lisel(10).
      CALL TRANSACTION 'CMOD' AND SKIP FIRST SCREEN.
    WHEN 'LS_DISPLAY-ENHANCEMENT'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+29(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    WHEN 'LS_DISPLAY-FM'.
      SET PARAMETER ID 'LIB' FIELD sy-lisel+59(30).
      CALL TRANSACTION 'SE37' AND SKIP FIRST SCREEN.
    WHEN OTHERS.
      MESSAGE 'Click on the right place.' TYPE 'I'.
  ENDCASE.
*&---------------------------------------------------------------------*
*& Form get_impl_status
*&---------------------------------------------------------------------*
* This FORM checks whether an EXIT FM is implemented or not
*----------------------------------------------------------------------*
FORM get_impl_status USING p_function TYPE s_function.
  DATA : l_mand LIKE tfdir-mand,
  l_incl_names TYPE smod_names OCCURS 1 WITH HEADER LINE.
  l_incl_names-itype = 'C'.
  APPEND l_incl_names.
  CLEAR l_mand.
  SELECT SINGLE mand FROM tfdir INTO l_mand WHERE funcname =
  p_function-fname.
  IF sy-subrc = 0 AND l_mand(1) = 'C'.
    p_function-active = 'X'.
* l_status-active = c_true.
  ELSE.
    p_function-active = ' '.
* l_status-inactive = c_true.
  ENDIF.
  CALL FUNCTION 'MOD_FUNCTION_INCLUDE'
    EXPORTING
      funcname   = p_function-fname
    TABLES
      incl_names = l_incl_names
    EXCEPTIONS
      OTHERS     = 4.
  IF sy-subrc = 0.
    LOOP AT l_incl_names.
      SELECT SINGLE name FROM trdir INTO l_incl_names-iname
      WHERE name = l_incl_names-iname.
      IF sy-subrc = 0.
        p_function-impl = 'X'.
      ELSE.
        p_function-impl = ' '.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDFORM. "get_impl_status
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Enhancement and Modification | Расширения и модификация All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.