SAP LESEN_DOKUMENT Function Module for Read document









LESEN_DOKUMENT is a standard lesen dokument SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read document processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for lesen dokument FM, simply by entering the name LESEN_DOKUMENT into the relevant SAP transaction such as SE37 or SE38.

Function Group: CVIN
Program Name: SAPLCVIN
Main Program: SAPLCVIN
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function LESEN_DOKUMENT pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'LESEN_DOKUMENT'"Read document
EXPORTING
* ACTIVITY = ' ' "
DDOKAR = "
DDOKNR = "
DDOKTL = "
DDOKVR = "
* DLANGU = SY-LANGU "
* DMANDT = SY-MANDT "
* DRAD_READ = 'X' "
* DRAP_READ = 'X' "

IMPORTING
EXDRAT = "
EXDRAW = "
EXTDWST = "
LTEXNAM = "
ORIGINAL_EXISTS = "
EXTDWS = "

TABLES
* EXDRAD = "
* EXDRAP = "

EXCEPTIONS
NOT_FOUND = 1 NO_AUTH = 2
.



IMPORTING Parameters details for LESEN_DOKUMENT

ACTIVITY -

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

DDOKAR -

Data type: DRAW-DOKAR
Optional: No
Call by Reference: No ( called with pass by value option)

DDOKNR -

Data type: DRAW-DOKNR
Optional: No
Call by Reference: No ( called with pass by value option)

DDOKTL -

Data type: DRAW-DOKTL
Optional: No
Call by Reference: No ( called with pass by value option)

DDOKVR -

Data type: DRAW-DOKVR
Optional: No
Call by Reference: No ( called with pass by value option)

DLANGU -

Data type: SY-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

DMANDT -

Data type: DRAW-MANDT
Default: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

DRAD_READ -

Data type: MCDOK-MARAF
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

DRAP_READ -

Data type: MCDOK-MARAF
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for LESEN_DOKUMENT

EXDRAT -

Data type: DRAT
Optional: No
Call by Reference: No ( called with pass by value option)

EXDRAW -

Data type: DRAW
Optional: No
Call by Reference: No ( called with pass by value option)

EXTDWST -

Data type: TDWST
Optional: No
Call by Reference: No ( called with pass by value option)

LTEXNAM -

Data type: THEAD-TDNAME
Optional: No
Call by Reference: No ( called with pass by value option)

ORIGINAL_EXISTS -

Data type: MCDOK-MARAF
Optional: No
Call by Reference: No ( called with pass by value option)

EXTDWS -

Data type: TDWS
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for LESEN_DOKUMENT

EXDRAD -

Data type: DRAD
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXDRAP -

Data type: DRAP
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

NOT_FOUND - Not found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_AUTH - No authorization

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for LESEN_DOKUMENT Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_exdrad  TYPE STANDARD TABLE OF DRAD, "   
lv_exdrat  TYPE DRAT, "   
lv_activity  TYPE DRAT, "   ' '
lv_not_found  TYPE DRAT, "   
lv_ddokar  TYPE DRAW-DOKAR, "   
lt_exdrap  TYPE STANDARD TABLE OF DRAP, "   
lv_exdraw  TYPE DRAW, "   
lv_no_auth  TYPE DRAW, "   
lv_ddoknr  TYPE DRAW-DOKNR, "   
lv_extdwst  TYPE TDWST, "   
lv_ddoktl  TYPE DRAW-DOKTL, "   
lv_ltexnam  TYPE THEAD-TDNAME, "   
lv_ddokvr  TYPE DRAW-DOKVR, "   
lv_original_exists  TYPE MCDOK-MARAF, "   
lv_dlangu  TYPE SY-LANGU, "   SY-LANGU
lv_extdws  TYPE TDWS, "   
lv_dmandt  TYPE DRAW-MANDT, "   SY-MANDT
lv_drad_read  TYPE MCDOK-MARAF, "   'X'
lv_drap_read  TYPE MCDOK-MARAF. "   'X'

  CALL FUNCTION 'LESEN_DOKUMENT'  "Read document
    EXPORTING
         ACTIVITY = lv_activity
         DDOKAR = lv_ddokar
         DDOKNR = lv_ddoknr
         DDOKTL = lv_ddoktl
         DDOKVR = lv_ddokvr
         DLANGU = lv_dlangu
         DMANDT = lv_dmandt
         DRAD_READ = lv_drad_read
         DRAP_READ = lv_drap_read
    IMPORTING
         EXDRAT = lv_exdrat
         EXDRAW = lv_exdraw
         EXTDWST = lv_extdwst
         LTEXNAM = lv_ltexnam
         ORIGINAL_EXISTS = lv_original_exists
         EXTDWS = lv_extdws
    TABLES
         EXDRAD = lt_exdrad
         EXDRAP = lt_exdrap
    EXCEPTIONS
        NOT_FOUND = 1
        NO_AUTH = 2
. " LESEN_DOKUMENT




ABAP code using 7.40 inline data declarations to call FM LESEN_DOKUMENT

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
DATA(ld_activity) = ' '.
 
 
"SELECT single DOKAR FROM DRAW INTO @DATA(ld_ddokar).
 
 
 
 
"SELECT single DOKNR FROM DRAW INTO @DATA(ld_ddoknr).
 
 
"SELECT single DOKTL FROM DRAW INTO @DATA(ld_ddoktl).
 
"SELECT single TDNAME FROM THEAD INTO @DATA(ld_ltexnam).
 
"SELECT single DOKVR FROM DRAW INTO @DATA(ld_ddokvr).
 
"SELECT single MARAF FROM MCDOK INTO @DATA(ld_original_exists).
 
"SELECT single LANGU FROM SY INTO @DATA(ld_dlangu).
DATA(ld_dlangu) = SY-LANGU.
 
 
"SELECT single MANDT FROM DRAW INTO @DATA(ld_dmandt).
DATA(ld_dmandt) = SY-MANDT.
 
"SELECT single MARAF FROM MCDOK INTO @DATA(ld_drad_read).
DATA(ld_drad_read) = 'X'.
 
"SELECT single MARAF FROM MCDOK INTO @DATA(ld_drap_read).
DATA(ld_drap_read) = 'X'.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!