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/

转载于:https://www.cnblogs.com/xiaomaohai/archive/2007/06/15/6157304.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值