Problem with saving data in text file in Application server

Hello Experts,
I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
The logic I implemented is the following:
*Open file
  open dataset g_accnt_file for output in text mode encoding utf-8.
  if sy-subrc = 0.
    clear g_header_record.
*Building header record for Accounting Validation file
    concatenate gc_hdr_desc
                gc_filetype
                gc_sequence
                gc_idntf_refresh
                gc_cmpny_idntf
                gc_accnt_id
                sy-datum
                sy-uzeit
                gc_linde_group
                sy-sysid
                gc_not_used into g_header_record separated by
                                           gc_deliminator.
    transfer g_header_record to g_accnt_file.
*Move Cost center data to file to create a detail record for Accounting
*Validation file
    loop at gt_csks into gs_csks.
*Remove leading Zeros
      call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
        exporting
          input  = gs_csks-kostl
        importing
          output = gs_csks-kostl.
*      Overlay gs_csks-kostl with space.
*      SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
*Prepare Cost Centre String
      perform prepare_costcentre_string.
*Prepare detail record with Company Code & Cost Centre
      perform prepare_detail_record.
      clear:g_detail_record,gs_csks,g_coa.
    endloop.
*Move Order data to file to create a detail record for Accounting
*Validation file
    loop at gt_aufk into gs_aufk.
*Remove leading Zeros
      call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
        exporting
          input  = gs_aufk-aufnr
        importing
          output = gs_aufk-aufnr.
*      SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
*Prepare Order String
      perform prepare_order_string.
*Prepare detail record with Company Code & Order
      perform prepare_detail_record.
      clear:g_detail_record,gs_aufk,g_coa.
    endloop.
*Move WBS data to file to create a detail record for Accounting
*Validation file
    loop at gt_prps into gs_prps.
      call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
        exporting
          input  = gs_prps-pspnr
        importing
          output = g_wbs_element.
*      SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
*Prepare WBS Element String
      perform prepare_wbs_string.
*Prepare detail record with Company Code & WBS Element
      perform prepare_detail_record.
      clear:g_detail_record,gs_prps,g_coa.
    endloop.
*Building trailer record for Accounting Validation file which will
*contain the total number of detail records in file
    concatenate gc_trail_desc
                g_total_count
                into g_trailer_record
                separated by gc_deliminator.
    transfer g_trailer_record to g_accnt_file.
*Close file
    close dataset g_accnt_file.
    if sy-subrc = 0.
      message s036(/lig/fi).
    endif.
  endif.
endform.                    " SELECT_DATA
Edited by: Matt on Sep 30, 2010 11:02 AM - added   tags

Hi Pankaj,
Can u check the concatenate statement with one more data. Check the no of lines for a single file.
    concatenate gc_hdr_desc
                gc_filetype
                gc_sequence
                gc_idntf_refresh
                gc_cmpny_idntf
                gc_accnt_id
                sy-datum
                sy-uzeit
                gc_linde_group
                sy-sysid
                sy-subrc
                gc_not_used into g_header_record separated by
                                           gc_deliminator.
Regards,
Amitava

Similar Messages

  • Query Builder problem with saving to SQL text file

    When developing an SQL statement in Query Builder and saving it for later use, one has the option of saving in .SQL file extension. However, this file can not be used by the data wizard of Oracle*Reports because it contains non-ascii text. It appears that the Query Builder saves commands as binary tokens rather than in ascii text.
    This makes it impossible to use Query Builder in place of Oracle*Report's data wizard's query builder with which to build and save SQL statements.

    as i posted earlier .. queryBuilder as a stand alone product is neither supported nor available anymore. it is only available as part of the report data wizard.
    thanks,
    ph.

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

  • Error in Downloading the Text file on Application Server

    Hi All,
              I am working on ECC6.0. I have written a program in whcih I am downloading the text file on
              application server in UTF-8 format. However when I am opening this file in Excel I am getting
              garbage value for some characters(as Excel does not support UTF-8 format). So now I
              want to download the data on application server in text file in non unicode format(Like ANSI or
              other non unicode format) which is supported by excel. When I am writing the code as
              OPEN DATASET DN_FILE FOR OUTPUT IN LEGACY TEXT MODE it is giving me dump saying
              CHARACTER CONVERSION FROM CODE PAGE '4102' to CODEPAGE '1100' NOT POSSIBLE.
              Same in case if I add the code OPEN DATASET DN_FILE FOR OUTPUT IN LEGACY TEXT
              MODE CODE PAGE '8000' is also giving dump.
              So please let me know how can I download the file in non unicode format ?
              Any help would be greatly appricated.
    Thanks & Regards
    Jitendra Gujarathi.

    OPEN DATASET l_filename FOR INPUT IN TEXT MODE  ENCODING NON-UNICODE IGNORING CONVERSION ERRORS.
    CHECK sy-subrc EQ 0.
      DO.
        CLEAR wa_file_content.
        READ DATASET l_filename INTO wa_file_content.
        IF sy-subrc EQ 0.
          APPEND wa_file_content TO it_file_content.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE  DATASET l_filename.
      t_filedata[] = it_file_content[].
    can you use like this.

  • Download text file from application server to client server.

    Hi all,
    I am facing a format issue while downloading text file from application server to the client machine.
    The issue is that, say I have 6 to 10 lines in my text file in application server. but when i store it on the hard drive,
    it shoes all the data in a single line. Where as i need to download data in same format as in application server.
    Awaiting for your responses.
    Regards,
    Jose

    Hi,
    If we want to upload file data from the application server to the internal table, there is no function module or class static method which we can use, we must wirte the code by ourselves.
    1. For the file data which has no seperator between field columns.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_data.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.2. For the file data which has tab separator between field columns.
    DATA: gds_field_split type gts_data.
    FIELD-SYMBOLS: <fs_field> TYPE gts_data.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET prf_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_field.
        SPLIT gds_field  AT cl_abap_char_utilities=>horizontal_tab
             INTO TABLE gdt_field_split.
       LOOP AT gdt_field_split  into gds_field_split.
           gdf_index = gdf_index + 1.
           ASSIGN COMPONENT gdf_index OF STRUCTURE
                 gds_data to <fs_field>.
          IF sy-subrc = 0.
              <fs_field> = gds_field_split.
          ENDIF.
       ENDLOOP.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.
    Thanks & regards,
    ShreeMohan

  • Placing the text file in application server

    Hi all,
    I am uploading the text file into application server.
    the line length is 1028 characters.But in application server i am not able to see whole line.it is showing only some data and reamaining data is not coming.
    Please let em know how can we increase the line length in application server.
    Regards,
    Shoban

    SE38 is the ABAP Editor transaction.
    Use function module ‘GUI_UPLOAD’ to create an upload the data. 
    *Use function module ‘GUI_UPLOAD’ to create an upload the data.
    Example Code >>>
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    *DATA: ld_file LIKE rlgrap-filename.
    DATA: gd_file type string.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 LIKE pa0002-vorna,
        name2 LIKE pa0002-name2,
        age   TYPE i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Internal table to upload data into
    DATA: BEGIN OF it_datatab OCCURS 0,
      row(500) TYPE c,
    END OF it_datatab.
    *Text version of data table
    TYPES: BEGIN OF t_uploadtxt,
      name1(10) TYPE c,
      name2(15) TYPE c,
      age(5)  TYPE c,
    END OF t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) TYPE c.
    CONSTANTS: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = p_infile
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Upload File'(078)
           IMPORTING
                filename         = p_infile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *START-OF-SELECTION
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
        IF sy-subrc NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    Alternative method, where by you split fields at each TAB after you
    have returned the data. No point unless you dont have access to
    GUI_UPLOAD but just included for information
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
               filename        = gd_file
               filetype        = 'ASC'
          TABLES
               data_tab        = it_datatab  "ITBL_IN_RECORD[]
          EXCEPTIONS
               file_open_error = 1
               OTHERS          = 2.
    IF sy-subrc NE 0.
    ELSE.
       LOOP AT it_datatab.
         CLEAR: wa_string, wa_uploadtxt.
         wa_string = it_datatab.
         SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                         wa_uploadtxt-name2
                                         wa_uploadtxt-age.
         MOVE-CORRESPONDING wa_uploadtxt TO wa_record.
         APPEND wa_record TO it_record.
       ENDLOOP.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    LOOP AT it_record INTO wa_record.
      WRITE:/     sy-vline,
             (10) wa_record-name1, sy-vline,
             (10) wa_record-name2, sy-vline,
             (10) wa_record-age, sy-vline.
    ENDLOOP.
    Edited by: Nikhil Jathar on Jan 9, 2008 7:38 AM

  • Problem of Delete and Overwrite XLS file on Application Server

    Hi Experts,
         I want to transfer file on application server using below code and try to delete after successfully transfer on application file to other location.
    I have problem during deleting file and overwrite file.
    DATA: G_S_FILE TYPE EPSFILNAM,
          G_S_DIR  TYPE EPSDIRNAM,
          G_T_FILE TYPE EPSFILNAM,
          G_T_DIR  TYPE EPSDIRNAM.
    DATA : DELFILE(60).
      G_S_FILE = '1400000051.XLS'.
      G_S_DIR  = '\\Dev\PO\'.
      G_T_FILE = '1400000051.XLS'.
      G_T_DIR  = '\\Dev\PO\bkup'.
      DELFILE = '\\Dev\PO\1400000051.XLS'.
      CALL METHOD CL_CTS_LANGUAGE_FILE_IO=>COPY_FILES_LOCAL
        EXPORTING
          IM_SOURCE_FILE           = G_S_FILE
          IM_SOURCE_DIRECTORY      = G_S_DIR
          IM_TARGET_FILE           = G_T_FILE
          IM_TARGET_DIRECTORY      = G_T_DIR
          IM_OVERWRITE_MODE        = 'S'
        EXCEPTIONS
          OPEN_INPUT_FILE_FAILED   = 1
          OPEN_OUTPUT_FILE_FAILED  = 2
          WRITE_BLOCK_FAILED       = 3
          READ_BLOCK_FAILED        = 4
          CLOSE_OUTPUT_FILE_FAILED = 5
          OTHERS                   = 6.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      OPEN DATASET DELFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DELETE DATASET DELFILE.
      ELSE.
        WRITE / 'File not found'.
      ENDIF.
    Thanks,
    Himanshu Patel.

    Write a Java program using Apache POI that reads in a tab delimited file and outputs an xls file (in what they call Horrible Spread Sheet Format. Create your tab delimited file and then run your Java program using appropriate OS commands.
    Jelena Perfiljeva wrote:
    In all honesty, I find it hard to believe other application can't accept any other format. It's actually seems rather unreasonable to expect an ERP system to create a file in an outdated format of a desktop software. Even Excel itself can open many formats, so this just doesn't make any sense.
    This.
    Unless you can explain exactly why the destination must be xls and no other format is acceptable, I'm going to close the thread. What is this third party tool? Why can it only read the obsolete xls file format.
    I'm going through this thread and rejecting all the responses that attempt a solution that isn't xls.
    I'm surprised that the OP thought that simply saving with an xls file extension would cause some magic to happen and produce an actual Excel file.

  • Editing text file on application server

    Hello,
    I have created a utility in which I can move files from one folder to another. Now we also need a option by which I can edit text file on the server folders. Is there a function module by which I can edit text from application server ?
    Regards,
    Rajesh.

    With OPEN DATASET and READ you can load them into an internal table. Next put them on screen in lets say the text editor (enjoy SAP Controls). This is one way of doing this, other way would be:
    Upload data with OPEN DATASET into internal table, download file to local drive (cl_gui_frontendservices=>gui_download), open it with notepad (for example) edit it and save. Next upload file into your program (cl_gui_frontendservices=>gui_upload) and download it to server again (OPEN DATASET and TRANSFER).
    If available you can also use transaction CG3Z and CG3Y.

  • Append data into the file in application server

    Hi Friends,
    I have an issue where i have a job which has three different stepst for same program. If i run the job the program will create a file in the application server and append the other two steps in the same file without overwriting the file or creating a new file.
    My problem is like its creating three different files in application server for that particular job since it has three steps . Its not appending into one particular file .
    I am using the FM 'Z_INTERFACE_FILE_WRITE' where i have used the pi_append in the exportng parameter . ITs working when i specify the file in local system. It is appending correctly when i run the report normally to apppend into local system.
    But when i schedule a job to append the file in application server its creating three different files.
    Kindly help me if anyone is aware of this issue
    Thanks in advance
    Kishore

    Hi,
    Please use open dataset to write and append files.Please check the logic of Z FM which you are using .
    To open and write into a file  use
    OPEN DATASET FNAME FOR OUTPUT.
    To append data into existing file use
    OPEN DATASET FNAME FOR APPENDING.
    To write into file:
    v_file = file path on application server
      OPEN DATASET v_file FOR output.
      IF sy-subrc NE 0.
    write:/ 'error opening file'.
      ELSE.
       TRANSFER data TO v_file.
      ENDIF.
    CLOSE DATASET v_file.
    For appending :
    OPEN DATASET v_file fOR APPENDING.(file is opened for appending data  position is set to the end of the file).
    Thanks and Regards,
    P.Bharadwaj

  • InfoSpoke fails with message "Could not open file on application server"

    BW Experts,
    I created an InfoSpoke that is configured to extract to a flat file. The name of the file is specified using a logical filename. During extraction, the infospoke reports the error message "Could not open file on application server" adnd  marks the extraction process as red(failed). I have tried to run the InfoSpoke in background mode and in dialog mode and the same error appears. After i run in dialog mode, i checked SU53 for authorization errors and did not find any. I also tried changing the Logical filename setup in transaction FILE to a more "friendly" directory in which i'm sure i have authorizations (e.g. my UNIX home directory) and im still getting errors.
    Can you please share your thoughts on this? Any help will greatly appreciated. I also promise to award points.

    Hi Nagesh,
    Thanks for helping out.
    If i configure the InfoSpoke to download to a file using "File Name" option and also check the "Application server" checkbox, the extract works correctly (extraction to the defualt SAP path and filename=infospoke name). If i configure the InfoSpoke to download to the local workstation, the InfoSpoke also works correctly. It's only when i configure it to download to the application server and use the "Logical filename" option, that i encounter a failed extract.
    Here are the messages is the Open Hub Monitor:
    (red icon) Request No.147515
    0 Data Records
    Runtime 1 sec.
    (red icon)Run No. 1
    0 Data Records
    Runtime 1 sec.
    Messages for Run
    Extraction is running RSBO 305
    Could not open file on application server RSBO 214
    Request 147515 was terminated before extraction RSBO 326
    Request 1475151: Error occured RSBO 322
    If i clink on the error message, no messages nor clues are displayed. Note, this is a new InfoSpoke that is currently in the dev system.
    Please help.

  • Problem while downloading data to text file using GUI_DOWNLOAD FM

    Hi,
    When we download the data using the GUI_DOWNLOAD FM into the text file tab delimeted(table is built dynamically),
    Its coming in this format as shown below
    Field1  Fileld2  Field3
    1     2      3
    However I want it in this way
    Field1  Fileld2  Field3
    1          2         3
    Could someone please let me know how to achieve this?

    Do something like this:
    concatenate field1 field2 field3 into lv_outx "(data of sufficient length, type c)
    separated by gc_tab.  "Horizontal tab constant created as note above
    condense lv_outx no-gaps.  "squeeze out extraneous spaces but beware if you have text with spaces...drop the no-gaps.
    append lv_outx to my_internal_table.  "table with a single field type char, sufficient length
    open dataset  datasetname...
    loop at my_internal_table into ls_internaltabstructure.
      transfer internaltabstructure-outx to datasetName [length if needed].
    endloop.

  • Problem with READ DATASET when reading file from app server

    Hi,
    wondering if anyone can help, I'm using the following code to read from a file on app server, the file is of type .rtf
    OPEN DATASET file_rtf FOR INPUT IN TEXT MODE
                                 ENCODING DEFAULT
                                 WITH SMART LINEFEED.
    DO.
    READ DATASET file_rtf INTO string.
    IF SY-SUBRC = 0.
    EXIT.
    ENDIF.
    ENDDO.
    the open dataset part works sy-subrc = 0, but the read returns sy-subrc = 8 and no data is passed to string.
    Any ideas as to what is causing this problem appreciated, <removed>
    Thanks
    Edited by: Thomas Zloch on Mar 17, 2010 3:57 PM - please don't offer p...

    Hi Adam,
    The source code in the below link has details about how to read/write to application server.
    [Application server file operartions|http://www.divulgesap.com/blog.php?p=NDk=]
    Please let us know if you have any issues.
    Regards,
    Ravi

  • Problem in bulk import of text files in SQL Server

    Hi,
    I am using sql server 2012 x 64 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb
    I am trying bulkinsert on text file but it is inserting all data in a single line in sql while in text file I have 1000K lines,
    Then I tried importing other data using openrowset from access file but I am getting following error
    Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
    can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format
    Nitin

    If this is a one-off, I think you should try the import/export wizard in SQL Server Management Studio instead. This may be easier to get working.
    If you want to this import on a regular basis with BULK INSERT, we need to see the CREATE TABLE statement for your table and a sample file. Best if you can upload the file on Skydrive, Dropbox or similar, as the exact bytes matters.
    To connect to an Access database, you use the ACE provider. Never heard of MSDASC before.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Save string data type text in the application server file opened in binary

    Hi All,
    My requirement is to save the string "abcd    23432423   asdada" to the text file in the application server.
    I have written like this. but its not getting saved properly in the text file. Please help.
      constants X_LINESIZE type I value 128.
      types X_LINETYPE type X length X_LINESIZE.
    data: WA_TAB_X type X_LINETYPE.
      data: str1(64) type C.
      data: WA_TAB_X_HDR1 type xstring.
      str1 = 'abcd    23432423   asdada'.
      CONVERT TEXT STR1 INTO SORTABLE CODE WA_TAB_X_HDR1.
      concatenate F_FILENAME1 SY-SYSID F_FILENAME2 '/' TAB_REGUT-TSNAM '.TXT' into F_FILENAME1.
      open dataset F_FILENAME1 for output in binary mode .
      if SY-SUBRC = 0.
        transfer WA_TAB_X_HDR to F_FILENAME1.
        loop at TAB_X into WA_TAB_X.
          transfer WA_TAB_X to F_FILENAME1.
        endloop.
      endif.
      close dataset F_FILENAME1.
    Edited by: madhuri sonawane on Jun 2, 2009 4:05 PM

    HI,
    constants X_LINESIZE type I value 128.
      types X_LINETYPE type X length X_LINESIZE.
    data: WA_TAB_X type X_LINETYPE.
      data: str1(64) type C.
      data: WA_TAB_X_HDR1 type xstring.
    data : file (1000) type c.
      str1 = 'abcd    23432423   asdada'.
      CONVERT TEXT STR1 INTO SORTABLE CODE WA_TAB_X_HDR1.
      concatenate F_FILENAME1 SY-SYSID F_FILENAME2 '/' TAB_REGUT-TSNAM '.TXT' into F_FILENAME1.
      open dataset file for output in binary mode .
      if SY-SUBRC = 0.
        transfer WA_TAB_X_HDR to file.
        loop at TAB_X into WA_TAB_X.
          transfer WA_TAB_X to file
        endloop.
      endif.
      close dataset file.
    regards,
    Munibabu.k

  • Downloading a text file from application server

    Hi Freinds,
    I am genarating a text file in our application server (Folder /usr/sap/dbi/) I need to download this text file in my destop pc or some other windows server.
    What do I have to do? What is the procedure, Pls help.
    If someone have sample code, pls send.
    We are running SAP ECC5.0 on an iSeries (AS/400) Database DB2/400.
    Regards
    Thanura

    Hi,
    try this:
    REPORT ZGRO_TEST.
    DATA: DATEI_A(30) TYPE C VALUE '/tmp/matnr.txt'.
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: ITAB        TYPE TABLE OF MARA WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM DATEI_EINLESEN.
      PERFORM DATEI_DOWNLOAD.
    FORM DATEI_EINLESEN.
      OPEN DATASET DATEI_A FOR INPUT IN TEXT MODE.
      IF SY-SUBRC NE 0. STOP. ENDIF.
      DO.
        READ DATASET DATEI_A INTO ITAB.
        IF SY-SUBRC <> 0. EXIT. ENDIF.
        APPEND ITAB.
      ENDDO.
      CLOSE DATASET DATEI_A.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_EINLESEN
    FORM DATEI_DOWNLOAD.
    Datei downloaden
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = DATEI_PC
          FILETYPE                = 'ASC'
        CHANGING
          DATA_TAB                = ITAB[]
        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
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          OTHERS                  = 24.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_DOWNLOAD
    Regards, Dieter

Maybe you are looking for

  • Safari's search field

    The safari browser search field is displaying results in full screen mode.  I am not able to come out of this results box.  Please help.

  • Group by query

    I have the following query in Oracle 10g: SQL> with t as   2  (select 'a' f1, 'b' f2, '01' f3, '1' status from dual union   3   select 'a' f1, 'b' f2, '02' f3, '2' status from dual union   4   select 'x' f1, 'y' f2, '01' f3, '1' status from dual unio

  • Website fine in safari, but images larger and stretched in Firefox?

    The site I just created loads fine in Safari, and also internet explorer (I used IE Netrender to test) however when viewing in Firefox the content width is wider, the images are larger and it just doesn't compare (or look very nice). The site is (www

  • Errors in the program

    Hi all, Im doing the extension of controller by adding additional functionality of submitting a concurrent program from OAF page. but im getting following errors .pls help Code: package petrofac.oracle.apps.ota.admin.enrollment.webui; import com.sun.

  • Wenn Ladekabel an MacBook Pro 15" 2012 angeschlossen ist läuchtet es rot oder grün, was bedeutet das

    Hallo, wenn das Ladekabel am Macbook Pro angeschlossen ist läuchtet es grün oder rot, was bedeutet das?