SAP PRGN_UPLOAD_AGR Function Module for
PRGN_UPLOAD_AGR is a standard prgn upload agr 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 prgn upload agr FM, simply by entering the name PRGN_UPLOAD_AGR into the relevant SAP transaction such as SE37 or SE38.
Function Group: PRGN_UP_AND_DOWNLOAD
Program Name: SAPLPRGN_UP_AND_DOWNLOAD
Main Program: SAPLPRGN_UP_AND_DOWNLOAD
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function PRGN_UPLOAD_AGR 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 'PRGN_UPLOAD_AGR'".
EXPORTING
* FILENAME_FOR_AGR = "
* FILE_ENCODING = "
* FILETYPE_FOR_AGR = 'ASC' "
* UPLOAD_USER_ASSIGNMENT = ' ' "
* UPLOAD_DESCRIPTION = 'X' "Customized ('C') or standard menu ('S') flag
* UPLOAD_AUTH_DATA = 'X' "Customized ('C') or standard menu ('S') flag
* UPLOAD_MENU_DATA = 'X' "Customized ('C') or standard menu ('S') flag
* UPLOAD_CHILD_AGRS = 'X' "Customized ('C') or standard menu ('S') flag
* SET_TARGET_SYSTEM = ' ' "Customized ('C') or standard menu ('S') flag
* TARGET_SYSTEM = ' ' "Logical Destination (Specified in Function Call)
IMPORTING
NUMBER_OF_AGRS = "
SINGLE_SELECTED_AGR = "Role Name
EXCEPTIONS
FILE_OPEN_ERROR = 1 ACTION_CANCELLED = 10 FILE_READ_ERROR = 2 INVALID_TYPE = 3 NO_BATCH = 4 UNKNOWN_ERROR = 5 NOT_AUTHORIZED = 6 ACTIVITY_GROUP_ENQUEUED = 7 ILLEGAL_RELEASE = 8 NO_VALID_DATA = 9
IMPORTING Parameters details for PRGN_UPLOAD_AGR
FILENAME_FOR_AGR -
Data type: FILE_TABLE-FILENAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
FILE_ENCODING -
Data type: ABAP_ENCODOptional: Yes
Call by Reference: No ( called with pass by value option)
FILETYPE_FOR_AGR -
Data type: RLGRAP-FILETYPEDefault: 'ASC'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPLOAD_USER_ASSIGNMENT -
Data type: SMENSAPNEW-CUSTOMIZEDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPLOAD_DESCRIPTION - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPLOAD_AUTH_DATA - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPLOAD_MENU_DATA - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPLOAD_CHILD_AGRS - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_TARGET_SYSTEM - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TARGET_SYSTEM - Logical Destination (Specified in Function Call)
Data type: AGR_HIER-TARGET_SYSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for PRGN_UPLOAD_AGR
NUMBER_OF_AGRS -
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
SINGLE_SELECTED_AGR - Role Name
Data type: AGR_DEFINE-AGR_NAMEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
FILE_OPEN_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTION_CANCELLED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FILE_READ_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_TYPE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BATCH -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNKNOWN_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_AUTHORIZED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ACTIVITY_GROUP_ENQUEUED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ILLEGAL_RELEASE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_VALID_DATA -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for PRGN_UPLOAD_AGR 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_number_of_agrs | TYPE SY-TABIX, " | |||
| lv_file_open_error | TYPE SY, " | |||
| lv_filename_for_agr | TYPE FILE_TABLE-FILENAME, " | |||
| lv_file_encoding | TYPE ABAP_ENCOD, " | |||
| lv_action_cancelled | TYPE ABAP_ENCOD, " | |||
| lv_file_read_error | TYPE ABAP_ENCOD, " | |||
| lv_filetype_for_agr | TYPE RLGRAP-FILETYPE, " 'ASC' | |||
| lv_single_selected_agr | TYPE AGR_DEFINE-AGR_NAME, " | |||
| lv_invalid_type | TYPE AGR_DEFINE, " | |||
| lv_upload_user_assignment | TYPE SMENSAPNEW-CUSTOMIZED, " SPACE | |||
| lv_no_batch | TYPE SMENSAPNEW, " | |||
| lv_upload_description | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_unknown_error | TYPE SMENSAPNEW, " | |||
| lv_upload_auth_data | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_not_authorized | TYPE SMENSAPNEW, " | |||
| lv_upload_menu_data | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_upload_child_agrs | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_activity_group_enqueued | TYPE SMENSAPNEW, " | |||
| lv_illegal_release | TYPE SMENSAPNEW, " | |||
| lv_set_target_system | TYPE SMENSAPNEW-CUSTOMIZED, " SPACE | |||
| lv_no_valid_data | TYPE SMENSAPNEW, " | |||
| lv_target_system | TYPE AGR_HIER-TARGET_SYS. " SPACE |
|   CALL FUNCTION 'PRGN_UPLOAD_AGR' " |
| EXPORTING | ||
| FILENAME_FOR_AGR | = lv_filename_for_agr | |
| FILE_ENCODING | = lv_file_encoding | |
| FILETYPE_FOR_AGR | = lv_filetype_for_agr | |
| UPLOAD_USER_ASSIGNMENT | = lv_upload_user_assignment | |
| UPLOAD_DESCRIPTION | = lv_upload_description | |
| UPLOAD_AUTH_DATA | = lv_upload_auth_data | |
| UPLOAD_MENU_DATA | = lv_upload_menu_data | |
| UPLOAD_CHILD_AGRS | = lv_upload_child_agrs | |
| SET_TARGET_SYSTEM | = lv_set_target_system | |
| TARGET_SYSTEM | = lv_target_system | |
| IMPORTING | ||
| NUMBER_OF_AGRS | = lv_number_of_agrs | |
| SINGLE_SELECTED_AGR | = lv_single_selected_agr | |
| EXCEPTIONS | ||
| FILE_OPEN_ERROR = 1 | ||
| ACTION_CANCELLED = 10 | ||
| FILE_READ_ERROR = 2 | ||
| INVALID_TYPE = 3 | ||
| NO_BATCH = 4 | ||
| UNKNOWN_ERROR = 5 | ||
| NOT_AUTHORIZED = 6 | ||
| ACTIVITY_GROUP_ENQUEUED = 7 | ||
| ILLEGAL_RELEASE = 8 | ||
| NO_VALID_DATA = 9 | ||
| . " PRGN_UPLOAD_AGR | ||
ABAP code using 7.40 inline data declarations to call FM PRGN_UPLOAD_AGR
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 TABIX FROM SY INTO @DATA(ld_number_of_agrs). | ||||
| "SELECT single FILENAME FROM FILE_TABLE INTO @DATA(ld_filename_for_agr). | ||||
| "SELECT single FILETYPE FROM RLGRAP INTO @DATA(ld_filetype_for_agr). | ||||
| DATA(ld_filetype_for_agr) | = 'ASC'. | |||
| "SELECT single AGR_NAME FROM AGR_DEFINE INTO @DATA(ld_single_selected_agr). | ||||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_upload_user_assignment). | ||||
| DATA(ld_upload_user_assignment) | = ' '. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_upload_description). | ||||
| DATA(ld_upload_description) | = 'X'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_upload_auth_data). | ||||
| DATA(ld_upload_auth_data) | = 'X'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_upload_menu_data). | ||||
| DATA(ld_upload_menu_data) | = 'X'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_upload_child_agrs). | ||||
| DATA(ld_upload_child_agrs) | = 'X'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_set_target_system). | ||||
| DATA(ld_set_target_system) | = ' '. | |||
| "SELECT single TARGET_SYS FROM AGR_HIER INTO @DATA(ld_target_system). | ||||
| DATA(ld_target_system) | = ' '. | |||
Search for further information about these or an SAP related objects