SAP OCS_APP_CAR Function Module for
OCS_APP_CAR is a standard ocs app car 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 ocs app car FM, simply by entering the name OCS_APP_CAR into the relevant SAP transaction such as SE37 or SE38.
Function Group: OCS_FILEMGMT
Program Name: SAPLOCS_FILEMGMT
Main Program: SAPLOCS_FILEMGMT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OCS_APP_CAR 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 'OCS_APP_CAR'".
EXPORTING
PI_FILEINFO = "Information about a file
* PI_COMMAND = 't' "
TABLES
PT_OUTPUT = "
EXCEPTIONS
CAR_WARNING = 1 CAR_ERROR_IN_HEADER = 10 CAR_CANT_DECOMPRESS = 11 CAR_CHKSUM_ERROR = 12 CAR_FILE_PROTECTED = 13 CAR_FILE_LARGER_2GB = 14 CAR_NO_SPACE = 15 CAR_ERROR = 16 CAR_CANT_CHANGE_PERM = 17 CAR_NOT_FOUND = 2 ARCHIVE_NOT_FOUND = 3 ERROR_PROCESSING_CAR = 4 CAR_DIRECTORY_TOO_LONG = 5 CAR_CANT_CREATE_DIRECTORY = 6 CAR_CANT_CREATE_FILE = 7 CAR_STANDARD_FILE_ERROR = 8 CAR_CANT_ALLOC_MEMORY = 9
IMPORTING Parameters details for OCS_APP_CAR
PI_FILEINFO - Information about a file
Data type: OCS_F_INFOOptional: No
Call by Reference: Yes
PI_COMMAND -
Data type: CDefault: 't'
Optional: No
Call by Reference: Yes
TABLES Parameters details for OCS_APP_CAR
PT_OUTPUT -
Data type: TPRESULTOptional: No
Call by Reference: Yes
EXCEPTIONS details
CAR_WARNING -
Data type:Optional: No
Call by Reference: Yes
CAR_ERROR_IN_HEADER -
Data type:Optional: No
Call by Reference: Yes
CAR_CANT_DECOMPRESS -
Data type:Optional: No
Call by Reference: Yes
CAR_CHKSUM_ERROR -
Data type:Optional: No
Call by Reference: Yes
CAR_FILE_PROTECTED -
Data type:Optional: No
Call by Reference: Yes
CAR_FILE_LARGER_2GB -
Data type:Optional: No
Call by Reference: Yes
CAR_NO_SPACE -
Data type:Optional: No
Call by Reference: Yes
CAR_ERROR -
Data type:Optional: No
Call by Reference: Yes
CAR_CANT_CHANGE_PERM -
Data type:Optional: No
Call by Reference: Yes
CAR_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
ARCHIVE_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
ERROR_PROCESSING_CAR -
Data type:Optional: No
Call by Reference: Yes
CAR_DIRECTORY_TOO_LONG -
Data type:Optional: No
Call by Reference: Yes
CAR_CANT_CREATE_DIRECTORY -
Data type:Optional: No
Call by Reference: Yes
CAR_CANT_CREATE_FILE -
Data type:Optional: No
Call by Reference: Yes
CAR_STANDARD_FILE_ERROR -
Data type:Optional: No
Call by Reference: Yes
CAR_CANT_ALLOC_MEMORY -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for OCS_APP_CAR 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_pt_output | TYPE STANDARD TABLE OF TPRESULT, " | |||
| lv_car_warning | TYPE TPRESULT, " | |||
| lv_pi_fileinfo | TYPE OCS_F_INFO, " | |||
| lv_car_error_in_header | TYPE OCS_F_INFO, " | |||
| lv_car_cant_decompress | TYPE OCS_F_INFO, " | |||
| lv_car_chksum_error | TYPE OCS_F_INFO, " | |||
| lv_car_file_protected | TYPE OCS_F_INFO, " | |||
| lv_car_file_larger_2gb | TYPE OCS_F_INFO, " | |||
| lv_car_no_space | TYPE OCS_F_INFO, " | |||
| lv_car_error | TYPE OCS_F_INFO, " | |||
| lv_car_cant_change_perm | TYPE OCS_F_INFO, " | |||
| lv_pi_command | TYPE C, " 't' | |||
| lv_car_not_found | TYPE C, " | |||
| lv_archive_not_found | TYPE C, " | |||
| lv_error_processing_car | TYPE C, " | |||
| lv_car_directory_too_long | TYPE C, " | |||
| lv_car_cant_create_directory | TYPE C, " | |||
| lv_car_cant_create_file | TYPE C, " | |||
| lv_car_standard_file_error | TYPE C, " | |||
| lv_car_cant_alloc_memory | TYPE C. " |
|   CALL FUNCTION 'OCS_APP_CAR' " |
| EXPORTING | ||
| PI_FILEINFO | = lv_pi_fileinfo | |
| PI_COMMAND | = lv_pi_command | |
| TABLES | ||
| PT_OUTPUT | = lt_pt_output | |
| EXCEPTIONS | ||
| CAR_WARNING = 1 | ||
| CAR_ERROR_IN_HEADER = 10 | ||
| CAR_CANT_DECOMPRESS = 11 | ||
| CAR_CHKSUM_ERROR = 12 | ||
| CAR_FILE_PROTECTED = 13 | ||
| CAR_FILE_LARGER_2GB = 14 | ||
| CAR_NO_SPACE = 15 | ||
| CAR_ERROR = 16 | ||
| CAR_CANT_CHANGE_PERM = 17 | ||
| CAR_NOT_FOUND = 2 | ||
| ARCHIVE_NOT_FOUND = 3 | ||
| ERROR_PROCESSING_CAR = 4 | ||
| CAR_DIRECTORY_TOO_LONG = 5 | ||
| CAR_CANT_CREATE_DIRECTORY = 6 | ||
| CAR_CANT_CREATE_FILE = 7 | ||
| CAR_STANDARD_FILE_ERROR = 8 | ||
| CAR_CANT_ALLOC_MEMORY = 9 | ||
| . " OCS_APP_CAR | ||
ABAP code using 7.40 inline data declarations to call FM OCS_APP_CAR
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_pi_command) | = 't'. | |||
Search for further information about these or an SAP related objects