F4 help for file path in the Application server

Hi All,
i want to provide the F4 help so as to enable us to give the file path in the application server (AL11). I'm in version 4.0
Regards
Shekhar

Hi
Copy paste the following code and see the result
Here you can see 2 types of open dialogs
1. Directory View
2. File View
Use any one as per your requirement.
DATA : l_filetable TYPE filetable,
       l_rc TYPE i.
DATA: l_folder TYPE string,
      l_file TYPE string.
PARAMETERS: p_folder(100) TYPE c,
            p_file(100) TYPE c.
*Provide a Dialogue box for getting a folder path
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
  CALL METHOD cl_gui_frontend_services=>directory_browse
    EXPORTING
      window_title    = 'Select Folder Path'
      initial_folder  = 'D:\'
    CHANGING
      selected_folder = l_folder.
  p_folder = l_folder.
*Provide a Dialogue box for getting a file path
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title      = 'Select a Text File'
      initial_directory = l_folder
    CHANGING
      file_table        = l_filetable
      rc                = l_rc.
Reward points generously
Regards
Akshay Chonkar
  READ TABLE l_filetable INTO p_file INDEX 1.
  CHECK sy-subrc <> 0.

Similar Messages

  • LSMW :Is it possible to create F4 Help for File path selection

    Hi All .,
    Please let me know is it possible to create F4 help for file path creation in LSMW .
    thanks
    Sreenivas

    Hi,
    I don't get it.
    In the step " Specify files" you will have the option to pick your flat file which is on the desktop by pressing F4 .
    What is that you exactly want??
    Warm regards,
    Hari Kiran

  • Regarding the File Format on the application server

    Hi,
    I would like to know the file format (ANSI, UTF-8, UTF-16, UTF-32) of the file placed on the application server in my program. Can anyone help me with the Function Module or Class or any other way which will retrieve this information.
    Thanks
    Sarves S V K

    Hi
    You can try the standard class CL_ABAP_FILE_UTILITIES and the method
      CALL METHOD cl_abap_file_utilities=>check_utf8 
        EXPORTING 
         file_name = filename 
        IMPORTING 
         bom       = file_bom 
         encoding  = file_encoding. 
    Check the possible values returned by encoding and BOM:
    NO_BOM
    BOM_UTF8
    BOM_UTF16_BE
    BOM_UTF16_LE
    ENCODING_UTF8
    ENCODING_7BIT_ASCII
    ENCODING_OTHER

  • FM to validate the file path on the presenation server.

    Hi all,
    We are downloading a file on to the presentation server.
    Is there any FM to validate the file path of the presentation server?
    Its usgent.
    Thanks and Regards,
    Praveen

    Hi praveen,
    this may probably help you i think
    but its not a fm its a subroutine.
    FORM validate_pre_file USING fp_name TYPE rlgrap-filename.
    DATA : l_result,
    l_filename TYPE string.
    l_filename = fp_name.
    CLEAR l_result.
    CALL METHOD cl_gui_frontend_services=>file_exist
    EXPORTING
    file = l_filename
    RECEIVING
    result = l_result
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    wrong_parameter = 3
    not_supported_by_gui = 4
    OTHERS = 5.
    IF sy-subrc 0.
    MESSAGE s007 DISPLAY LIKE c_e.
    LEAVE LIST-PROCESSING.
    ELSEIF l_result IS INITIAL.
    MESSAGE s008 DISPLAY LIKE c_e.
    LEAVE LIST-PROCESSING.
    ENDIF.
    ENDFORM. " validate_pre_file_hdr
    regards
    srikanth tulasi.

  • How to send the file contents in the application server to ftp server

    Hi,
    how to send the file contents in the application server to ftp server.
    regards,
    sree

    Test SAP FTP functions
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
           HOST            = 'servername'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.
    Execute external commands (FTP Scripts)
    The following code shows the syntax of the FM 'SXPG_COMMAND_EXECUTE'. You pass it the external command created within transaction SM69 and it will execute it.
    DATA: ld_comline 
    LIKE sxpgcolist-name,
            ld_param    LIKE sxpgcolist-parameters,
            ld_status   LIKE extcmdexex-status,
            ld_output   LIKE btcxpm OCCURS 0 WITH HEADER LINE,
            ld_subrc    LIKE sy-subrc.
      REFRESH ld_output.
      MOVE 'FTP_DATA_IN' to ld_comline.         "Maintained using trans SM69
    Execute external command, contained in 'ld_comline'
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
           EXPORTING
                commandname                   = ld_comline
              additional_parameters   = ld_param  "Params passed to script
              operatingsystem              
    = 'UNIX'
           IMPORTING
                status                        = ld_status
           TABLES
                exec_protocol                 = ld_output
           EXCEPTIONS
                no_permission
                     = 1
                command_not_found
                 = 2
                parameters_too_long          
    = 3
                security_risk                
    = 4
                wrong_check_call_interface    = 5
                program_start_error           = 6
                program_termination_error     = 7
                x_error                       = 8
                parameter_expected            = 9
                too_many_parameters           = 10
                illegal_command               = 11
                wrong_asynchronous_parameters = 12
                cant_enq_tbtco_entry
              = 13
                jobcount_generation_error
         = 14
                OTHERS                       
    = 15.
      IF sy-subrc NE 0.
      ENDIF.

  • FM to validate the file path on the presentation server.

    Hi all,
                  We are downloading a file on to the presentation server.
    Is there any FM to validate the file path of the presentation server?
    Suggestions are also welcome.
    Regards,
    Sreekar

    You can call a class like a function module. See example below:
    TYPE-POOLS: ABAP.
    DATA: L_DIR TYPE STRING.
    DATA: L_BOL TYPE ABAP_BOOL.
    L_DIR = 'c:\windows'.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
      EXPORTING
        DIRECTORY            = L_DIR
      RECEIVING
        RESULT               = L_BOL
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        WRONG_PARAMETER      = 3
        NOT_SUPPORTED_BY_GUI = 4
        others               = 5.
    IF NOT L_BOL IS INITIAL.
      WRITE: / 'Directory exists.'.
    ELSE.
      WRITE: / 'Directory does not exist.'.
    ENDIF.

  • F4 help for file path in selection screen.

    Hi there,
    I defined one parameter p_path for file path using RLGRAP-FILENAME. I have not got F4 for this. How to solve this problem, can anybody pls help.
    Regards,
    Naseer.

    Hi,
    refer to the following code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pc.
    DATA: it_tab TYPE filetable,
              wf_subrc TYPE i.
    DATA: wf_pcfile LIKE rlgrap-filename.
      DATA: wf_filter TYPE string,
            wf_dir TYPE string,
            wf_title TYPE string,
            wf_ext TYPE string.
    *  if p_ml = 'X'.                  "Manula Load - PC File
      wf_title = text-012.          "Window title
      wf_ext  = '.TXT'.           "Extension of the file
      wf_filter = 'Text Files (*.TXT)|*.TXT'.         "File Type
      wf_dir = wf_pcfile.           "Directory
    *Adds a GUI-Supported Feature
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title      = wf_title
          default_extension = wf_ext
          file_filter       = wf_filter
          initial_directory = wf_dir
        CHANGING
          file_table        = it_tab
          rc                = wf_subrc.
    Hope this helps.
    <REMOVED BY MODERATOR>
    Regards,
    Sipra
    Edited by: Alvaro Tejada Galindo on Jan 31, 2008 9:48 AM

  • How to delete the record in the file present in the application server?

    Hi,
      I have two questions.
      i) How can I delete a record based on some condition in the recordx in the file that is present in the application server?
      ii) How can I lock the users whiel one user is accessing the file on the application server?
    Thanks in advance.
    Suvan

    Hi,
    If u want a frequent deletion this approach to delete a record from a file will havee unnecesary copy of records from one file to another and deletion of one file and renaming activities.
    Instead what u can do is Add and field del_flag to ur record structure.
    If u want to delete the record from a file just mark this del_flag as 'X'.
    While processing u can have a loop like
    loop at it_XXX where del_flag <> 'X'.
    endloop.
    This will logically delete the record.
    When u r to finish the application at that time only perform this copying / deleting / and renaing activity
    Hope this helps.
    Cheers,
    Nitin

  • FIle Creation in the Application Server With Unicode-8 and Byte-Order Mark

    Hi Guys,
    I've requirement of creating a file in the Application server with the Data.
    The Data Format Should be in UTF-8 and Byte-Order Mark.
    I need to supply this data from SAP to PRMS.
    I'm able to create a file with Unicode, but any of the guys have worked on Umicode with Byte-Order Mark, please let me know.
    Thanks,
    Adi.

    Hi Mathieu,
    If you haven't found an aswer yet, you can check in transaction SE24 CL_ABAP_FILE_UTILITIES method CREATE_UTF8_FILE_WITH_BOM. You can check the code of the method (it's very short) so you can understand how it works. It's also a static method so you can call it directly in your program.
    Ex:
    CALL METHOD cl_abap_file_utilities=>create_utf8_file_with_bom(your_file_name).
    I hope this helps.
    Pax Vobiscum.
    ~ Eric

  • Working with File Properties on the Application Server

    Hi,
    I am looking for a way to get the size of a file existing in a directory in the application server without reading it.
    Is there a function module or a static method that returns a file properties exists in the application server?
    Thanks,
    Eyal.

    hi Eyal,
    fm <b>EPS_GET_FILE_ATTRIBUTES   </b>
    regards Andreas

  • Copying dependent files, Where is the application server icon?!?

    I have looked at the Dreamweaver help sites and I cannot figure out where the application server icon is! I am currently running CS3 on a mac thats running OSX 10.4, and I'm trying to upload my site from a different computer than I originally had the files. First I expand my files window in the window>files menu. But then I have no idea where the 'application server icon' is which is supposed to re-link all my dependent files I think? Please, anyone can you give me the co-ordinates of this icon?? I will love you forever!
    -Thanks,
    Dylan
    feel free to contact me at [email protected]!

    Sounds to me like they are talking about the Connect to Server Icon,

  • To upload excel file directly to the application server using OLE concept

    hi experts
    i have done a coding in OLE to download excel with graph to presentation server, is it possible to upload excel with graph directly to the application server  , the excel should have graph while downloading to presentation server fom app server.
    Moderator message - duplicate post locked
    Edited by: Rob Burbank on Jun 25, 2009 9:49 AM

    HI,
    have a look at tcode cg3z and then FM 'C13Z_FILE_UPLOAD_ASCII'.
    What you can do is, first create the file on presentation server using OLE automation, and then using this FM, write the file to Application server

  • What need to be done for CDC when transfer the application server to new?

    we have a BO DI server in window, an application server JDE, and data mart in sql server for universe data. We set up the triggle based CDC in DI. Therefore, we extract change data from application database (oracle) to CDC table, then tranform the data to the sql  server database to feed the universe data. We are moving our application server (JDE) to a new server, new hardware...etc. We need to certify the CDC in the new server database, but not sure what need to be done in the CDC part. The data has to do a full refresh then we need to turn on our CDC to the new server, where we change the configeration? Does anyone has such experience before?

    sb92075 wrote:
    Sunil F. wrote:
    you need to change the location in /etc/oratab as well./etc/oratab file is NOT required to start or run Oracle RDBMSbut if you don't change it, then when the server is restarted you are reasonably likely to have the database running with the wrong binaries.
    I'd also add that you should review and update any ORACLE_HOMEs located in your network configuration (wherever you host service resolution for oracle services). Specifically listener.ora and tnsnames.ora on the server, plus client connectivity as well.
    Niall Litchfield
    Oracle DBA
    http://www.orawin.info/

  • How to give the application server file path in the module pool programming

    Hi,
         Could somebody help me how to provide the application server file path in module pool programming once the logo is uploaded to sap system.
      For eg I have imported a logo name ‘owens’ into sap system by using transaction ‘se78’; now I need to call the path in the below url,
    if container2 is initial.
    CREATE OBJECT CONTAINER2
      EXPORTING
        CONTAINER_NAME              = 'PICTURE_CONTAINER2'.
    CREATE OBJECT PICTURE2
      EXPORTING
        PARENT = CONTAINER2.
    CALL METHOD PICTURE2->SET_DISPLAY_MODE
      EXPORTING
        DISPLAY_MODE = CL_GUI_PICTURE=>display_mode_fit_center
      EXCEPTIONS
        ERROR        = 1.
    CALL METHOD PICTURE2->LOAD_PICTURE_FROM_URL
      EXPORTING
        URL    = " ? "
      EXCEPTIONS
        ERROR  = 1
        Others = 2.
    endif.
    Thanks in advance
    Deepu

    hi Deepu,
    Use FM '/SAPDMC/LSM_F4_FRONTEND_FILE' for fetching the data from the application server path/presentation server path
    Regards,
    Santosh

  • Function Module to find the Path of the file in the Application Server

    Hi All,
            Any function module available to find the path of the file stored in the application server. Please let me know.
    Thanks.

    Check this code:
      DATA: dl_file TYPE ibipparms-path.    " File name
      CONSTANTS: c_dir       TYPE  rlgrap-filename.
    * F4 filename for Application server
        CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
          EXPORTING
            directory        = c_dir
            filemask         = ' '
          IMPORTING
            serverfile       = dl_file
          EXCEPTIONS
            canceled_by_user = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Error while getting the file name'(006).
          EXIT.
        ELSE.
          p_file =  dl_file.
        ENDIF.
    Thanks & Regards,
    Siri.
    Message was edited by:
            Srilatha T

Maybe you are looking for