Validation and F4 help on an application server file path parameter

Hi
I have a field on a selection screen called File Path and it is for a download program where the user needs to specify the path for the download (NOT THE ACTUAL FILENAME).
I am trying to find a function or method that allows a user to use F4 help to browse for a directory rather than a specific file. There are lots of posts out there asking this question but all of the answers point to functions that allow you to browse for a particular file rather than just the file path/directory.
Does anyone know of a function that provides F4 help to browse for a file path on the Server (NOT PC). I would want the user to just be able to select the directory or path and have the path returned. They should not need to pick a specific file.
F4_DXFILENAME_TOPRECURSION is a very good function but unfortunately it makes the user pick a file rather than just a directory.
In addition to this, does anyone know of a function or method that allows you to then validate the path\directory that is entered?
Thanks for your help
Nicole

Hi,
  You can try with the FM 'EPS_GET_DIRECTORY_LISTING'. With this Fm module you will get you the list of files of a particular path in an internal table. Then you can populate this internal table in F4 help.
Hope this solves your problem. If any difficulty, come back to me about that.
Below are some other FM related to application server directory. Hope these Helps.
EPS_GET_DIRECTORY_LISTING
EPS_GET_DIRECTORY_PATH
EPS_GET_FILE_ATTRIBUTES
EPS_GET_FTP_SYSTEM_INFO
Regards,
Shailesh Jadhav

Similar Messages

  • Application server file path vaidation

    I have written the code for application server file path validation.
      DATA : l_fname TYPE filename-fileintern." type c.
      DATA : l_filpath TYPE filename-fileintern,
             l_filname(40) TYPE c.
    PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
    AT SELECTION-SCREEN ON p_sucfil.
    l_fname = p_sucfil.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        logical_filename              = l_fname
       OPERATING_SYSTEM              = SY-OPSYS
      PARAMETER_1                   = ' '
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
       WITH_FILE_EXTENSION           = 'X'
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
    IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
       FILE_NAME                     = l_filpath
    EXCEPTIONS
       FILE_NOT_FOUND                = 1
       OTHERS                        = 2
    IF sy-subrc <> 0.
      message 'Invalid file name' type 'E'.
    ENDIF.
    But always i will get Invalid file name.
    Y is it so.
    pls help me.

    Praveen,
    I have checked ur code and I found that if i give a logical file name from
    tran. FILE under folder 'Logical file name definition, cross client' then ur code works. Pl. check.
    Regards,
    Joy.
    DATA : l_fname TYPE filename-fileintern." type c.
    DATA : l_filpath TYPE filename-fileintern,
    l_filname(40) TYPE c.
    PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
    AT SELECTION-SCREEN ON p_sucfil.
      l_fname = p_sucfil.
      CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      logical_filename = l_fname
    operating_system = sy-opsys
      with_file_extension = 'X'
      IMPORTING
      file_name = l_filpath
      EXCEPTIONS
      file_not_found = 1
      OTHERS = 2
      IF sy-subrc <> 0.
        MESSAGE 'Invalid file name' TYPE 'E'.
      ENDIF.

  • Regarding Application server file path browsing

    Hi All,
    I have a issue regarding Application Server File Path browsing.
    Actually in my selection-screen i will declare a parameter as <b>Application Server File Path</b> now when i press F4 in that field it should be able to browse through <b>Application Server Path's</b>.
    Just like <b>F4_FILENAME</b> in the case of <b>Presentation Server File Path</b> Browsing.
    Can anybody solve my issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi Shaik,
    Just copy and paste:
    Here is the code for retrieving list of files contained within specific Application server directory(SAP).
    PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
    include structure salfldir.
    data: end of it_filedir.
    START-OF-SELECTION.
    Get Current Directory Listing for OUT Dir
    call function 'RZL_READ_DIR_LOCAL'
    exporting
    name = p_fdir
    tables
    file_tbl = it_filedir.
    List of files are contained within table it_filedir
    loop at it_filedir.
    write: / it_filedir-NAME.
    endloop.
    Hope this will help you.
    Let me know incase of any concerns.
    EDIT:
    There are few FM for ur refernce :
    RZL_READ_DIR_LOCAL
    SUBST_GET_FILE_LIST Return table with file list for the given directory (pattern allowed)
    F4_DXFILENAME_TOPRECURSION Popup to select one file from the given application server directory
    TH_SERVER_LIST Returns list of application servers.
    EPS_GET_DIRECTORY_LISTING – Lists filenames from the application server .
    Cheers
    Sunny
    Rewrd points, if found helpful
    Message was edited by: Sunny

  • 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

  • Regarding Application server file path

    Hi All,
    please explain the process how to create logical file path in FILE t-code.

    Hi,
    logical file path
    The (platform-independent) logical file path is evaluated at runtime to get the (platform-dependent) physical path (see Assignment of Physical Paths to Logical Path).
    Two examples of this are:
    · Logical file path: BW_OLAP_CACHE
    Name: BW OLAP Cache
    · Logical file path: BW_OLAP_CACHE_SPAN
    Name: BW OLAP cache cross-application server
    Assignment of Physical Paths to Logical Path
    At runtime, the physical path assigned for the corresponding operating system platform is generated from the logical file path.
    Since the physical path is platform-dependent, the customer must set it her/himself. The closer the file is to the application server or, with the cross-application server cache mode, to the application server, the faster it can be found and read.
    Log(ical) path: BW_OLAP_CACHE
    Name: BW OLAP Cache
    Syntax group: UNIX (all Unix platforms)
    Phys(ical) path: /usr/ (Syntax group WINDOWS NT)
    In a heterogeneous system landscape (such as UNIX and Windows NT servers) all system-specific syntax groups must be maintained. Ensure that the definitions for the various syntax groups point to the same directory.
    5. Save your entries
    for detailed information
    Have a look at this links... i guess it explains what you are looking for...
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/3e4ec2462a11d189000000e8323d3a/content.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/25/ab3a57df3b11d189fc0000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_sm40/helpdata/EN/8d/3e4ec2462a11d189000000e8323d3a/frameset.htm
    Regards,
    Raj.

  • Application server file path name separated by apace

    Hi All,
    I am writing files on application server. Below is my fie path.
    parameters: p_o_file  like rlgrap-filename default   '/xxx/tmp/app/outbound/1~lcxxxx~ACTUAL~periodfyyear~RR.txt'.
    data : mnthyear(12) type c,
             year(6) type c.
    case p_rpmax.
    when '010'.
    p_ryear = p_ryear - 1.
    concatenate 'FY' p_ryear into year.
    concatenate 'OCT' '-' year into mnthyear separated by space.
    replace 'periodfyyear' with mnthyear into p_o_file.
    In the report output I am getting the file name correctly.
    Output File: /dev/tmp/app/outbound/1~LC1000~ACTUAL~OCT - FY2013~RR.txt
    When checked in AL11, it is showing me the below file name
    1~LC1000~ACTUAL~OCT
    my file name is truncated after space.
    Can we create a file name with spaces? Awaiting your replies.
    Thanks,
    Haritha

    Pl find snipet..
    FORM save_file.
       DATA: lv_data TYPE string.
    *Move complete path to filename
       gv_file = '1~LC1000~ACTUAL~OCT - FY2013~RR.txt'.
    * Open the file in output mode
       OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
       IF sy-subrc NE 0.
         MESSAGE 'Unable to create file' TYPE 'I'.
         EXIT.
       ENDIF.
       LOOP AT gt_spfli INTO gwa_spfli.
         CONCATENATE gwa_spfli-carrid
                     gwa_spfli-connid
                     gwa_spfli-countryfr
                     gwa_spfli-cityfrom
                     gwa_spfli-airpfrom
                     gwa_spfli-countryto
                     gwa_spfli-cityto
                     gwa_spfli-airpto
                     gwa_spfli-arrtime
          INTO lv_data
          SEPARATED BY ','.
    *TRANSFER moves the above fields from workarea to file  with comma
    *delimited format
         TRANSFER lv_data TO gv_file.
         CLEAR: gwa_spfli.
       ENDLOOP.
    * close the file
       CLOSE DATASET gv_file.
    ENDFORM.

  • Equalent of F4_filename function module for application server file path

    hi experts,
            i am using  cl_gui_frontend_services=>file_open_dialog
           for bring file path dynamically for user, in front end.
          same feature i want to give when i am trying upload file from application server.
      kindly provide me function module or class method, which will do it.
    thanks in advance
    regards,
    pavan

    Hi,
    Use FM F4_DXFILENAME_TOPRECURSION
    Sample code here
    report ztest.
    data : filename like DXFIELDS-LONGPATH.
    data : begin of itab occurs 0,
    a(200) type c,
    end of itab.
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
    EXPORTING
    I_LOCATION_FLAG = 'A'
    *I_SERVER = '?'
    *I_PATH =
    FILEMASK = '.*'
    *FILEOPERATION = 'R'
    IMPORTING
    *O_LOCATION_FLAG =
    *O_SERVER =
    O_PATH = filename
    *ABEND_FLAG =
    EXCEPTIONS
    RFC_ERROR = 1
    ERROR_WITH_GUI = 2
    OTHERS = 3
    break-point.
    open dataset filename for input in binary mode.
    while sy-subrc = 0.
    clear itab .
    read dataset filename into itab.
    append itab.
    endwhile.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    FILENAME = 'd:\abc.txt'
    FILETYPE = 'BIN'
    TABLES
    DATA_TAB = itab
    Regards,
    Satish

  • APPLICATION SERVER FILE PATH

    Friends to surf the flat file
      function module
    what we use is
    'KDGET_FILENAME_ON_F4'_
    like this what is the fuction module for application server?????

    Try:
    F4_DXFILENAME_TOPRECURSION
    PARAMETERS: f_app(128).
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
    PERFORM get_fname_app.
    FORM get_fname_app.
    DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',
    search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
    file_path LIKE dxfields-longpath.
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
    EXPORTING
    i_location_flag = 'A'
    i_server = ' '
    i_path = search_dir
    filemask = c_fnh_mask
    fileoperation = 'R'
    IMPORTING
    o_path = file_path
    EXCEPTIONS
    rfc_error = 1
    OTHERS = 2.
    IF sy-subrc EQ 0.
    f_app = file_path.
    ENDIF.
    ENDFORM. "get_fname_app[/code]
    OR
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_apath.
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    IMPORTING
    serverfile = p_apath
    EXCEPTIONS
    canceled_by_user = 1
    OTHERS = 2.

  • Validate  application server file

    Hi,
      I have to validate the application server file path on selection screen.
    I am using following code :
    form VALID_APP_FILEPATH   using    p_filpath TYPE FILENAME-FILEINTERN.
      data : l_fname(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = p_filpath
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC ne 0.
          MESSAGE 'Enter the valid file path'(e01) TYPE 'E'.
      ENDIF.
    endform.                    " VALID_APP_FILEPATH
    but if i choose correct file path from F4 help also.
    It displays error message.
    Sy-subrc always equals 1.
    Help me out

    Hi,
    I have implemented the code mentioned by you and am not having any problems even when I use F4 to get the fle name.
    Pls recheck and get back if the error persists.
    Reward if found helpful.
    Warm Regards,
    R Adarsh

  • Smartform into PDF and store in folder of  application server

    Hi Gurus,
         I have to solve this issue please help meu2026
    1.Convert Smartform into PDF and store in folder of  application server
    2.print the PDF stored in folder(Application Server) automatically
    Please give suggestion for the above..
    Moderator message: "spec dumping", please work yourself first on your requirement.
    Edited by: Thomas Zloch on Oct 7, 2011 10:39 AM

    hi uma,
    http://www.kodyaz.com/articles/sap-smartforms-download-as-smartform-pdf-using-ws_download-and-cl_gui_frontend_services.aspx
    check this out...
    thanks,
    ram

  • Application Server file Validity

    Hi Experts,
    I have one query. I wanted to check the validity of file in application server. The scenerio is like in my selection screen I will provide application server file name.
    I wanted to validate whether that file is existing or not. If file is not existing then I need to display an error message.
    Can anybody will suggest me how I can achieve this requirement?
    Thanks,
    Neha

    Hi Neha,
    To access the files on Application server we use DATASET operationsd like open, read, close etc.
    Now in your case use opendataset as:
      open dataset   ds_name for output in text mode encoding default.
      IF sy-subrc NE 0.
         //write your message here.
      ENDIF.
      CLOSE DATASET ds_name.
    Where ds_name = logical path name of your file, or if you want to check for just one file, hard code the path.
    Better practice is to use logical path name.
    Also declare ds_name as
    DATA: ds_name          LIKE rfpdo-rfbifile.   
    Close dataset is used in case file exists you need to close it.
    Revert back if you wantto know abt logical file name.
    Regards,
    Sana.

  • Issue with the Maximum lenght string on application server file

    Hi,
    I have one internal table which cotains aroung 200 fields. The total lenght of the all fields is around 2000 charr.
    I am using open data, transfer and close data set to put my file on application server.
    I am looping at my internal table and then transfering the data on server file.
    The problem is that after generating the file on application server i couldnt see all the fields. i can see only around 500 char.
    not all the data.
    Does there is maximum limit on the number of char on application serevr.
    or there is complete record but we cant see,
    kindly help.

    Hi Sachin,
    As Rainer said you cannot see the full length of row in AL11. The visible length is restricted. If you want to re-confirm whether all data are in. Then download the file from application server to your local system and see the contents. It will be to 2000 characters which you passed.
    Hope this helps.

  • Application Server : File writes only 255 characters

    Hi Friends,
    I am trying to writes data to application server file .
    My line size is 1100 charqacters.
    When I use open dataset for output in text mode encoding default
    and transfer contents to file.
    I am only able to write contents upto 255 characters.
    Whatever is beyond that I do not see it in AL11.
    Is there a way to write more than 255 characters.
    I tried CG3Y to view files but it also shows only 255 characters.
    Please help.

    Hi,
    Just find the string length.
    In 4.6C version there is a limit of 1500 characters i. e. U can transfer max of 1500 characters in a single transfer. For that we applied below solution. Check this it may help u.
      l_len = strlen( p_data ).
      DO.
        IF l_len LT 1500.
          TRANSFER p_data+l_offset(l_len) TO p_file.
          MOVE 0 TO l_len.
        ELSE.
          TRANSFER p_data+l_offset(1500) TO p_file.
          SUBTRACT 1500 FROM l_len.
          ADD 1500 TO l_offset.
        ENDIF.
        CHECK l_len EQ 0.
        EXIT.
      ENDDO.
    p_data has the content to be trasfered of around 6000 characters and the length is dynamic.
    Also download the data using CG3Y with BIN to .txt file and see.
    If problem is still there then paste ur code of OPEN DATASET, TRANSFER statements.
    Try to open the file in TEXT MODE.
    eg: OPEN DATASET l_file IN TEXT MODE.
    Thanks,
    Vinod.
    Edited by: Vinod Reddy Vemuru on Jul 25, 2008 12:34 PM

  • New Line in application server  file

    Hi
    I am facing rather a unique problem. I have a report that generates a file and posts it on the application server. When i open the file at the application server it shows me line split ( I mean a new line is introduced in the middle of a row).
    On further investigation I observed that the field after which it split contains a # symbol. Now many files posted on the server contains # but this problem is not observed in any of those files.
    I tried replicating this on quality and dev by adding # at run time in debug mode but the file posted is perfectly fine. I figure it must be some other symbol entirely that we can view as #.
    Please share your thoughts on this.
    Preethi
    Edited by: Preethi B on Feb 8, 2010 2:02 PM

    Hi,
    Am facing similar issue in production environment.
    But in quality am not getting this issue.In debug mode I copied the same line as in the production and its printing as expected (data getting displayed on a single line).
    Can anyone please help me with this??
    Thanks in advance!
    Regards,
    Shaheen.

  • Error  while accessing the application server file

    Hello,
    When I try to load the data from CSV file to PSA , I am getting following error message
    "Error  while accessing the application server file"
    "Errors in source system"
    I gave the right file path
    I am not sure about this error message.
    Thanks,

    Hi ram,
    if you have more than one application server running in your BI system (see at transaction SM51) be aware that your infopackage will be executed on the right one. Each application server has its own file system and your job need to run on the server your file is stored on.
    Also check if the os user of the SAP system itself (<sid>adm on Unix) has rights to read that file.
    Bye
    Frank

Maybe you are looking for

  • Unit of Measure in material master

    Hi I have a Raw material consider (Forging) for which material master is maintained  "PC"  as Base unit of Measure. I have defined in Additional Unit of Measure as 500 KG = 1 PC. Also my order unit is also maintained as PC. Here when they procure cas

  • TABLE FOR TAX  CODE and amount break up when PO created

    Hi,     Could you please tell us the table which stores the amount break up for a condiion type based on tax code when a Purchase Order is created. Like : When the amount (kwert) for a condition type(kschl) is 100. Based on tax code(mwskz) and condti

  • PL/SQL Javascript Function Call

    Can anyone offer some help on this? I am attempting to get a javascript tool tip to work on an application I am developing. I have developed a line calendar using PL/SQL outputting HTML. When I embed a javascript function into my PL/SQL htp.p functio

  • ITunes error message at startup

    Hi! (I've got a 17" pb and 1 gb ram in it, the hard disk isn't nearly full..) ok, when I start iTunes (which worked perfectly earlier today) I get this message: "The iTunes application could not be opened. There is not enough memory available." it ha

  • Help for reading a numeric file

    Hi to all of you, I am new to programming . I have to read a numerical matrix stored in a file . The matrix is made of integer numbers and its dimension is 100*4. I would like to know which is the best metod to read integers from a file and which set