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

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.

  • 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

  • Need utilities class for application server file system (i.e. unix etc)

    I need to do things to directories and files on the application server.
    Is there an SAP class with methods for the application server file system (i.e. unix or whatever) with functionality similiar to what is provided by the methods of CL_GUI_FRONTEND_SERVICES for the presentation server?
    Is there a group of SAP functions for this task?

    You may have a look at Thomas Jung article: [sdn contribution : ABAP Server Side File Access, by Thomas Jung|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/7a13f367-0401-0010-47ba-eab0b15cf31c]
    Moreover, in release 7.10, it could be possible that SAP introduced input and output stream classes (to mimic java classes), so I guess there could be the ones for application server file system.

  • Function module for transfering a file contents into another?

    Hi all,
       Is there a Function module for transfering a file contents into another?That is the whole content from a file to other??
    Regards,
    Shashank.

    Hi,
    I think there is no such FM. You need to read the data in internal table and then write it in another file.
    Regards,
    Atish

  • 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

  • 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.

  • Function Module for putting Flat File into Application Server

    Hi Pals,
         what is the   Function module for putting my flatfile into application server..
    because i dont have  authorizations to  put my flatfile  into application server directly..
    I know one function mudule is there for that ...so,  can you suggest me.. what is the function module... for that..
    thanks.. and points will be assigned..
    chitti

    Hi,
    well normally you use the method GUI_UPLOAD of class CL_GUI_FRONTEND_SERVICES to upload a file from your client pc. Then you use the abap statements open dataset, transfer and close dataset to put the file to the app-server.
    kind regards
    Siggi

  • Function Modules for uploading the file

    Hi experts ,
                      I have a requirement to download a file (csv) from my local sytem (say desktop) into an internal table first and then update the contents of the same internal table into the database table.
    Can anybody provide me with a sample program for doing the same or at least the name of function modules for the same.
    Prompt replies will be rewarded.
    TIA
    Abhishek

    Hi Abhishek,
    How to use INSERT Statement..
    Check this Sample Program..
    TABLES:MARA.
    DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    ITAB-MATNR = '123ABCDA'. .
    ITAB-MBRSH = 'C'.
    ITAB-MTART = 'FERT' .
    ITAB-MEINS = 'KG' .
    APPEND ITAB.
    ITAB-MATNR = '123ABCDB'. .
    ITAB-MBRSH = 'C'.
    ITAB-MTART = 'FERT' .
    ITAB-MEINS = 'KG' .
    APPEND ITAB.
    LOOP AT ITAB.
    INSERT MARA FROM ITAB.
    MODIFY MARA .
    ENDLOOP.

  • Function modules calling Application server

    I am working on a SAP Migration for windows to unix. Right now I am patching up all custom programs which call the Application server using physical filenames and paths (platform specific) and replacing them with logical paths and names (platform independent). I need help from you guys to identify more function modules which uses file names that are platform specific. I have taken care of open dataset and FTP commands. Any help pointing out function modules is highly appreciated. Points will be rewarded. Thanks in advance.
    Rohit

    Hi ,
    Check the following function groups for file related operations.
    GRAP - Frontend related.
    SVRZ -  System related.
    SFTP   - FTP related.
    SFIL  - Logical file name related.
    As per my understanding, we are not using any function modules to read data from application server.
    Best of luck.
    Thanks
    Viswa
    (Assign points for helpful answers)

  • Function Module for Application Log(SLG1)

    HI SapAll.
    may i know what is the Function Module  to read the data for Applicaiton Log (tcode-SLG1).
    waiitng for your response.
    regards.
    Varma

    Hi Danish.
    running the program 'SBAL_DISPLAY' is similar to running the FM'APPL_LOG_DISPLAY' .However when i run any one of these i have to manually press the 'Execute button' to display the log(there is no option to save the log into spool or to get into some Internal table)
    i have tried running the program 'SBAL_DISPLAY'  by putting the Break point at the line (  CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
          EXPORTING
            i_t_log_handle      = l_t_log_handle)
    ,while debugging the values are as below:
    L_T_LOG_HANDLE : Sorted Table[1x1(44)]
    1      ZoDNJw4vg3BX0000h1GOdm.
    could you please help me in getting the log into spool wihtout having to press the execute button and without having to look at the Log.
    regards.
    Varma

  • Function module to get the file path in the system for TEMP folder

    Hi All,
    Is there any function module that I can use to get the file path in the system for TEMP folder.
    I mean, i am supposed to give only TEMP as the input for that function module and I need to get the path of that in the system as the output.
    I am unsing 4.0 version.
    Please advice.
    Regards
    Ramesh

    In Higher versions, we can use the below code:
    call method CL_GUI_FRONTEND_SERVICES=>ENVIRONMENT_GET_VARIABLE
        exporting
          VARIABLE   = 'TEMP'
        importing
          VALUE      = LV_TMP
        exceptions
          CNTL_ERROR = 1
          others     = 2.
      if SY-SUBRC <> 0.
        message id SY-MSGID type SY-MSGTY number SY-MSGNO
        with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      call method CL_GUI_CFW=>FLUSH
        exceptions
          CNTL_SYSTEM_ERROR = 1
          CNTL_ERROR        = 2
          others            = 3.
      if SY-SUBRC <> 0.
    Error handling
      endif.
      concatenate lv_tmp '\' into folder_path.
    But need to know in the lower versions like 3.1h and 4.0,

  • File path for application server file

    Hi All,
                 I have a file 'abc.doc' stored on the application sever.
                I want to crate a document using the BAPI_DOCUMENT_CREATE and store this file
                What is the file path that I need to pass into the bapi.
    Please help
    Warm Regards
    Sunil Kumar.

    Hello Sunil
    You are right. That's the file path you should specify. It looks like your application server is running on UNIX platform. You can use transaction AL11 to locate your file and specify the file path in normal unix format. If this doesnt work, you can try prefixing your file path with "file:// ".
    Cheers
    Anand

  • 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

  • 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.

Maybe you are looking for

  • DTP Questions: Delete overlapping requests;  Repair Full Request

    Hello, I'm new with the DTP concept in BI 7.0. It is clear to me how DTP is working for normal loads like: full, delta, delta without data transfer etc. But I don't see where I can specifies "Delete overlapping requests". Is this still possible in a

  • Problem clearing a move request

    Hi, I've got a simple Exchange 2010 setup running along a 2007 insallations. I have 2 DC's both running 2008 but not R2. My issue is, I have moved a couple of users using the local move request. One of them I delete the move request as soon as it had

  • Can I batch a repetitive change size & resolution process?

    I have 300 pix that all need to be shrunk in size and resolution to a fixed size and resolution.  Rather than one-at-a-time, can this process be "batched" to eliminate some number of key strokes??????

  • XML Document initialization.

    Hi, I need to parse an XML document that I read Externally. Presently for testing I need to simulate this by hardcoding the xml from Web Dynpro : eg: Document xmlSimulate = <?xml version="1.0" encoding="iso-8859-1" ?> - <DecisionTree> +<Header> +<Bod

  • Upgrading To Enterprise XI (Business Views)

    We are in the planning process for an upgrade from Crystal Enterprise Version 10 to Business Objects Enterprise.  I have read the release notes and installation guides for the products we are planning to buy.  However, I have a question regarding Bus