File saving in presentation server

*If user selects "Presentation Server"
      CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
        EXPORTING
          i_location_flag = lc_loc_flag_p
          i_path          = lv_filepath
          fileoperation   = lc_fileoperation
        IMPORTING
          o_path          = lv_filepath.
I am using the code above to download my file to presentation server. my requirement is to prompt an default name IN THE SELECT FILE dialog box. but Iin this FM i am not getting the option to give this. kindly syggest how i can do that.

Hi,
Try this..
PARAMETERS: p_erdat TYPE erdat DEFAULT sy-datum.        ,
  parameters: p_opfn  type rlgrap-filename modif id app default '/usr/sap/tmp'.
This is for F4
  call function '/SAPDMC/LSM_F4_SERVER_FILE'
    exporting
      filemask         = 'X'
    importing
      serverfile       = lv_fname
    exceptions
      canceled_by_user = 0
      others           = 0.
Regards
Ansari

Similar Messages

  • How to delete a local file in the presentation server.

    Hi All,
    How to delete a local file in the presentation server. As we do using 'delete dataset dsn' in application server. How can i achieve this. My requirement is after uploading file using gui_upload, i want to delete that source file. Please let me know, how can i achieve this.
    Thanks in advance.
    Regards,
    Vishal

    data: l_rc type i.
      data: f_name type string.
        move 'c:\YourFile.txt' to f_name.
        CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
          EXPORTING
            FILENAME             = f_name
          CHANGING
            RC                   = l_rc
         EXCEPTIONS
           FILE_DELETE_FAILED   = 1
           CNTL_ERROR           = 2
           ERROR_NO_GUI         = 3
           FILE_NOT_FOUND       = 4
           ACCESS_DENIED        = 5
           UNKNOWN_ERROR        = 6
           NOT_SUPPORTED_BY_GUI = 7
           WRONG_PARAMETER      = 8
           others               = 9
        IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.

  • How to validate a Particular Directory or file path in Presentation server.

    Hi SAP gurus,
    I am having a requirement where I want to download a file into the Presentation server.
    The file path to download will be provided in a parameter.
    What I want to do is to throw a message to the user if He/She provides a wrong Directory or File path.
    For example :
    Say the user is providing the file download path as " E:\test.txt", but there is no "E" drive or such directory in the presentation. So in this case I should be able to check the wrong Directory provided by the user and throw some message to the user saying there is no such Directory present. Please give a proper directory or similar messages.
    I have found a FM: PFL_CHECK_DIRECTORY but i am not able to use it properly.
    So do you have any FM or any method and its explanation to fulfill my requirement .

    Do it this way:
    tables:
      spfli.
    parameters:
      p_file type rlgrap-filename          " File name
                       obligatory.
    Data:
      t_final_data like table of spfli.
    at selection-screen on value-request for p_file.
    call function 'F4_FILENAME'
       exporting
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
         field_name          = ' '
       importing
         file_name           = p_file.
    at selection-screen.
      data:
        lw_file  type string.              " File Path
      lw_file = p_file.
    select * from spfli into table t_final_data.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         filename                        = lw_file
       tables
         data_tab                        = t_final_data.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      if sy-subrc <> 0.
        message 'File not found' type 'E'.
      endif.
    With luck,
    Pritam.

  • Why can I not open files saved on a server?

    Why can I not open files saved on a server?

    I think I figured it out.  I set the compatibility mode to Windows Server 2008 (which is the OS on the server we are using) and it opened just fine.  Whoop Whoop.  Thanks for your help.
    Lisa

  • "Bad data format" when reading txt file from the presentation server

    Hello,
    I have a piece of code which reads a txt file from the presentation server to an internal table like below:
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME              = lv_filename
    CHANGING
       DATA_TAB            = lt_tsd. " lt_tab has the exact same fields as the Test.txt's. Test.txt has only one line, tab delimited.
    When running this code, exception BAD_DATA_FORMAT is issued.
    Is it because of the file encoding or delimiter or other reason?
    Thanks,
    Yang

    Hello,
    If its tab delimited then use the has_field_seperator parameter and check
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = lv_filename
       FILETYPE                 = 'ASC'
       HAS_FIELD_SEPARATOR          = u2018Xu2019
    CHANGING
       DATA_TAB            = lt_tsd.
    Vikranth

  • Reading file from the presentation server in the background

    Hi,
    I am trying to read a .csv file from the presentation server into an internal table in the background. what should I do for it? In the foreground it works fine.
    I have declared a selection parameter 'p_file' that has the path of the file. It wokrs fine in the foreground and how to set it up in the background?
    Any thoughts would be helpful. Thanks in advance,
    VG

    hii
    did you achieved the required functionality , i,e, accessing presentation server file i nbackground .
    I too got the same requirement, can you explain the process.
    There is no way you can do it... The best method is to put the file on Appln server and then call it in the background mode.
    Regards,
    Vishwa.

  • Open Excel with out saving on presentation server

    Hi All
       I have requirement like when I execute the report, result should open in Excel sheet automatically with out saving on Presentation server.
       Please help me. Thanks in advance.
    Regards
    Rama

    HI Arun
        Thanks for your help, but It is opening blank Excel sheet, Internal table data not loading. I am copying the FM how I used in report. Please help me if any thing worng.
    CALL FUNCTION 'FTBU_START_EXCEL'
      EXPORTING
       CHECK_VERSION             = ' '
       DATA_NAME                 = ' '
        DATA_PATH_FLAG            = 'W'
        DATA_TYPE                 = 'ASC'
       DATA_BIN_FILE_SIZE        =
       MACRO_NAME                = ' '
       MACRO_PATH_FLAG           = ' '
        FORCE_START               = 'X'
       WAIT                      = 'X'
    IMPORTING
       WINID                     =
      TABLES
        DATA_TAB                  = it_output
      EXCEPTIONS
        NO_BATCH                  = 1
        EXCEL_NOT_INSTALLED       = 2
        WRONG_VERSION             = 3
        INTERNAL_ERROR            = 4
        INVALID_TYPE              = 5
        CANCELLED                 = 6
        DOWNLOAD_ERROR            = 7
        OTHERS                    = 8.

  • File download to presentation server in BACKGROUND

    Hello,
    i'm trying to download a simple list to the presentation server, but in a background process (part of an update rule for an infopackage). I´ve tried WS_Download and CALL METHOD o->gui_download etc but the job cancels with them since they seem only to run in frontend. Does anyone know of a more suitable function module?
    Thanks,
    Kev

    Hi,
    Tyr to download file to unix in background.
    PARAMETERS:    p_unix     LIKE rlgrap-filename.
    INITIALIZATION.
      v_uzeit  = sy-uzeit.
      v_date   = sy-datum.
      v_client = sy-mandt.
      v_sys    = sy-sysid.
      CONCATENATE c_str v_sys c_str4 v_client
                  c_str3 v_date c_str5 v_uzeit c_str6 INTO p_unix.
       DATA: v_fnam        LIKE rlgrap-filename,
          v_filepht     LIKE FILENAME-FILEINTERN, "File for p_unix
          v_sys         LIKE sy-sysid,
          v_client      LIKE sy-mandt,
          v_date        LIKE sy-datum,
          v_uzeit       LIKE sy-uzeit
    FORM f3000_save_unix_file.
      SORT i_output.
    * Open the file in application server
      OPEN DATASET p_unix FOR OUTPUT IN TEXT MODE.
      IF sy-subrc <> 0.
        MESSAGE s900 WITH p_unix.           " File opening error
        LEAVE LIST-PROCESSING.
      ENDIF.
      LOOP AT i_output INTO w_output.
        TRANSFER w_output TO p_unix.
        CLEAR w_output.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE:/ text-075, p_unix, text-076. " File successfully created
      ELSE.
        WRITE:/ text-074, p_unix.           " Error creating file
      ENDIF.
    * Closing the file
      CLOSE DATASET p_unix.
    ENDFORM.                    " f3000_save_unix_file
    Also refer this link
    http://www.sapdevelopment.co.uk/file/file_updown.htm
    Try this might help u.

  • How to get pdf file from sap presentation server using java connector

    Hi Friends,
    with the below code i am able to get po details in pdf in presentation server.
    DATA : w_url TYPE string
           VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
    CALL FUNCTION 'ECP_PDF_DISPLAY'
            EXPORTING
              purchase_order       = i_ponum
           IMPORTING
      PDF_BYTECOUNT        =
             pdf                  = file  " data in Xsting format
    *Converting Xstring to binary_tab
          CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
            EXPORTING
              buffer                = file
      APPEND_TO_TABLE       = ' '
    IMPORTING
      OUTPUT_LENGTH         =
            TABLES
              binary_tab            = it_bin " data in binary format
    **Downloading into PDF file
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
      BIN_FILESIZE                    =
              filename                        = w_url
              filetype                        = 'BIN'
             TABLES
              data_tab                        = it_bin
    when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
    init:
    deps-jar:
    compile-single:
    run-single:
    com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
            at PdfGen.<init>(PdfGen.java:35)
            at PdfGen.main(PdfGen.java:78)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)
    i debugged too, problem with <b>gui_download......</b>
    I am very glad to all with your suggestions!!
    Regards,
    Madhu..!!

    Hi
    You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
    How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
    Max
    Edited by: max bianchi on Oct 13, 2011 10:27 AM

  • XML file download to presentation server.

    Hi Experts,
    Here I have a question regarding file download to desktop.
    I have a report which will generate xml file. Once it is generated i would like to download to desktop.
    I tried with 'GUI_DOWNLOAD', but it is not working. It means the file is downlaoded to presentation server but when i opened it 'Page can't be displayed' message is comming.
    Could you pleas help me to solve this issue.
    Thanks in advance.
    Regards,
    Anil.G

    Hello,
    For processing XMLs always try to make use of the class CL_XML_DOCUMENT.
    You can download the XML stream to a local file using the method of EXPORT_TO_FILE class CL_XML_DOCUMENT.
    Further reading: [/people/uwe.schieferstein/blog/2010/10/17/visualizing-any-kind-of-xml-data-using-class-clxmldocument]
    BR,
    Suhas

  • How do I upload only a few lines of a file from the presentation server?

    Hi there guys,
    I'd like to upload the contents of a file on my HD (presentation server) to an internal table. I know this can be achieved by using the GUI_UPLOAD function module. But what if I only want to upload a part of the file, not the whole thing? Like the first 100 bytes or 10 lines or something like that. Some files are just way too big to upload them as a whole. I tried using the OPEN DATASET statement, but that seems to work only for files on the application server. If I try to open 'C:     emp     est.txt' (for example) with OPEN DATASET, I get an error. Do I have to put the filename differently or am I totally wrong with OPEN DATASET? I'm kinda stuck here and I'd appreciate your help.
    Cheers,
    Björn.

    Hi Shashi,
    thanks for your reply. If I understand you correctly, this means I will have to wait for GUI_UPLOAD to upload the whole file and afterwards filter into another table. I don't want to upload the whole thing because it's that big, I'd like to only upload a portion of it in the first place. Can this be done?
    Cheers,
    Björn.

  • Files saved to network server sometimes get deleted

    Hello,
    I work as a graphic designer using a year old iMac and latest version of Photoshop CS5.
    Every now and then when saving a .psd file with photoshop it will get deleted instead. As an example, lets say I'm working on a brochure cover image. I open photoshop, open the file and work couple of hours on it. Then I save it. File gets deleted and is now no where to be found. Assuming no backups it's lost for good.
    Naturally I use backups so this usually only means I've at most lost a days worth of work, but it's still highly irritating as you can get quite a bit done during one day.
    What I've figured out so far:
    1) Only .psd files get deleted and only by photoshop. Illustrator, Premiere, Indesign are unaffected.
    2) Only files that are being saved on network (Buffalo) drive get deleted. Files saved on my macs hard disk have not gone lost so far.
    3) It seems that when I use "Save As" the files save correctly. Only when using "Save" do they get deleted.
    4) File getting deleted does not happen every time. But it does happen around 20-30% of the time when saving.
    My current solution is to keep file browser open at all times. And every time I save file with Photoshop I check it's still there. If it's been deleted I will save it again with new name. As long as it's still open in Photoshop I can still save it.
    Due to my work place, saving on the Buffalo is currently the only realistic solution. I realise this is not a Photoshop only problem. It has a lot to do with the network drive as well. How ever as Photoshop is the only program affected it seemed like a good idea to post it here as well. We've been in contact with Buffalo and they deny any knowledge about this problem, so we've hit a brickwall there anyway.
    Has anyone else run into this or similar problem? Any suggestions besides taking more backups?

    2) Only files that are being saved on network (Buffalo) drive get deleted.
    There you have it – Adobe’s position with regard to Photoshop is: »Adobe Systems does not provide support for networks and removable media.«
    http://kb2.adobe.com/cps/406/kb406793.html
    http://kb2.adobe.com/cps/902/cpsid_90279.html
    In case you are interested there are threads on this, for example
    http://forums.adobe.com/message/4016082#4016082
    One workaround might be to always do Save As’ as you claim those work; this could be automated with a Script for example.

  • Run BW query from R/3, need output file saved on application server

    Hello all,
    We are currently working on BI 7.0. Is there a way where we can run a BW query from R/3 by some program or tcode? We need to run the BW query and use the output of that query as an input to some other custom program in R/3.
    If we can save the output file on application server than the R/3 program will pick up that file from there.
    Is there any standard delivered functionality that will allow us to do that or how can we achieve this.
    Can some help help with some suggestions or links?
    Thanks in advance.

    Hi,
       Refer the following threads:
    [Calling BW Query from R/3;
    [Saving Bex Report / query in BW App server;
    Regards.

  • LSMW file upload from presentation server

    Hi,
    We are using LSMW to create new Document info records and will need to upload/ attach multiple files to the DIR.
    everything is working except in the IDOC processing stage, it errors out -
    "Error while checking in and storing:
    otlta134a\pcm\test1.txt"
    Its is unable to upload file from network drive, it works successfully when the same file is uploaded from application server.
    I have worked in other LSMW projects and have successfully loaded files from network drive.
    Please let me know what configuration setup is required, is it the content server or the gateway server?
    Thanks for all your help.

    Sheetal,
    I think this is the problem due to the authorization....
    try to open the file from AL11........... if u r still getting the problem better to contact the basis guys...
    If it is the problem with the authorization... once u get this error open another session with SU53 tcode.. take the authorization object and give it to basis guys to allow the permissions to u...

  • Upload to file in the presentation server

    Hi Guyz,
    I got a report, which would download output into a .txt file using function module "download", but one field is not getting downloaded into that.
    how to check that? plz let me know..
    thanks a lot..
    venu.

    I guess its the last field in your structure you didn´t get. Right ? Then maybe you exceeded a hardcoded length of about 1000 or 1200 bytes in the FM.
    Hope that helps.

Maybe you are looking for

  • Disk Utility unable to repair disk

    My IMAC started to freeze up for a couple of minutes while running Word for Mac 2004 and Entourage. Microsoft tech support suggested running rebuild database for Entourage. Rebuild database did not execute citing I/O problem. Ran Disk Utility from In

  • New Patch Available for OATS 12.1

    Hi All, There is a new patch available on metalink for 12.1 which fixes a whole bunch of issues (especially with OTM). The filename is p14159195_12101_WINNT. Regards Wayne.

  • Sparks when plugging in ... :/

    Hallo, I have had my Mac since January and since the first days every time I plug it in (either direct on the wall plug or in a extention cord) it sparkles! We thought it was the building (because it is an old building) and maybe that was the reason.

  • CS4 missing features and functions

    Help please, I cannot get my work done! I have just upgraded from Design Premium CS3 to CS4. InDesign is the only program I am having issues with. I can no longer Alt-drag to duplicate an object. Using Edit-Duplicate puts the new object off the paste

  • Payload visibility

    Hi ,   I am on a Idoc>XI>HTTP sceanrio. I want to see my payload after it goes through the HTTP adapter. I can see a part of it if there is a failure but if its a success I can just see the manifest not the payload which went from the HTTP adapter. I