sapdev logo background
sapdev logo sapdev logo
Comments

DOCU_READ sap function module




The below ABAP code shows how function module DOCU_READ is used to retieve documentation for any SAP repository object where any exists.

Retieve documentation for any SAP repository object

REPORT  ZOBJECT_DOCU.

DATA: it_lines type STANDARD TABLE OF TLINE INITIAL SIZE 0.
DATA: ld_THEAD LIKE THEAD,
      ld_title type DSYST-DOKTITLE.
DATA: it_dokil TYPE STANDARD TABLE OF dokil INITIAL SIZE 0,
      wa_dokil like LINE OF it_dokil.

*SAP User parameter SAP repository object (FM, Prog, TCODE etc)
PARAMETERS: p_object type string default 'POPUP_TO_CONFIRM'.

* Get documentation for entered SAP object
SELECT single *
  FROM DOKIL
  into wa_dokil
 WHERE OBJECT      = p_object AND
       LANGU       = SY-LANGU.

*Return documentation for SAP object
CALL FUNCTION 'DOCU_READ'
  EXPORTING
   ID      = wa_DOKIL-ID
   LANGU   = wa_DOKIL-LANGU
   OBJECT  = wa_DOKIL-OBJECT
   TYP     = wa_DOKIL-TYP
   VERSION = wa_DOKIL-VERSION
*   SUPPRESS_TEMPLATE       = ' '
*   USE_NOTE_TEMPLATE       = ' '
 IMPORTING
   DOKTITLE                = ld_title
   HEAD                    = ld_THEAD
 TABLES
   LINE                    = it_lines.

BREAK-POINT. "Any available SAP documentation is contained in it_lines




comments powered by Disqus