SAP S_AUTH_XML_WRITE_FILE Function Module for
S_AUTH_XML_WRITE_FILE is a standard s auth xml write file 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 s auth xml write file FM, simply by entering the name S_AUTH_XML_WRITE_FILE into the relevant SAP transaction such as SE37 or SE38.
Function Group: S_AUTH_TOOL_UP_DOWNLOAD
Program Name: SAPLS_AUTH_TOOL_UP_DOWNLOAD
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function S_AUTH_XML_WRITE_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 'S_AUTH_XML_WRITE_FILE'".
EXPORTING
* READ_ALL = 'X' "Customized ('C') or standard menu ('S') flag
* FILENAME_FOR_DATA = 'c: temp table.XML' "Local file for upload/download
* PRETTY_PRINT = 'X' "Customized ('C') or standard menu ('S') flag
* XML_FORMAT = 'X' "Transfer File Format (Upload/Download)
IMPORTING
XML_SIZE = "Internal Tables, Current Row Index
NUMBER_OF_AGRS = "Internal Tables, Current Row Index
TABLES
* SELECTED_ROLES = "SAP Authorization Assistant - Definition
EXCEPTIONS
XML_CONVERSION_FAILED = 1 FILE_OPEN_ERROR = 2 FILE_WRITE_ERROR = 3 FILE_GENERAL_ERROR = 4 NO_AUTHORITY = 5
IMPORTING Parameters details for S_AUTH_XML_WRITE_FILE
READ_ALL - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FILENAME_FOR_DATA - Local file for upload/download
Data type: RLGRAP-FILENAMEDefault: 'c: temp table.XML'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRETTY_PRINT - Customized ('C') or standard menu ('S') flag
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
XML_FORMAT - Transfer File Format (Upload/Download)
Data type: SMENSAPNEW-CUSTOMIZEDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for S_AUTH_XML_WRITE_FILE
XML_SIZE - Internal Tables, Current Row Index
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
NUMBER_OF_AGRS - Internal Tables, Current Row Index
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for S_AUTH_XML_WRITE_FILE
SELECTED_ROLES - SAP Authorization Assistant - Definition
Data type: AAA_ROLESOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
XML_CONVERSION_FAILED -
Data type:Optional: No
Call by Reference: Yes
FILE_OPEN_ERROR -
Data type:Optional: No
Call by Reference: Yes
FILE_WRITE_ERROR -
Data type:Optional: No
Call by Reference: Yes
FILE_GENERAL_ERROR -
Data type:Optional: No
Call by Reference: Yes
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for S_AUTH_XML_WRITE_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_read_all | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_xml_size | TYPE SY-TABIX, " | |||
| lt_selected_roles | TYPE STANDARD TABLE OF AAA_ROLES, " | |||
| lv_xml_conversion_failed | TYPE AAA_ROLES, " | |||
| lv_number_of_agrs | TYPE SY-TABIX, " | |||
| lv_file_open_error | TYPE SY, " | |||
| lv_filename_for_data | TYPE RLGRAP-FILENAME, " 'c: temp table,XML' | |||
| lv_pretty_print | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_file_write_error | TYPE SMENSAPNEW, " | |||
| lv_xml_format | TYPE SMENSAPNEW-CUSTOMIZED, " 'X' | |||
| lv_file_general_error | TYPE SMENSAPNEW, " | |||
| lv_no_authority | TYPE SMENSAPNEW. " |
|   CALL FUNCTION 'S_AUTH_XML_WRITE_FILE' " |
| EXPORTING | ||
| READ_ALL | = lv_read_all | |
| FILENAME_FOR_DATA | = lv_filename_for_data | |
| PRETTY_PRINT | = lv_pretty_print | |
| XML_FORMAT | = lv_xml_format | |
| IMPORTING | ||
| XML_SIZE | = lv_xml_size | |
| NUMBER_OF_AGRS | = lv_number_of_agrs | |
| TABLES | ||
| SELECTED_ROLES | = lt_selected_roles | |
| EXCEPTIONS | ||
| XML_CONVERSION_FAILED = 1 | ||
| FILE_OPEN_ERROR = 2 | ||
| FILE_WRITE_ERROR = 3 | ||
| FILE_GENERAL_ERROR = 4 | ||
| NO_AUTHORITY = 5 | ||
| . " S_AUTH_XML_WRITE_FILE | ||
ABAP code using 7.40 inline data declarations to call FM S_AUTH_XML_WRITE_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.| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_read_all). | ||||
| DATA(ld_read_all) | = 'X'. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_xml_size). | ||||
| "SELECT single TABIX FROM SY INTO @DATA(ld_number_of_agrs). | ||||
| "SELECT single FILENAME FROM RLGRAP INTO @DATA(ld_filename_for_data). | ||||
| DATA(ld_filename_for_data) | = 'c: temp table.XML'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_pretty_print). | ||||
| DATA(ld_pretty_print) | = 'X'. | |||
| "SELECT single CUSTOMIZED FROM SMENSAPNEW INTO @DATA(ld_xml_format). | ||||
| DATA(ld_xml_format) | = 'X'. | |||
Search for further information about these or an SAP related objects