Enhancement--User exit documentation from SAP

Prints out the SAP documentation on user exits

REPORT YVENKATESH_PRINT_SMOD_DOC
          NO STANDARD PAGE HEADING
          LINE-SIZE  80
          LINE-COUNT 65
          MESSAGE-ID ZM.


*----------------------------------------------------------------------*
* Tables/Views                                                      *
*----------------------------------------------------------------------*
   TABLES: MODSAP,                        "SAP Extensions
           DOKTL.                         "Documentation - text lines

*----------------------------------------------------------------------*
* Data Statements for Internal Tables                               *
*----------------------------------------------------------------------*

* Ampliaciones SAP
   DATA: ITAB_MOD   LIKE MODSAP OCCURS 0 WITH HEADER LINE.

* Documentacion - Lineas de texto
   DATA: ITAB_DOKTL LIKE DOKTL  OCCURS 0 WITH HEADER LINE.

*----------------------------------------------------------------------*
* Selection-screen                                                  *
*----------------------------------------------------------------------*
   SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME.
   SELECT-OPTIONS: S_NAME               FOR MODSAP-NAME.
   PARAMETERS: P_DOWNLD                 AS CHECKBOX.
   selection-screen end of block blk1.

*----------------------------------------------------------------------*
* Initialization                                                    *
*----------------------------------------------------------------------*
   INITIALIZATION.
     REFRESH: ITAB_MOD.

*----------------------------------------------------------------------*
* Start-of-selection                                                *
*----------------------------------------------------------------------*
   START-OF-SELECTION.

* Select the modifications into the internal table
     SELECT * INTO TABLE ITAB_MOD
       FROM MODSAP
      WHERE NAME IN S_NAME
        AND ( TYP = SPACE OR TYP = 'E' ).

* Sort the internal table
     SORT ITAB_MOD.

* For each of the modifications, get the documentation
     LOOP AT ITAB_MOD.
       AT NEW NAME.
         NEW-LINE.
         ULINE.
         WRITE: 'Enhancement:' COLOR 5 INVERSE,
                ITAB_MOD-NAME COLOR 5.
         WRITE AT 60 SY-PAGNO.
         ULINE.
         SKIP.
         DOKTL-OBJECT = ITAB_MOD-NAME.
         PERFORM 1000_GET_DOCUMENTATION USING DOKTL-OBJECT.
       ENDAT.                             "AT NEW name.

       CHECK ITAB_MOD-MEMBER > SPACE.
       SKIP.
       NEW-LINE.

       WRITE: 'Enhancement:' COLOR 5 INVERSE,
              ITAB_MOD-NAME COLOR 5.
       WRITE: 'Component:' COLOR 4 INVERSE,
              ITAB_MOD-MEMBER COLOR 4.
       SKIP.
       DOKTL-OBJECT = ITAB_MOD-MEMBER.
       PERFORM 1000_GET_DOCUMENTATION USING DOKTL-OBJECT.

       AT END OF NAME.
         SKIP 2.
       ENDAT.                             "AT END OF name.
     ENDLOOP.                             "LOOP AT itab_mod.

* Download the list
     IF NOT P_DOWNLD IS INITIAL.
       CALL FUNCTION 'LIST_DOWNLOAD'
            EXPORTING
                 LIST_INDEX = 0
                 METHOD     = ' '.
     ENDIF.                               "IF NOT p_downld IS INITIAL.

*&---------------------------------------------------------------------*
*&      Form  1000_GET_DOCUMENTATION
*&---------------------------------------------------------------------*
   FORM 1000_GET_DOCUMENTATION USING    P_DOKTL_OBJECT.

* Refresh the documentation table
     CLEAR ITAB_DOKTL.
     REFRESH ITAB_DOKTL.

* Select the data
     SELECT * INTO TABLE ITAB_DOKTL
       FROM DOKTL
      WHERE ID = 'MO'
        AND OBJECT = P_DOKTL_OBJECT
        AND LANGU = SY-LANGU.

     IF SY-SUBRC = 0.
       LOOP AT ITAB_DOKTL.
         NEW-LINE.
         WRITE: ITAB_DOKTL-DOKTEXT.
       ENDLOOP.                           "LOOP AT itab_doktl.
     ELSE.                                "IF sy-subrc = 0.
       NEW-LINE.
       WRITE: 'No documentation exists' COLOR 6 INVERSE.
     ENDIF.                               "IF sy-subrc = 0.
   ENDFORM.                               " 1000_GET_DOCUMENTATION
 

*URL: http://erpgenie.com/abaptips/content/view/13/40/

你可能感兴趣的:(document)