Urgent : Download file from Application Server via Process Chain.

Hi Experts,
My requirement is to download the file from Application Server to local work station using an ABAP Program .
I want including the above ABAP program in a process chain to execute  the program daily,
I tried to use ARCHIVFILE_SERVER_TO_CLIENT and GUI_DOWNLOAD but unfortunately both the above FM doesn't support to run through Process chain.
Can any one of you help me to send the code which selects a file from application server, downloads to local system and deletes it.
Thank you very much for spending your precious time in this regard.

Hi Sailekha,
Regarding your case ..
I suggest you to create the program where it run this function: WS_DOWNLOAD.
After it, the program is run by your process chain.
Hopefully it can help you a lot.
Regards,
Niel.
thanks for the points you choose to assign.

Similar Messages

  • Error in PDF Conversion while downloading file from application server

    Hi,
    I am facing a problem in which i have to download file from application server which is a PDF file (output of SAP Script). I am downloading this file using following code in BSP technology:
    * event handler for data retrieval
    EMPCD = REQUEST->GET_FORM_FIELD( 'emp' ).
    MONTH = REQUEST->GET_FORM_FIELD( 'mn' ).
    YEAR  = REQUEST->GET_FORM_FIELD( 'yr' ).
    W_IND = 'N' .
    DATA : wa_zform16 type  zform16.
    DATA : file_path type string.
    DATA : l_pdf_len type string.
    DATA STR TYPE STRING.
    DATA: OUTPUT    TYPE STRING ,
          L_XSTRING TYPE XSTRING ,
          APP_TYPE  TYPE STRING.
    DATA: PDF_TABLE TYPE  RCL_BAG_TLINE.
    DATA PHY_NAME_OUT     TYPE SAPB-SAPPFAD.
    concatenate '/usr/sap/put/form16/' EMPCD '_' YEAR '.PDF'  into file_path
    *PHY_NAME_OUT = '/usr/sap/put/form16/01000200_2007.PDF'.
    PHY_NAME_OUT = file_path.
    OPEN DATASET PHY_NAME_OUT FOR INPUT IN TEXT MODE ENCODING default.
    IF SY-SUBRC IS INITIAL.
      DO.
        READ DATASET PHY_NAME_OUT INTO STR.
        IF SY-SUBRC IS INITIAL.
          CONCATENATE
              OUTPUT
              STR
              CL_ABAP_CHAR_UTILITIES=>CR_LF
          INTO OUTPUT.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      APP_TYPE = 'APPLICATION/PDF'.
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          TEXT     = OUTPUT
                MIMETYPE = 'APPLICATION/PDF'
    *            MIMETYPE = 'APPLICATION/PDF;charset=utf-16le'
        IMPORTING
          BUFFER   = L_XSTRING.
      CALL METHOD CL_BSP_UTILITY=>DOWNLOAD
        EXPORTING
          OBJECT_S            = L_XSTRING
          CONTENT_TYPE        = APP_TYPE
          CONTENT_DISPOSITION = 'attachment;filename=webforms.pdf'
          RESPONSE            = _M_RESPONSE
          NAVIGATION          = NAVIGATION.
    Result of this code is : there is a pop up asking to open or save pdf format and process is complete, but i have problem in downloaded file.
    At the time of creation i have put BMP image for signature in PDF file and it is working fine but when i upload that file in Application server and then download it with above used code it save the PDF file but when i open that file so whereever i have used signature that page gives error and could not display that scanned signature.
    Can anyone please help me in this regard.
    or is there any possibility from which i can download that file just like File transfer from BSP.
    Keep in mind that i am using BSP technology so all GUI based function module to download file are not working.
    waiting for your reply.....
    Regards,
    Gagan

    Hi Raja,
    I have standard sap form for TDS Certificate on which i have include an BMP image for digital signature and download that script into pdf format.While i download that PDF looks ok but it is not working in BSP.
    Regards,
    Gagan

  • How to download file from application server

    Hi Experts,
                  I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
    i know it is possible through Tcode CG3Y. but i want code in program.

    This code will download a file to your Client package by package, so it will also work for huge files.
    *& Report  ZBI_DOWNLOAD_APPSERVER_FILE
    REPORT  zbi_download_appserver_file.
    PARAMETERS: lv_as_fn TYPE sapb-sappfad
    DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
    PARAMETERS: lv_cl_fn TYPE string
    DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
    START-OF-SELECTION.
      CONSTANTS blocksize TYPE i VALUE 524287.
      CONSTANTS packagesize TYPE i VALUE 8.
      TYPES ty_datablock(blocksize) TYPE x.
      DATA lv_fil TYPE epsf-epsfilnam.
      DATA lv_dir TYPE epsf-epsdirnam.
      DATA ls_data TYPE ty_datablock.
      DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
      DATA lv_block_len TYPE i.
      DATA lv_package_len TYPE i.
      DATA lv_subrc TYPE sy-subrc.
      DATA lv_msgv1 LIKE sy-msgv1.
      DATA lv_processed_so_far TYPE p.
      DATA lv_append TYPE c.
      DATA lv_status TYPE string.
      DATA lv_filesize TYPE p.
      DATA lv_percent TYPE i.
      "Determine size
      SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
      CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
        EXPORTING
          file_name      = lv_fil
          dir_name       = lv_dir
        IMPORTING
          file_size_long = lv_filesize.
      "Open the file on application server
      OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
      IF sy-subrc <> 0.
        MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
        EXIT.
      ENDIF.
      lv_processed_so_far = 0.
      DO.
        REFRESH lt_data.
        lv_package_len = 0.
        DO packagesize TIMES.
          CLEAR ls_data.
          CLEAR lv_block_len.
          READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
          lv_subrc = sy-subrc.
          IF lv_block_len > 0.
            lv_package_len = lv_package_len + lv_block_len.
            APPEND ls_data TO lt_data.
          ENDIF.
          "End of file
          IF lv_subrc <> 0.
            EXIT.
          ENDIF.
        ENDDO.
        IF lv_package_len > 0.
          "Put file to client
          IF lv_processed_so_far = 0.
            lv_append = ' '.
          ELSE.
            lv_append = 'X'.
          ENDIF.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize         = lv_package_len
              filename             = lv_cl_fn
              filetype             = 'BIN'
              append               = lv_append
              show_transfer_status = abap_false
            TABLES
              data_tab             = lt_data.
          lv_processed_so_far = lv_processed_so_far + lv_package_len.
          "Status display
          lv_percent = lv_processed_so_far * 100 / lv_filesize.
          lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
          CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
            EXPORTING          "percentage = lv_percent - will make it fash
              text = lv_status.
        ENDIF.
        "End of file
        IF lv_subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      "Close the file on application server
      CLOSE DATASET lv_as_fn.

  • Downloading file from application server to presentation server

    Hi,
          We have a requirment to download file from application server to presentation server.  The problem is while down loading, some of the filds showing some junk values. Instead of that junk values we have some Russian texts there.  These Russian texts only coming as junk all other data is correct.  The file in the appplication server is in .dbf format. We are downloading using WS_DOWNLOAD. file type is BIN and code page we didn't specified.
    Thanks in Advance
    Jijeesh.P.G
    Message was edited by: Jijeesh.P.G
            Jijeesh P G

    hi jijeesh,
       Welcome to SDN.
    u can use to download file from application server to presentation server using the t/c CG3Y. in that it will ask the source file path and the target file path.
    if u want to find the source file path in the application server, u can use the transaction AL11 to find that one.
    Regards....
    Arun.
    Reward points if useful.

  • How to download files from Application Server of Unix o.s to local director

    Hi All,
    I am trying to download files from Apllication server of Unix operating Systems to local file in excel sheet format using a z-program.but whenever I am trying to use OPEN dataset ........
    it is showing sy-subrc = 8.
    Can I have any clew please.
    Thanks in advance,
    Regards,
    AMEER.

    Hi Sreekanth,
    Thanks a lot for quick reply.I have to download that files from z-program only. I am giving you my code below.
    *& Report  ZTRAK_DOWNLOAD                                         *
    REPORT  ZTRAK_DOWNLOAD  MESSAGE-ID ZCT                   .
    SELECTION-SCREEN BEGIN OF BLOCK DOWNLOAD WITH FRAME TITLE TEXT1.
      PARAMETERS :
           SERDIR LIKE RLGRAP-FILENAME DEFAULT '/usr/trak',
           LOCDIR LIKE RLGRAP-FILENAME DEFAULT 'C:\Trak'.
    SELECTION-SCREEN END OF BLOCK DOWNLOAD .
    SELECTION-SCREEN BEGIN OF BLOCK INFO2 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT2.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT3.
    SELECTION-SCREEN END OF BLOCK INFO2 .
    SELECTION-SCREEN BEGIN OF BLOCK INFO3 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT4.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT5.
            SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT6.
           SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT7.
           SELECTION-SCREEN SKIP 2.
           SELECTION-SCREEN COMMENT 1(79) TEXT8.
    SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT9.
    SELECTION-SCREEN END OF BLOCK INFO3.
    *- Internal Table to output data in Excel
    DATA: BEGIN OF tab_excel OCCURS 0,
            col1(50),
            col2(132),
            col3(255),
            col4(100),
            col5(100),
            col6(50),
            COL7(60),
            col8(30),
            col9(30),
            col10(30),
            col11(20),
            col12(15),
            col13(15),
          END OF tab_excel.
    DATA: FILE LIKE RLGRAP-FILENAME .
    DATA: W_DATASET(80).
    INITIALIZATION.
      TEXT1  = 'Download Reports'.
      TEXT2 = 'The Program downloads the reports generated by Trak'.
      TEXT3 = 'Utility from Server to Local PC.'.
      TEXT4 = 'Check the following before executing the Program.'.
      TEXT5 = '     1. A valid Server path is provided.'.
      TEXT6 = '     2. A valid Local PC path is provided.'.
      TEXT7 = '     3. Local PC has 10 MB free space.'.
      TEXT8 = 'The report can be executed in the forground.'.
    TEXT9 =
    'The report should be executed after execution of Transaction TRAK'.
    AT SELECTION-SCREEN.
    IF SERDIR EQ ''.
    MESSAGE E001(ZCT).
    ENDIF.
    IF LOCDIR EQ ''.
    MESSAGE E002(ZCT).
    ENDIF.
    START-OF-SELECTION.
    Download ABAP Development Summary Report
    FILE =  '\ABAP_Report_Developments.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAP_Report_Developments.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download BDC Development Report
    FILE =  '\BDC_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/BDC_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Development Summary Report
    FILE = '\Developments_Summary_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Developments_Summary_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Enhancement Development Report
    FILE =  '\Enhancement_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Enhancement_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download field exit Development Report
    FILE =  '\Field_Exit_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Field_Exit_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Frequency & Purpose Report
    FILE =  '\Frequency_And_Purpose_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Frequency_And_Purpose_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Group Developments Report
    FILE =  '\FunctionGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Module Developments Report
    FILE = '\FunctionModule_Developments_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionModule_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    FILE =  '\Include_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Include_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download UserGroup Developments Report
    FILE =  '\UserGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Modified_Standard_SAP_Objects_Report
    FILE = '\Modified_Standard_SAP_Objects_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Modified_Standard_SAP_Objects_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    *FILE =  '\Include_Developments_Report.XLS'.
    *CONCATENATE LOCDIR FILE INTO FILE.
    *W_DATASET = '/Include_Developments_Report.dat'.
    *CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    *PERFORM INIT.
    Download SAP Script Developments Report
    FILE =  '\SAP_Scipt_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/SAP_Scipt_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Transaction Developments Report
    FILE =  '\Transaction_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Transaction_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download User Exits Developments Report
    FILE =  '\UserExits_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserExits_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download ABAP Query Developments Report
    FILE =  '\ABAPQuery_Developments_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAPQuery_Developments_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Functional Area Developments Report
    FILE =  '\FunctionalArea_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionalArea_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    MESSAGE S003(ZCT) WITH LOCDIR.
    END-OF-SELECTION.
    This routine checks whether file exists if yes downloads it to
    the Local PC
    FORM INIT.
    OPEN DATASET W_DATASET FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
       IF SY-SUBRC <> 0.
          EXIT.
       ENDIF.
       READ DATASET W_DATASET INTO  tab_excel.
       APPEND tab_excel.
       CLEAR tab_excel.
    ENDDO.
         PERFORM DOWNLOAD_FILE.
    ENDFORM.
    This routine downloads the data in an XL format on local PC
    FORM Download_File .
      CALL FUNCTION 'WS_DOWNLOAD'
                EXPORTING
                     FILENAME                = FILE
                     FILETYPE                = 'DAT'
                TABLES
                     DATA_TAB                = tab_excel
                EXCEPTIONS
                     FILE_OPEN_ERROR         = 1
                     FILE_WRITE_ERROR        = 2
                     INVALID_FILESIZE        = 3
                     INVALID_TYPE            = 4
                     NO_BATCH                = 5
                     UNKNOWN_ERROR           = 6
                     INVALID_TABLE_WIDTH     = 7
                     GUI_REFUSE_FILETRANSFER = 8
                     CUSTOMER_ERROR          = 9
                     OTHERS                  = 10.
        IF sy-subrc <> 0.
         message ''.       " Error in file transfer
        ELSE.
          CLEAR TAB_EXCEL.
          REFRESH TAB_EXCEL.
          FILE = ''.
          W_DATASET = ''.
        ENDIF.
    ENDFORM.
    I have created those files in Application Server running in another z-program in background mode.Then I am trying to download those files using above the program.I am creating those trak/Trak files manually and I can able to see those files in A.S level.But when downloading the same files I am facing the problem.
    regards,
    Ameer

  • Downloading file from application server in Binary mode

    Hi,
    I am trying to read an application server file using open dataset in Binary Mode..
    While downloading using gui_download method the file is getting truncated because of its size.
    My questions are,
           How to increase the size of the internal table dynamically. Already tried using STRING type but it is not accepting.
           If I use the CHAR type with maximum length 65535 and if the length of the file is less than that then in the remaining spaces box like symbols are printed .
    How can I achieve it.
    Thanks & Regards,
    NJ

    TYPES: BEGIN OF type_download,
               data1 TYPE zchar20000,
               data2 TYPE zchar20000,
               data3 TYPE char3000,
               data4 TYPE char2000,
             END OF type_download.
      DATA: lt_download TYPE STANDARD TABLE OF type_download,
            lx_download TYPE string,
            lv_filename TYPE string.
    Read data from application server to internal table
      OPEN DATASET p_p_ftappl FOR INPUT IN BINARY MODE.
      IF sy-subrc = 0.
    Read file
        DO.
          CLEAR lx_download.
          READ DATASET p_p_ftappl INTO lx_download.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          APPEND lx_download TO lt_download.
        ENDDO.
    Download data to presentation server from internal table
        lv_filename = p_p_ftfron.
    Download data from application server to PC
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
       bin_filesize              =
            filename                  = lv_filename
            filetype                  = c_bin
       append                    = space
          write_field_separator     = space
       header                    = '00'
       trunc_trailing_blanks     = 'X' "space "commented
       trunc_trailing_blanks_eol = 'X' "added
    IMPORTING
       filelength                =
          CHANGING
            data_tab                  = lt_download.
    *Exceptions deleted            .
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Close file
        CLOSE DATASET p_p_ftappl.
    Edited by: NewJoinee123 on Mar 25, 2010 8:45 AM

  • Download file from application server to internal table in background

    hi all,
    i want to download a file from appliaction server into my internal table but in background.
    i had tryed CG3Z and CG3Y t-code but screen that is coming is asking for the parameters, and i want that screen should not appear and file should be saved in the predefined path by me.
    if there any way to do so,
    Points will be rewarded as per the Aswers.
    thaks in advance.

    Hi Sudeep,
       Use this code to get file data from application server.
    REPORT  ZE0232_BDC_APPLSERVER.
    DATA: FILE_PATH TYPE STRING.
    FILE_PATH = 'c:\bdc_mat.prn'.
    DATA: BEGIN OF ITAB OCCURS 0,
                END OF ITAB.
    OPEN DATASET FILE_PATH FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
    DO.
    READ DATASET FILE_PATH INTO ITAB.
    IF ITAB-RESNO NE SPACE.
       APPEND ITAB.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    ENDIF.
    CLOSE DATASET FILE_PATH.
    LOOP AT ITAB.
    WRITE:/ ITAB.
    ENDLOOP.
    FILE PATH IS  application server path.
    IF USEFULL REWARD

  • Problem in Downloading File from Application Server

    Hi All,
    We have an Requirement that, iam putting the Flat File
    ( Output Of a Report ) in to the
    Application Server(AL11) By using the OpendataSet, Transer , Close DataSet.
    When iam trying to Downloading the Flat File through the FM, GUI_DOWNLOAD, the Data is coming Correctly.
    But the Problem is , when trying to Downloading through AL11 i.e System -> List -> Local File  it is not coming Correctly.
    ( Java People is going to Connect with the Application Server for the Flat File )
    Kindly Clarify the Problem.
    Points will be Rewarded.
    Regards,
    Kiran.I

    Hi nl,
    1. this program will display
       selection screen
      and ask two things :
    a) application server filename
    b) local file name
    2. then it will download the file
    (the file name is CASE Sensitivie)
    3.  just try it (just copy paste )
    *& Report  YBCR_FILEDOWNLOAD                                           *
    REPORT  ybcr_filedownload                       .
    DATA
    DATA : file_name TYPE string.
    DATA : BEGIN OF itab OCCURS 0,
           ln(255) TYPE c,
           END OF itab.
    SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
    PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CLEAR p_file.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_file.
      file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
      OPEN DATASET appfn FOR INPUT IN TEXT MODE  ENCODING DEFAULT .
      IF sy-subrc <> 0.
        MESSAGE s999(yhr) WITH 'COULD NOT OPEN FILE ON APP SERVER'.
        LEAVE LIST-PROCESSING.
      ENDIF.
      DO.
        READ DATASET appfn INTO itab.
        IF sy-subrc = 0.
          APPEND itab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      file_name = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          filename                        = file_name
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
        TABLES
          data_tab                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    regards,
    amit m.

  • Download files from application server - unknown file name

    Hello everybody,
    I am working on a report allowing users to download XML files from the application server. All these XML files are created by the SAP system and their names can be found in a table. I can simply use OPEN DATASET for these files, put all file content to a buffer and send them to the GUI with CALL METHOD cl_gui_frontend_services=>gui_download.
    The problem is now that some files are touched by an external document management system. These files are moved to another directory and timestamped. The first is no problem since the folder name is always the same and can be replaced before the OPEN DATASET statement. But additionally, the file gets a timestamp, when the filename was xyz.xml before, it now gets xyz.xml.01012008123456123456. As I cannot try all possible values (mircoseconds!), I need a way to search for the right filename on the application server. Is there a function module for this available?
    It can always be stated that the former name (xyz.xml) is still a unique prefix, so I don't have to worry that xyz.xml.* will return multiple files.
    Thanks in advance for any suggestions.
    Christoph

    HI!
    I copy the function GET_DIRECTORY_FILE. In the eyelash of tables create one structures:
    DIR_FILES           LIKE                  ZDIR_FILES
    The single structure has component NAME (char 250).
    I code of the function that I use is:
    FUNCTION zget_directory_file.
    ""Interfase local
    *"  IMPORTING
    *"     REFERENCE(NAME_OF_DIR) TYPE  CHAR120
    *"     REFERENCE(NAME_OF_FILE) TYPE  CHAR120 OPTIONAL
    *"     REFERENCE(SP_CS) TYPE  CHAR120 OPTIONAL
    *"  TABLES
    *"      DIR_FILES STRUCTURE  ZDIR_FILES
      DATA: a_dir_name TYPE  char120,
            a_generic_name TYPE  char120,
            a_must_cs TYPE  char120.
      a_dir_name      = name_of_dir.
      a_generic_name  = name_of_file.
      a_must_cs       = sp_cs.
      DATA: errcnt(2) TYPE p VALUE 0.
      IF a_dir_name IS INITIAL.
       MESSAGE e220.     " 'Place cursor on valid line !'.
      ENDIF.
      CALL 'C_DIR_READ_FINISH'             " just to be sure
          ID 'ERRNO'  FIELD file_list-errno
          ID 'ERRMSG' FIELD file_list-errmsg.
      CALL 'C_DIR_READ_START' ID 'DIR'    FIELD a_dir_name
                              ID 'FILE'   FIELD a_generic_name
                              ID 'ERRNO'  FIELD file-errno
                              ID 'ERRMSG' FIELD file-errmsg.
      IF sy-subrc <> 0.
        sy-subrc = 4.
        EXIT.
      ENDIF.
      file-dirname = a_dir_name.
      DO.
        CLEAR file.
        file-name = '*.zip'.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD file-type
          ID 'NAME'   FIELD file-name
          ID 'LEN'    FIELD file-len
          ID 'OWNER'  FIELD file-owner
          ID 'MTIME'  FIELD file-mtime
          ID 'MODE'   FIELD file-mode
          ID 'ERRNO'  FIELD file-errno
          ID 'ERRMSG' FIELD file-errmsg.
        file-dirname = a_dir_name.
        MOVE sy-subrc TO file-subrc.
        CASE sy-subrc.
          WHEN 0.
            CLEAR: file-errno, file-errmsg.
            CASE file-type(1).
              WHEN 'F'.                 " normal file.
                PERFORM filename_useable USING file-name file-useable.
              WHEN 'f'.                 " normal file.
                PERFORM filename_useable USING file-name file-useable.
              WHEN OTHERS.              " directory, device, fifo, socket,...
                MOVE sap_no  TO file-useable.
            ENDCASE.
            IF file-len = 0.
              MOVE sap_no TO file-useable.
            ENDIF.
          WHEN 1.                     " end of directory
            EXIT.
          WHEN 4.                     " filename too long
            MOVE sap_no TO file-useable.
          WHEN OTHERS.
            ADD 1 TO errcnt.
            IF errcnt > 90.
              EXIT.
            ENDIF.
            IF sy-subrc = 5.
              MOVE: '???' TO file-type,
                    '???' TO file-owner,
                    '???' TO file-mode.
            ELSE.
            ULINE.
            WRITE: / 'C_DIR_READ_NEXT', 'SUBRC', SY-SUBRC.
            ENDIF.
            MOVE sap_no TO file-useable.
        ENDCASE.
       PERFORM p6_to_date_time_tz(rstr0400) USING file-mtime
                                                  file-mod_time
                                                  file-mod_date.
      * Does the filename contains the requested pattern?
      * Then store it, else forget it.
       MOVE-CORRESPONDING file TO file_list.
       APPEND file_list.
        MOVE file-name TO dir_files-name.
        APPEND dir_files.
       IF a_must_cs = no_cs.
         MOVE-CORRESPONDING file TO file_list.
         APPEND file_list.
       ELSE.
         IF file-name CS a_must_cs.
           MOVE-CORRESPONDING file TO file_list.
           APPEND file_list.
         ENDIF.
       ENDIF.
      ENDDO.
    ENDFUNCTION.
    *&      Form  filename_useable
          text
         -->A_NAME     text
         -->A_USEABLE  text
    FORM filename_useable USING a_name a_useable.
    *--================--
      DATA l_name(75).
      l_name = a_name.
      IF l_name(4) = 'core'.
        a_useable = sap_no.
      ELSE.
        a_useable = sap_yes.
      ENDIF.
    ENDFORM.                    "FILENAME_USEABLE
    With this I obtain all the archives XML of that route in a table
    DATA: zfiles LIKE STANDARD TABLE OF zdir_files WITH HEADER LINE.
    CALL FUNCTION 'ZGET_DIRECTORY_FILE'
      EXPORTING
        name_of_dir = dsn
      TABLES
        dir_files   = zfiles.
    IF sy-subrc = 0.
      LOOP AT zfiles .
        IF  zfiles-name+0(2) = 'O_' AND
            zfiles-name+2(3) = sy-mandt AND
            zfiles-name+5(1) = '_' AND
           zfiles-name+22(4) = '.xml'.
          file = zfiles-name.
    endloop.
    endif.
    I hope this helps you.
    Regards.

  • How to download file from application server to local file using tcode

    Hi,
    I want to download one report output in application sever(/temp/xxx) to local.
    But downloaded excel sheet improper format.
    In downloaded excel sheet having one complete record(12 fields)  in one cell.
    I want to separate it each field in each cell in proper format..[requirement]
    restriction : without using any programs using standard tcode like CG3Y.
    THANKS IN ADVANCE....
    Regards,
    Ragavendran K.
    Moderator message: please search for available information/documentation before asking.
    Edited by: Thomas Zloch on Dec 21, 2010 5:15 PM

    In downloaded excel sheet having one complete record(12 fields) in one cell.
    You did it wrong then.  Post your code and someone will tell you what's wrong with it (or you could search the forum).

  • Process Chain - Delete File from Application Server

    Hi Gurus,
    Im working with Process chain, and i have a load from a flat file, so my question is :
    How can i delete that file from the application server after was loaded ?
    THANKS IN ADVANCED !!! I REALLY APRECCIATE YOUR HELP.
    Marcos

    hi,
    I have gone through the forum you have posted for deleting files from application server through process chain.
    I have similar reuirement in my project.
    Can you please provide me the solution?
    Your inputs will be highly appreciated.
    Thanks in advance.
    Regards,
    Lavanya.

  • Download PDF file from Application Server in BSP

    Hello,
    We have a requirement on which we want to download a PDF file stored in Application server using BSP application. I have used function module  ARCHIVFILE_SERVER_TO_CLIENT but this FM will help only if i want to download file from GUI it won't work in BSP application.
    Further i have used class CL_BSP_UTILITY and download method to download file from application server but it is not working in desired manner.
    I am attaching my code for your reference:
    DATA: BUTTON_EVENT TYPE REF TO CL_HTMLB_EVENT_BUTTON ,
               EVENT TYPE REF TO IF_HTMLB_DATA.
    DATA: LS_HOURS LIKE LINE OF GT_HOURS.
    DATA STR TYPE STRING.
    DATA: OUTPUT TYPE STRING ,
              L_XSTRING TYPE XSTRING ,
               APP_TYPE TYPE STRING. 
    EVENT = CL_HTMLB_MANAGER=>GET_EVENT( REQUEST ).
    DATA PHY_NAME_OUT     TYPE SAPB-SAPPFAD.
    IF EVENT IS NOT INITIAL AND EVENT->EVENT_NAME = HTMLB_EVENTS=>BUTTON .
      BUTTON_EVENT ?= EVENT .
      CASE EVENT->EVENT_SERVER_NAME.
        WHEN 'test' .
          IF GT_HOURS IS NOT INITIAL.
            PHY_NAME_OUT = '/usr/sap/put/form16//01000200_2007.PDF'.
          OPEN DATASET PHY_NAME_OUT FOR INPUT IN TEXT MODE ENCODING DEFAULT.
            IF SY-SUBRC IS INITIAL.
              DO.
                READ DATASET PHY_NAME_OUT INTO STR.
                IF SY-SUBRC IS INITIAL.
                CONCATENATE
                    OUTPUT
                    str
                    cl_abap_char_utilities=>cr_lf
    INTO output SEPARATED BY space. "cl_abap_char_utilities=>horizontal_tab
                ELSE.
                  EXIT.
                ENDIF.
              ENDDO.
            ENDIF.
    *LOOP AT gt_hours INTO ls_hours.
    *CONCATENATE
    *OUTPUT
    *ls_hours-hour
    *cl_abap_char_utilities=>cr_lf
    *INTO output SEPARATED BY space. "cl_abap_char_utilities=>horizontal_tab
    *ENDLOOP.
            APP_TYPE = 'APPLICATION/PDF;charset=utf-16le'.
            CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
              EXPORTING
                TEXT     = OUTPUT
                MIMETYPE = 'APPLICATION/PDF;charset=utf-16le'
              IMPORTING
                BUFFER   = L_XSTRING.
            CONCATENATE CL_ABAP_CHAR_UTILITIES=>BYTE_ORDER_MARK_LITTLE
            L_XSTRING
            INTO L_XSTRING IN BYTE MODE.
            CALL METHOD CL_BSP_UTILITY=>DOWNLOAD
            EXPORTING
            OBJECT_S = L_XSTRING
            CONTENT_TYPE = APP_TYPE
            CONTENT_DISPOSITION = 'attachment;filename=webforms.pdf'
            RESPONSE = _M_RESPONSE
            NAVIGATION = NAVIGATION.
          ENDIF.
      ENDCASE.
    ENDIF.
    From this code i am able to download PDF file but it is not opening in local machine.
    If any other way to download file then please suggest.
    waiting for ur reply.
    Regards,
    Gagan

    Hi,
    you do the file reading wrong:
    have a look at:
    Local declarations.
      data:
        components          type stringtab,
        component           type string,
        path                type text255,
        file                type text255,
        line_length         type i,
       filecontent_binary type sdokcntbin,
        rows                type sytabix,
        content             type sdokcntbin,
        exception           type ref to cx_sy_file_access_error,
        exception_tmf       type ref to cx_sy_too_many_files ,
        block_size          type i value 1022,
        length              type i.
      field-symbols:
        <hex_container>     type x.
      constants:
        c_dms_blk_size      type i value 2550.
      clear file_size.
      try.
          open dataset file_name  for input in binary mode message message.
        catch cx_sy_file_open  into exception.
          case exception->textid.
            when '4182174D03030063000000000A1551B1'. raise access_error.
            when '41825AD355C3005E000000000A1551B1'. raise open_error.
            when '47E8B03AECE5BA07E10000000A114829'. raise already_open.
            when others.
          endcase.
        catch cx_sy_file_authority into exception.
          case exception->textid.
            when '4182174D03030063000000000A1551B1'. raise access_error.
            when 'A70BB8396F051547E10000000A11447B'. raise authority_error.
            when others.
          endcase.
        catch cx_sy_too_many_files into exception_tmf.
          case exception_tmf->textid.
            when '8708B73915F6B645E10000000A11447B'. raise too_many_files.
            when others.
          endcase.
      endtry.
      do.
        try.
            read dataset file_name into filecontent_binary-line.
            if sy-subrc <> 0.
              add  line_length to file_size.
              append filecontent_binary to file_content_binary.
              exit.
            else.
              add  line_length to file_size.
              append filecontent_binary to file_content_binary.
            endif.
          catch cx_sy_file_open_mode into exception.
            case exception->textid.
              when '9207B73915F6B645E10000000A11447B'. raise cx_sy_file_open_mode.
              when '9807B73915F6B645E10000000A11447B'. raise read_only.
              when '9E07B73915F6B645E10000000A11447B'. raise not_open.
              when '409D273A2D824360E10000000A11447B'. raise incompatible_mode.
              when others.
            endcase.
        endtry.
      enddo.
      try.
          close dataset file_name.
        catch cx_sy_file_close into exception.
          case exception->textid.
            when '4182174D03030063000000000A1551B1'. raise access_error.
            when 'C10BB8396F051547E10000000A11447B'. raise close_error.
            when others.
          endcase.
        catch cx_sy_file_access_error into exception.
          case exception->textid.
            when '4182174D03030063000000000A1551B1'. raise access_error.
            when others.
          endcase.
      endtry.
    Get file size.
      split file_name at '/' into table components.
      describe table components lines sy-tfill.
      read table components into component index sy-tfill.
      path = file_name.
      replace component in path with ''.
      file = component.
      call function '/EUH/MMS_GET_FILE_SIZE'
        exporting
          dir_name  = path
          file_name = file
        importing
          file_size = file_size.
    and function /euh/mms_get_file_size.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(DIR_NAME) TYPE  TEXT255
    *"     VALUE(FILE_NAME) TYPE  TEXT255
    *"  EXPORTING
    *"     VALUE(FILE_SIZE) TYPE  SDOK_FSIZE
    *"  EXCEPTIONS
    *"      NO_AUTHORITY
    *"      ACTIVITY_UNKNOWN
    *"      NOT_A_DIRECTORY
    *"      NO_MEDIA_IN_DRIVE
    *"      TOO_MANY_ERRORS
    *"      TOO_MANY_FILES
    *"      BRACKET_ERROR_IN_FILENAME
    *"      NO_SUCH_PARAMETER
      types: begin of files,
               line like ocs_file,
             end of files.
      data: file type files,
         f_subrc like sy-subrc value 0,
         errno(3)    type c,
         errmsg(40)  type c,
         pos                        type i,
         len                        type i,
         parameter(120)             type c,
         help1(120)                 type c,
         help2(120)                 type c,
         error_counter              type i.
      data:
        dir_list  like  ocs_file occurs 0 with header line.
    CASE sy-subrc.
       WHEN 1. f_subrc = 64.
       WHEN 2. f_subrc = 65.
       WHEN 0.
      search dir_name for 'SY-HOST'.    "Is SY-HOST used in directory name?
      if sy-subrc = 0.
        pos = sy-fdpos + 7.
        move dir_name(sy-fdpos) to help1.
        move dir_name+pos to help2.
        concatenate help1 sy-host help2 into dir_name.
      endif.
      do 12 times.                                 " To avoid endless loop
        if dir_name cs '$('.           " Replace parameter by their value
          pos = sy-fdpos + 2.
          if dir_name cs ')'.
            len = sy-fdpos - pos.
            if len le 0.
              f_subrc = 4. exit.
            else.
              parameter = dir_name+pos(len).
              call 'C_SAPGPARAM' id 'NAME'  field parameter
                               id 'VALUE' field parameter.
              if sy-subrc = 0.
                len = pos + len + 1.
                pos = pos - 2.
                if pos > 0.
                  move dir_name(pos) to help1.
                else.
                  help1 = ''.
                endif.
                pos = strlen( dir_name ).
                if pos > len.
                  move dir_name+len to help2.
                else.
                  help2 = ''.
                endif.
                concatenate help1 parameter help2 into dir_name.
              else.
                f_subrc = 8. exit.
              endif.
            endif.
          else.
            exit.
          endif.
        else.
          exit.
        endif.
      enddo.
      shift dir_name right deleting trailing '/\ '.
      shift dir_name left deleting leading space.
      call 'C_DIR_READ_FINISH'                      " this is from RSWATCH0
            id 'ERRNO'  field errno
            id 'ERRMSG' field errmsg.
      call 'C_DIR_READ_START'
            id 'DIR'    field dir_name
            id 'FILE'   field file_name
            id 'ERRNO'  field errno
            id 'ERRMSG' field errmsg.
      case sy-subrc.
        when 1.
          case errno.
            when 2 or 20.  f_subrc = f_subrc + 66.
            when ' '. f_subrc = f_subrc + 67.
          endcase.
        when 0.
          clear error_counter.
          do.
            clear file.
            clear dir_list.
            call 'C_DIR_READ_NEXT'
                id 'TYPE'   field file-line-type
                id 'NAME'   field file-line-name
                id 'LEN'    field file-line-len
                id 'OWNER'  field file-line-owner
                id 'MTIME'  field file-line-mtime
                id 'MODE'   field file-line-acc_mode
                id 'ERRNO'  field errno
                id 'ERRMSG' field errmsg.   "sy-subrc = 3 is e.g. if return
            if sy-subrc = 0 or sy-subrc = 3."data do not fit into variables
              perform p6_to_date_time_tz(rstr0400) using
                    file-line-mtime
                    file-line-mod_time
                    file-line-mod_date.
              file_size = file-line-len.
              dir_list = file-line.
              append dir_list.
            elseif sy-subrc = 1.                 " nothing (more) found
              exit.
            else.
              if error_counter > 50.
                call 'C_DIR_READ_FINISH'
                    id 'ERRNO'  field errno
                    id 'ERRMSG' field errmsg.
                pos =  f_subrc mod 2.
                if pos = 0. f_subrc = f_subrc + 1. endif.
                exit.
              endif.
              add 1 to error_counter.
            endif.
            if sy-index > 1000.
              pos =  f_subrc mod 4.
              if pos = 0. f_subrc = f_subrc + 2. endif.
              exit.
            endif.
          enddo.
          call 'C_DIR_READ_FINISH'
               id 'ERRNO'  field errno
               id 'ERRMSG' field errmsg.
          if sy-opsys(3) = 'Win' and not ( file_name cs '*' ).
            describe table dir_list lines len.
            if len = 0.
              help1 = file_name.
              translate help1 to upper case.
              translate help1 using
                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
              call 'C_DIR_READ_START'
                    id 'DIR'    field dir_name
                    id 'FILE'   field help1.
              if sy-subrc = 0.
                clear error_counter.
                do.
                  clear file.
                  clear dir_list.
                  call 'C_DIR_READ_NEXT'
                      id 'TYPE'   field file-line-type
                      id 'NAME'   field file-line-name
                      id 'LEN'    field file-line-len
                      id 'OWNER'  field file-line-owner
                      id 'MTIME'  field file-line-mtime
                      id 'MODE'   field file-line-acc_mode
                      id 'ERRNO'  field errno
                      id 'ERRMSG' field errmsg.
                  if sy-subrc = 0 or sy-subrc = 3.
                    help2 = file_name.
                    translate help2 to upper case.
                    help1 = file-line-name.
                    translate help1 to upper case.
                    if help1 = help2.
                      perform p6_to_date_time_tz(rstr0400) using
                         file-line-mtime
                         file-line-mod_time
                         file-line-mod_date.
                      dir_list = file-line.
                      append dir_list.
                    endif.
                  elseif sy-subrc = 1.
                    exit.
                  else.
                    if error_counter > 50.
                      call 'C_DIR_READ_FINISH'
                          id 'ERRNO'  field errno
                          id 'ERRMSG' field errmsg.
                      pos =  f_subrc mod 2.
                      if pos = 0. f_subrc = f_subrc + 1. endif.
                      exit.
                    endif.
                    add 1 to error_counter.
                  endif.
                  if sy-index > 1000.
                    pos =  f_subrc mod 4.
                    if pos = 0. f_subrc = f_subrc + 2. endif.
                    exit.
                  endif.
                enddo.
                call 'C_DIR_READ_FINISH'
                     id 'ERRNO'  field errno
                     id 'ERRMSG' field errmsg.
              endif.
            endif.
          endif.
      endcase.
    ENDCASE.
    CASE f_subrc.
       WHEN 1 OR 3.             RAISE too_many_errors.
       WHEN 2.                  RAISE too_many_files.
       WHEN 4 OR 5 OR 6 OR 7 OR 70 OR 71.
         RAISE bracket_error_in_filename.
       WHEN 8 OR 9 OR 10 OR 11 OR 74 OR 75.
         RAISE no_such_parameter.
       WHEN 64.                 RAISE no_authority.
       WHEN 65.                 RAISE activity_unknown.
       WHEN 66.                 RAISE not_a_directory.
       WHEN 67.                 RAISE no_media_in_drive.
    ENDCASE.
    endfunction.
    Now you will be able to get the filesize and the file in SDOK format sdokbin.
    Okay.
    You have to build an request and push the content to the user like:
      call method server->response->set_header_field( name = 'Content-Type' value = value ).
      describe field file_content_binary-line length line_length in byte mode.
      bytes_rest = file-size.
      loop at file_content_binaries assigning <file_content_binary>.
        move <file_content_binary>-line to data.
        if bytes_rest <= 0. "mismatch between line values and size
          exit.
        endif.
        if bytes_rest >= line_length.
          call method server->response->append_data( data = data
            length = line_length ).
        else.
          call method server->response->append_data( data = data
            length = bytes_rest ).
        endif.
        bytes_rest = bytes_rest - line_length.
      endloop.
    This will work.
    You can set the header fields like you want. Have also a look at sicf node contentserver
    and its handler: CL_HTTP_EXT_CSIF

  • Sending EMail "Text-File" from Application Server!

    Hi Experts,
    how can I sending a Text-File from Application Server via Email?
    Is there existing a Function Modul?
    With Kind regards
    Ersin
    Moderator message: sending emails = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 25, 2010 4:23 PM

    STF (Search the forum)!  This type of question has been asked...and answered....many times.

  • XML File not fully downloaded Fully from Application Server.

    Hi,
    I am downloading an XML file from Application server. It's only downloading partially. Below is the Declaration for target Internal table.
    DATA: BEGIN OF infile OCCURS 0,
            line(65535) TYPE c,
          END OF infile.
    SAP does not allow more than 65535 characters for a data type of type C. So its only downloading till that length.
    If I am using type as STRING, its downloading in different format. Also its not allowing me to put these data into internal table.
    Below is my code for downloading.
    OPEN DATASET p_unix IN TEXT MODE MESSAGE msg.
        IF sy-subrc <> 0.
          MESSAGE i001(38) WITH 'Error on Open of File: ' msg.
        ELSE.
          WHILE sy-subrc = 0.
            READ DATASET p_unix INTO infile.
            CHECK sy-subrc = 0.
            APPEND infile.
            ENDWHILE.
          CLOSE DATASET p_unix.
    Is there any way to convert string into XML format & put it in the internal table?
    Kindly suggest me any other way, so I can download the entire set of file into the internal table.
    Thanks,
    Debi.

    Hi ,
    Try downloading the file from the application server using the TCode CG3Y on your local machine.
    Then use the FM GUI_UPLOAD to upload the contents in an internal table.
    Thanks,
    Manish

  • How to download a file from application server to presentation server

    Hi experts,
    I want to download a file from application server to presentaion server, file contaims three fields customer name, customer email id and status..
    help me out i m new into sap.

    Dear Aditya,
    Please check below thread
    http://scn.sap.com/thread/1010164
    it will help you.
    BR
    Atul

Maybe you are looking for

  • Lenovo Yoga - My first experience with a notebook - my last with Lenovo

    Short story about myself: I am a designer (print/web) and a coder (Web). I started my studying and thought it was time to get a Notebook as the iPad would not cut the productivity needed anymore. I was mostly working at the office or at home. But stu

  • FM for Position

    hi, is there any standard FM for getting the Positions, Organization, Job, User by passing an Objtype to it as import. cheers, Aditya.

  • ABUMN - how to bring "Internal Order" from Asset Master to Asset Account

    Dear All , I have maintained the I/O of the Asset Master . If I did OAYR , the I/O value of the Asset Master could  be brought to Depreciation Account automatically when running AFAB.  But when I run ABUMN (and ABAVN), the system could not bring the

  • Mobile Data disabling and affecting phone settings

    Hi, Every now and again my phone will prompt that mobile data is disabled. When that happens, the display settings I have set (2mins to auto screen lock and brightness) reset to their original settings. Does anyone know what is happening or how I fix

  • [pthread - Solaris 8] pthread_mutex_lock / pthread_mutex_unlock weird pb

    Hi all, I actually have the current problem : I create 2 threads, one thread works a lot and spend most of its time in the critical session and the other one sleeps most of the time (outside the critical section) The problem is : the slow thread neve