SAP STRF_READ_COFILE Function Module for
STRF_READ_COFILE is a standard strf read cofile SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 strf read cofile FM, simply by entering the name STRF_READ_COFILE into the relevant SAP transaction such as SE37 or SE38.
Function Group: STRF
Program Name: SAPLSTRF
Main Program: SAPLSTRF
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function STRF_READ_COFILE 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 'STRF_READ_COFILE'".
EXPORTING
* IV_DIRTYPE = 'T' "
IV_TRKORR = "Transport Request
* IV_READ_HEADER = 'X' "
* IV_TRANSPORT_DIRECTORY = ' ' "
IMPORTING
EV_COFI_HEADER = "
EV_PROJECT = "
ET_PREDECESSORS = "
TABLES
* TT_COFI_LINES = "
EXCEPTIONS
WRONG_CALL = 1 NO_INFO_FOUND = 2
IMPORTING Parameters details for STRF_READ_COFILE
IV_DIRTYPE -
Data type: TSTRF01-DIRTYPEDefault: 'T'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRKORR - Transport Request
Data type: E070-TRKORROptional: No
Call by Reference: No ( called with pass by value option)
IV_READ_HEADER -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRANSPORT_DIRECTORY -
Data type: TMSCSYS-TRADIRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for STRF_READ_COFILE
EV_COFI_HEADER -
Data type: TSTRFCOFIHOptional: No
Call by Reference: No ( called with pass by value option)
EV_PROJECT -
Data type: TRKORR_POptional: No
Call by Reference: No ( called with pass by value option)
ET_PREDECESSORS -
Data type: TMS_TRKORRSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for STRF_READ_COFILE
TT_COFI_LINES -
Data type: TSTRFCOFILOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
WRONG_CALL - Invalid call
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_INFO_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for STRF_READ_COFILE 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_iv_dirtype | TYPE TSTRF01-DIRTYPE, " 'T' | |||
| lv_wrong_call | TYPE TSTRF01, " | |||
| lt_tt_cofi_lines | TYPE STANDARD TABLE OF TSTRFCOFIL, " | |||
| lv_ev_cofi_header | TYPE TSTRFCOFIH, " | |||
| lv_iv_trkorr | TYPE E070-TRKORR, " | |||
| lv_ev_project | TYPE TRKORR_P, " | |||
| lv_no_info_found | TYPE TRKORR_P, " | |||
| lv_iv_read_header | TYPE C, " 'X' | |||
| lv_et_predecessors | TYPE TMS_TRKORRS, " | |||
| lv_iv_transport_directory | TYPE TMSCSYS-TRADIR. " SPACE |
|   CALL FUNCTION 'STRF_READ_COFILE' " |
| EXPORTING | ||
| IV_DIRTYPE | = lv_iv_dirtype | |
| IV_TRKORR | = lv_iv_trkorr | |
| IV_READ_HEADER | = lv_iv_read_header | |
| IV_TRANSPORT_DIRECTORY | = lv_iv_transport_directory | |
| IMPORTING | ||
| EV_COFI_HEADER | = lv_ev_cofi_header | |
| EV_PROJECT | = lv_ev_project | |
| ET_PREDECESSORS | = lv_et_predecessors | |
| TABLES | ||
| TT_COFI_LINES | = lt_tt_cofi_lines | |
| EXCEPTIONS | ||
| WRONG_CALL = 1 | ||
| NO_INFO_FOUND = 2 | ||
| . " STRF_READ_COFILE | ||
ABAP code using 7.40 inline data declarations to call FM STRF_READ_COFILE
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.| "SELECT single DIRTYPE FROM TSTRF01 INTO @DATA(ld_iv_dirtype). | ||||
| DATA(ld_iv_dirtype) | = 'T'. | |||
| "SELECT single TRKORR FROM E070 INTO @DATA(ld_iv_trkorr). | ||||
| DATA(ld_iv_read_header) | = 'X'. | |||
| "SELECT single TRADIR FROM TMSCSYS INTO @DATA(ld_iv_transport_directory). | ||||
| DATA(ld_iv_transport_directory) | = ' '. | |||
Search for further information about these or an SAP related objects