May 28, 2026

F4 Help to Get File from AL11 in Selection Screen

To provide F4 value help for files on the application server (AL11), the most effective way is to use specific SAP function modules within your ABAP code. Since standard search help doesn't automatically browse application server directories, you must implement the logic in the AT SELECTION-SCREEN ON VALUE-REQUEST event.

Recommended Function Modules
For browsing and selecting files directly from the application server, you can use these common modules:
  • /SAPDMC/LSM_F4_SERVER_FILE: This is widely used to open a pop-up that allows users to navigate the SAP AL11 directories and select a file.
  • F4_DXFILENAME_TOPRECURSION: Another standard function module specifically designed for search help on application server files.
Implementation Example
To add this help to a selection screen parameter (e.g., p_file), use the following logic in your report:

abap
PARAMETERS: p_file TYPE string.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    IMPORTING
      serverfile       = p_file
    EXCEPTIONS
      canceled_by_user = 1
      OTHERS           = 2.

Key Considerations
  • Permissions: Ensure the user has the necessary authorizations (e.g., S_DATASET) to access the specific AL11 directory paths.
  • Directory-only Help: If you only need to select a directory (not a specific file), you can call the program RSWATCH0 or use F4IF_INT_TABLE_VALUE_REQUEST after fetching directory lists via EPS_GET_DIRECTORY_LISTING.
  • Presentation Server Difference: For files on your local PC (Presentation Server), use CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG instead

Sample Code of Using CL_GU_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

The CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG method is the standard object-oriented way in ABAP to trigger a file selection popup on a user's local machine. It replaces older function modules like WS_FILENAME_GET

Basic Sample Code
This example demonstrates how to call the dialog and retrieve the selected file path to populate a selection screen parameter


abap
REPORT z_file_dialog_demo.

DATA: lt_file_table TYPE filetable, " Table to store selected files
      lv_rc         TYPE i.         " Return code

PARAMETERS: p_file TYPE localfile. " Selection screen parameter

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  " Call the File Open Dialog
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = 'Select your Excel File'
      default_extension       = '*.xlsx'
      file_filter             = 'Excel Files (*.XLSX)|*.XLSX|All Files (*.*)|*.*'
      multiselection          = abap_false " Set to 'X' to allow multiple files
    CHANGING
      file_table              = lt_file_table
      rc                      = lv_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.

  IF sy-subrc = 0 AND lv_rc > 0.
    " Retrieve the first selected file path
    READ TABLE lt_file_table INTO DATA(ls_file) INDEX 1.
    IF sy-subrc = 0.
      p_file = ls_file-filename.
    ENDIF.
  ENDIF.


Key Parameters Explained
  • window_title: The text that appears at the top of the popup window.
  • default_extension: Sets the initial file type the dialog looks for (e.g., .txt or .xlsx).
  • file_filter: Controls the "Files of type" dropdown. Use the format Description (*.ext)|*.ext.
  • multiselection: Set to abap_true ('X') if you want the user to be able to select multiple files at once.
  • file_table: A table of type FILETABLE that will hold the paths of the selected files.
  • rc: A return code that typically indicates the number of files selected by the user. 
Common Use Cases
  • F4 Help: Often used within the AT SELECTION-SCREEN ON VALUE-REQUEST event to provide a browse button for a file path input field.
  • Multi-File Selection: Unlike some older function modules, this method natively supports selecting several files at once for batch processing.
  • File Uploading: Typically followed by a call to CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD to bring the selected file's data into an internal SAP table


Ref:

https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-frontend-services-gt-file-open-dialog-initial-directory-ignored/td-p/416130

https://community.sap.com/t5/application-development-and-automation-discussions/file-open-dialog-no-extension/td-p/12747028

May 12, 2026

Essential SAP IDoc transaction codes

Essential SAP IDoc transaction codes are primarily located under the WE transaction prefix, focused on monitoring, testing, and administration. Key tcodes include WE02/WE05 for displaying IDoc lists, WE19 for testing/debugging, and BD87 for reprocessing failed IDocs. 

Key IDoc Transaction Codes
  • WE02 / WE05: Display/List IDocs (Most commonly used)
  • WE19: IDoc Test Tool (Create/edit/debug)
  • BD87: Reprocess failed IDocs (Status Monitor)
  • WE20: Partner Profiles (Configure EDI/ALE)
  • WE09: Search for IDocs by content/segment
  • WE11: Delete IDocs
  • WE21: Ports definition 
IDoc Administration & Development
  • WE30: IDoc Types (Define structure)
  • WE31: Create IDoc Segments
  • WE81: Define Logical Message Types
  • WE82: Assign Message Type to IDoc Type
  • WE41/42: Inbound/Outbound Process Codes
  • WE57: Assign FM to Log. Message and IDoc Type 
Master Data Sending (ALE) 
  • BD10: Send Material
  • BD12: Send Customer
  • BD14: Send Vendor
  • BD21: Create IDoc for Change Pointers
  • BD64: Maintain Distribution Model 
Other Useful Tcodes
  • WE06: Monitor Active IDocs
  • WE07: IDoc Statistics
  • WE60: Documentation for IDoc Type
  • SALE: ALE Implementation Guide