SAP SAL_WS_READ_FILE Function Module for Local Monitoring Segment: Get lists of all MT that belong to one Cust. Grp









SAL_WS_READ_FILE is a standard sal ws read file SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Local Monitoring Segment: Get lists of all MT that belong to one Cust. Grp 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 sal ws read file FM, simply by entering the name SAL_WS_READ_FILE into the relevant SAP transaction such as SE37 or SE38.

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



Function SAL_WS_READ_FILE 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 'SAL_WS_READ_FILE'"Local Monitoring Segment: Get lists of all MT that belong to one Cust. Grp
EXPORTING
DESTINATION = "Logical Destination (Specified When Function Is Called)
* FILENAME = "Character 512
* STARTLINE = 0 "Natural Number
* ENDLINE = 0 "Natural Number
* LINES = 0 "Natural Number
* STARTFILEPOS = '0' "FIELD_TYPE
* GUID = "System GUID for ABAP Systems or Other Systems
* FILETYPE = 'ASC' "FIELD_TYPE

IMPORTING
FILEPOS = "FIELD_TYPE
LINES_READ = "Natural Number
BYTES_READ = "FIELD_TYPE
STRING = "
ERROR_TEXT = "

TABLES
* OUTPUT_STD = "Internal table with data
* ERROR_STD = "Length of line 1024

EXCEPTIONS
C_CALL_FAILED = 1 INTERNAL_ERROR = 2 FILE_NOT_FOUND = 3 TIMEOUT = 4 COULD_NOT_READ_FILE = 5 NO_READ_PERMISSION = 6 WS_PROXY_FAILURE = 7
.



IMPORTING Parameters details for SAL_WS_READ_FILE

DESTINATION - Logical Destination (Specified When Function Is Called)

Data type: RFCDEST
Optional: No
Call by Reference: Yes

FILENAME - Character 512

Data type: CHAR512
Optional: Yes
Call by Reference: Yes

STARTLINE - Natural Number

Data type: INT4
Optional: Yes
Call by Reference: Yes

ENDLINE - Natural Number

Data type: INT4
Optional: Yes
Call by Reference: Yes

LINES - Natural Number

Data type: INT4
Optional: Yes
Call by Reference: Yes

STARTFILEPOS - FIELD_TYPE

Data type: CHAR20
Default: '0'
Optional: Yes
Call by Reference: Yes

GUID - System GUID for ABAP Systems or Other Systems

Data type: CSMSYSGUID
Optional: Yes
Call by Reference: Yes

FILETYPE - FIELD_TYPE

Data type: CHAR20
Default: 'ASC'
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for SAL_WS_READ_FILE

FILEPOS - FIELD_TYPE

Data type: CHAR20
Optional: No
Call by Reference: Yes

LINES_READ - Natural Number

Data type: INT4
Optional: No
Call by Reference: Yes

BYTES_READ - FIELD_TYPE

Data type: CHAR20
Optional: No
Call by Reference: Yes

STRING -

Data type: STRING
Optional: No
Call by Reference: Yes

ERROR_TEXT -

Data type: STRING
Optional: No
Call by Reference: Yes

TABLES Parameters details for SAL_WS_READ_FILE

OUTPUT_STD - Internal table with data

Data type: CCMCTLTXTTAB
Optional: Yes
Call by Reference: Yes

ERROR_STD - Length of line 1024

Data type: CCMCTLTXTTAB
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

C_CALL_FAILED -

Data type:
Optional: No
Call by Reference: Yes

INTERNAL_ERROR -

Data type:
Optional: No
Call by Reference: Yes

FILE_NOT_FOUND - File not found

Data type:
Optional: No
Call by Reference: Yes

TIMEOUT - maximum runtime exceeded

Data type:
Optional: No
Call by Reference: Yes

COULD_NOT_READ_FILE - File could not be read

Data type:
Optional: No
Call by Reference: Yes

NO_READ_PERMISSION -

Data type:
Optional: No
Call by Reference: Yes

WS_PROXY_FAILURE -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for SAL_WS_READ_FILE 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:
lv_filepos  TYPE CHAR20, "   
lt_output_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB, "   
lv_destination  TYPE RFCDEST, "   
lv_c_call_failed  TYPE RFCDEST, "   
lv_filename  TYPE CHAR512, "   
lt_error_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB, "   
lv_lines_read  TYPE INT4, "   
lv_internal_error  TYPE INT4, "   
lv_startline  TYPE INT4, "   0
lv_bytes_read  TYPE CHAR20, "   
lv_file_not_found  TYPE CHAR20, "   
lv_string  TYPE STRING, "   
lv_endline  TYPE INT4, "   0
lv_timeout  TYPE INT4, "   
lv_lines  TYPE INT4, "   0
lv_error_text  TYPE STRING, "   
lv_could_not_read_file  TYPE STRING, "   
lv_startfilepos  TYPE CHAR20, "   '0'
lv_no_read_permission  TYPE CHAR20, "   
lv_guid  TYPE CSMSYSGUID, "   
lv_ws_proxy_failure  TYPE CSMSYSGUID, "   
lv_filetype  TYPE CHAR20. "   'ASC'

  CALL FUNCTION 'SAL_WS_READ_FILE'  "Local Monitoring Segment: Get lists of all MT that belong to one Cust. Grp
    EXPORTING
         DESTINATION = lv_destination
         FILENAME = lv_filename
         STARTLINE = lv_startline
         ENDLINE = lv_endline
         LINES = lv_lines
         STARTFILEPOS = lv_startfilepos
         GUID = lv_guid
         FILETYPE = lv_filetype
    IMPORTING
         FILEPOS = lv_filepos
         LINES_READ = lv_lines_read
         BYTES_READ = lv_bytes_read
         STRING = lv_string
         ERROR_TEXT = lv_error_text
    TABLES
         OUTPUT_STD = lt_output_std
         ERROR_STD = lt_error_std
    EXCEPTIONS
        C_CALL_FAILED = 1
        INTERNAL_ERROR = 2
        FILE_NOT_FOUND = 3
        TIMEOUT = 4
        COULD_NOT_READ_FILE = 5
        NO_READ_PERMISSION = 6
        WS_PROXY_FAILURE = 7
. " SAL_WS_READ_FILE




ABAP code using 7.40 inline data declarations to call FM SAL_WS_READ_FILE

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_startfilepos) = '0'.
 
 
 
 
DATA(ld_filetype) = 'ASC'.
 


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!