SAP Function Modules

CSM_SHOW_FILE SAP Function module







CSM_SHOW_FILE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CSM_SHOW_FILE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SCSM_FILEINFO
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM CSM_SHOW_FILE - CSM SHOW FILE





CALL FUNCTION 'CSM_SHOW_FILE' "
  EXPORTING
    filename =                  " char512       Complete File Name
*   timeout = 10                " int4
*   timeout = 10                " int4
*   startline = 0               " int4
*   endline = 0                 " int4
*   lines = 0                   " int4
*   startfilepos = 0            " char20
*   guid =                      " csmsysguid    Not Yet Used
*   filetype = 'ASC'            " char20
  IMPORTING
    filepos =                   " char20
    lines_read =                " int4
    bytes_read =                " char20
    string =                    " string
* TABLES
*   output_std =                " ccmctltxttab
*   error_std =                 " ccmctltxttab
*   output_bin =                " ccmctlbin
  EXCEPTIONS
    FILE_NOT_FOUND = 1          "               File not found
    TIMEOUT = 2                 "
    TIMEOUT = 2                 "
    COULD_NOT_READ_FILE = 3     "               File could not be read
    INTERNAL_ERROR = 4          "
    NO_READ_PERMISSION = 5      "
    .  "  CSM_SHOW_FILE

ABAP code example for Function Module CSM_SHOW_FILE





The ABAP code below is a full code listing to execute function module CSM_SHOW_FILE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_filepos  TYPE CHAR20 ,
ld_lines_read  TYPE INT4 ,
ld_bytes_read  TYPE CHAR20 ,
ld_string  TYPE STRING ,
it_output_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB,"TABLES PARAM
wa_output_std  LIKE LINE OF it_output_std ,
it_error_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB,"TABLES PARAM
wa_error_std  LIKE LINE OF it_error_std ,
it_output_bin  TYPE STANDARD TABLE OF CCMCTLBIN,"TABLES PARAM
wa_output_bin  LIKE LINE OF it_output_bin .

DATA(ld_filename) = 'Check type of data required'.
DATA(ld_timeout) = 'Check type of data required'.
DATA(ld_timeout) = 'Check type of data required'.
DATA(ld_startline) = 'Check type of data required'.
DATA(ld_endline) = 'Check type of data required'.
DATA(ld_lines) = 'Check type of data required'.
DATA(ld_startfilepos) = 'Check type of data required'.
DATA(ld_guid) = '20210129'.
DATA(ld_filetype) = 'some text here'.

"populate fields of struture and append to itab
append wa_output_std to it_output_std.

"populate fields of struture and append to itab
append wa_error_std to it_error_std.

"populate fields of struture and append to itab
append wa_output_bin to it_output_bin. . CALL FUNCTION 'CSM_SHOW_FILE' EXPORTING filename = ld_filename * timeout = ld_timeout * timeout = ld_timeout * startline = ld_startline * endline = ld_endline * lines = ld_lines * startfilepos = ld_startfilepos * guid = ld_guid * filetype = ld_filetype IMPORTING filepos = ld_filepos lines_read = ld_lines_read bytes_read = ld_bytes_read string = ld_string * TABLES * output_std = it_output_std * error_std = it_error_std * output_bin = it_output_bin EXCEPTIONS FILE_NOT_FOUND = 1 TIMEOUT = 2 TIMEOUT = 2 COULD_NOT_READ_FILE = 3 INTERNAL_ERROR = 4 NO_READ_PERMISSION = 5 . " CSM_SHOW_FILE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_filepos  TYPE CHAR20 ,
ld_filename  TYPE CHAR512 ,
it_output_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB ,
wa_output_std  LIKE LINE OF it_output_std,
ld_lines_read  TYPE INT4 ,
ld_timeout  TYPE INT4 ,
ld_timeout  TYPE INT4 ,
it_error_std  TYPE STANDARD TABLE OF CCMCTLTXTTAB ,
wa_error_std  LIKE LINE OF it_error_std,
ld_bytes_read  TYPE CHAR20 ,
ld_startline  TYPE INT4 ,
it_output_bin  TYPE STANDARD TABLE OF CCMCTLBIN ,
wa_output_bin  LIKE LINE OF it_output_bin,
ld_string  TYPE STRING ,
ld_endline  TYPE INT4 ,
ld_lines  TYPE INT4 ,
ld_startfilepos  TYPE CHAR20 ,
ld_guid  TYPE CSMSYSGUID ,
ld_filetype  TYPE CHAR20 .

ld_filename = 'some text here'.

"populate fields of struture and append to itab
append wa_output_std to it_output_std.
ld_timeout = 'some text here'.
ld_timeout = 'some text here'.

"populate fields of struture and append to itab
append wa_error_std to it_error_std.
ld_startline = 'some text here'.

"populate fields of struture and append to itab
append wa_output_bin to it_output_bin.
ld_endline = 'some text here'.
ld_lines = 'some text here'.
ld_startfilepos = 'some text here'.
ld_guid = '20210129'.
ld_filetype = 'some text here'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CSM_SHOW_FILE or its description.