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.

Similar Messages

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

  • 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

  • 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

  • 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

  • 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

  • How to edit flat file in application server

    Hi all,
    I have requirment of flat file load. User will update flat file and I need to upload data in cube. I am done with loading data from application server flat file to cube Now I want to know where this file will be stored so user can update the data .
    Do i need to store it some where in application sever only ? I checked my current file data but it's not in editable form.
    Please let me know your expert suggestion.
    Thanks.
    P.S. - Point will be provided as required.

    Neither user or you can not upload or edit the CSV files directly from the AL11(Application level directories).
    Using this Functional Module: ARCHIVFILE_CLIENT_TO_SERVER you can upload the file from your machine to AL11
    Note: you must have an authorization to execute this FM in PRD! otherwise you can follow the below procedure.
    (Or)
    As you data flow is from a flat file, you can ask your basis team to run a FTP program, so that when ever user give a new file every day, using the FTP program the latest file will upload into the AL11 directories. you can execute data using the Info package as usual  from AL11.
    Edited by: YJV on May 23, 2011 12:10 PM

  • Pipe delimited file on application server.

    Hi , i m creating a text file on application server, i have written below code and file is getting created correctly.  however, i want to create pipe delimited file.  is there any method for this?
    DATA : lv_line(173).
      DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
      IF NOT p_tab[] IS INITIAL.
        SORT p_tab.
        OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF sy-subrc NE 0.
          MESSAGE 'Error on output file read' TYPE 'E'.
        ELSE.
          LOOP AT p_tab.
            lv_line = p_tab.
            TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
            CLEAR p_tab.
            CLEAR lv_line.
          ENDLOOP.
          CLOSE DATASET p_file.
        ENDIF.
      ENDIF.
      REFRESH p_tab.

    i m pasting below my entire code.
    REPORT  zmigration_data_download.
    FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE.
    DATA: d_table_ref TYPE REF TO data.
    DATA: d_rfc_db_opt TYPE rfc_db_opt.
    DATA: it_opt LIKE rfc_db_opt OCCURS 0 WITH HEADER LINE.
    DATA: d_file  TYPE string.
    PARAMETERS:     p_tab   TYPE dd02l-tabname OBLIGATORY.
    PARAMETERS:     p_file  LIKE rlgrap-filename OBLIGATORY DEFAULT '/usr/sap/tmp/test.txt'.
    SELECT-OPTIONS: s_opt   FOR  d_rfc_db_opt NO INTERVALS.
    START-OF-SELECTION.
      REFRESH it_opt.
      LOOP AT s_opt WHERE sign = 'I' OR option = 'EQ'.
        it_opt-text = s_opt-low.
        APPEND it_opt.
      ENDLOOP.
      CREATE DATA d_table_ref TYPE TABLE OF (p_tab).
      UNASSIGN <fs_table>.
      ASSIGN d_table_ref->* TO <fs_table>.
      IF <fs_table> IS ASSIGNED.
        CLEAR <fs_table>.
        SELECT * FROM (p_tab) INTO TABLE <fs_table>
        WHERE (it_opt).
        IF sy-subrc EQ 0.
          PERFORM download_file TABLES <fs_table> USING p_file.
          MESSAGE i398(00) WITH 'Upload from SAP Successfull'.
        ENDIF.
      ENDIF.
    *&      Form  download_file
          text
         -->P_<FS_TABLE>  text
         -->P_P_FILE  text
    FORM download_file TABLES p_tab USING p_file.
      DATA : lv_line(173).
      DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
      IF NOT p_tab[] IS INITIAL.
        SORT p_tab.
        OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF sy-subrc NE 0.
          MESSAGE 'Error on output file read' TYPE 'E'.
        ELSE.
          LOOP AT p_tab.
            lv_line = p_tab.
            TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
            CLEAR p_tab.
            CLEAR lv_line.
          ENDLOOP.
          CLOSE DATASET p_file.
        ENDIF.
      ENDIF.
      REFRESH p_tab.
    ENDFORM.                               " download_file

  • Open dataset deleting file in application server

    Hi All,
    Im reading a text file from application server .However the below statement is failing(sy-subrc = 8)
    and deleting my file
    OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING UTF-8.
    Please let me know what is causing the issue.
    REgards,
    Faiz

    That seems very unlikely, you should try to get more information:
    * Try the messages statement:
    DATA mess TYPE string.
    OPEN DATASET `` FOR INPUT IN BINARY MODE MESSAGE mess.
    IF sy-subrc = 8.
      MESSAGE mess TYPE 'I'.
    ENDIF.

  • I am facing problem to get text file from application sever

    Hi This is lokesh.
    Actually my requirement is to craete sales orders by getting file from other server.for that i have used shell script to connect that server.Ok i am connecting to that different server(not sap server) successfully.
    But my problem is getting text file from application SERVER.
    That different server people will send the file name as 'DDHHMMSS' (Days,Hours,Minutes,Seconds).
    Just suppose if they will send today means that file name will come as 20103025. and with in half an hour if they again send that file file means that file name as '20110025'.
    like that file name is always varies.So how can i read that type of text files from the application server.
    and one more thing that is there chance to read morethan one text file from application server.
    Pls guide me if u know the solution.PLs this requirement is urgent.
    Regards,
    Lokeshgoud

    Hi..,
    <b>Just execute this program ... this is for the files received in JUST 3 MINS...</b>
    change it according to your requirement !!
    data time type sy-uzeit value '100000'. <i>"<<----start time</i>
    data file(8) type c value '20'.
    do 180 times. <i>" <<----- for 3 minutes</i>
    add sy-index to time.
    concatenate file time into file.
    write / file.
    OPEN DATASET FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC EQ 0.
    PERFORM READ_DATASET.
    ENDIF.
    file = '20'.
    time = '100000'.
    ENDDO.
    <b>form read_dataset.
    read the file here with the file name <b>FILE</b>.
    endform.</b>
    regards,
    sai ramesh

  • Downloading internal table in excel file on application server

    Hi,
        I am trying to download ITAB into excel file on my application server . I am using FM 'SAP_CONVERT_TO_XLS_FORMAT' for that .
        When I run the report I can see file getting generated on APP server but no ITAB data is saved in that excel.
        After debugging I found that error code  'SAVE_DOCUMENT_FAILED'  is retuned in above FM.
        Could any one please suggest how to go about this?
    Regards,
    Ganesh

    Hi ganesh,
    Please have a look into the below link
    [Link1|How to Upload Excel file to Application Server]
    [Link2|Error in Downloading the Text file on Application Server]
    Hope this will be Helpful
    Thanks
    Kalyan

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • How to download a text file from the server

    hi everyone,
    can anyone tell me how to download and read a text file from the server and saved in into resource folder.
    with regards
    pallavi

    its really easy
    To read from server, use something like:
    HttpConnection connector = null;
    InputStream inp_stream = null;
    OutputStream out_stream = null;
    void CloseConnection()
         if(inp_stream!=null)inp_stream.close();
         inp_stream=null;
         if(out_stream!=null)out_stream.close();
         out_stream=null;
         connector.close();
         connector = null;
    public void getResponse(String URL,String params)
      try
         if(connector==null)connector = (HttpConnection)Connector.open(URL);//URL of your text file / php script
         connector.setRequestMethod(HttpConnection.POST);
         connector.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1");
         connector.setRequestProperty("content-type", "application/x-www-form-urlencoded");
         //connector.setRequestProperty("charset","windows-1251");
         //*** If you need to send ("arg1=value&arg2=value") arguments to script use this:
         out_stream = connector.openOutputStream();
         byte postmsg[] = params.getBytes();
         out_stream.write(postmsg);
         int rc = connector.getResponseCode();//in any case here connection will be opened & closed
         if (rc != HttpConnection.HTTP_OK)
              CloseConnection();
              throw new IOException("HTTP response code: " + rc);
         inp_stream = connector.openInputStream();
         int pack_len = inp_stream.available();
         byte answ[]=new byte[pack_len];
         inp_stream.read(answ);
         CloseConnection();
         ProcAnswer(answ);//process received data
      catch(Exception ex)
         System.err.println("ERROR IN getResponse(): "+ex);
    } And you can read from resource file like
    public void loadFile(String filename)
        DataInputStream dis = new DataInputStream(getClass().getResourceAsStream("/"+filename));
        String str="";
        try
             while (true)
                ch = dis.read();//read character
                if(ch=='\r')continue;//if file made in windows
                if(ch=='\n' || ch==-1)//end of line or end of file
                    if(str.length()==0)continue;//if empty line
                    //do some thing with "str"
                    if(ch==-1)break;//it was last line
                    str="";//next line
                    continue;
                 str+=(char)ch;
           dis.close();
       catch (Exception e)
           System.err.println("ERROR in loadFile() " + e);
    }Welcome! =)
    Edited by: MorskoyZmey on Aug 14, 2008 3:40 AM

  • Creating a new file in application server

    hai,
      please rectify this, how to create a file in application server ?
       can any one forward a sample code for creating a file in application server.
                           hazam

    Hi Hazam,
      Please check the below code.
    Data :   P_UFILE(60)                   " Unix File name
             TYPE C
             value '/emn_R3/hr/ben_age25_dep'.
        CLEAR GD_SUBRC.
        <b>OPEN DATASET</b> GD_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC <> 0.
          GD_SUBRC = SY-SUBRC.
          gs_error-pernr = gs_0021-pernr.
          gs_error-ename = gd_ename.
          gs_error-mess
               = 'Can not open File:'(017) + gd_file.
          append gs_error to gt_error.
          clear gs_error.
    *      CLEAR GD_MSG1.
    *      CONCATENATE 'Can not open File:'(017)
    *                   GD_FILE
    *        INTO GD_MSG1.
    *      WRITE : / GD_MSG1.
        ELSE.
          LOOP AT GT_BODY INTO GS_BODY.
            <b>TRANSFER</b> GS_BODY TO GD_FILE.
          ENDLOOP.
          <b>CLOSE DATASET</b> GD_FILE.
        ENDIF.
    Hope this will help you.
    Thanks&Regards,
    Siri.
    Message was edited by: Srilatha T

Maybe you are looking for

  • An internal build error has occurred. Right-click for more information

    Greetings! We are using Eclipse 3.4 or 3,5 with Flash 4 plugin and Flex SDK 3.3.0. Project set comprises several, more than a couple dozen, dependent  Flex and Java projects. Time-to-time we run across an internal build error on all Flex projects. Th

  • KT£ Ultra2 - RAM Problem

    Hi everybody. I am new in this forum. I have a problem with Ram. The OS is Win2000 Amd XP 1800 Palomino. I upgrade my 256 mb PC2700 ram with another 1 gb. The system and bios tell me that there are only 767mb. The 1gb ram 2 rows, 4 banks work 512mb o

  • Where do you find 'Authorize this Computer'?

    just purchased a new 5c and trying to sync music and photos with my Mac Mini.  message is "the iphone can not be synced because this computer is no longer authorized for purchased items on this iphone" 'choose Store>Authorize this Computer'  - i can'

  • Additional user search field in User form similar to "Manager" search field

    Hi, I need to add a field to the User form in a OIM 11g R2 system that is practically identical to the "Manager" field (it's just for adding a deputy of some kind). I did not find a way to copy&paste the "Manager" field by e.g. exporting a sandbox, m

  • Problem with Multi Master Replication

    Hello All, I've setup a multi-master replication with no consumers. i.e i'm having 2 suppliers which should update each other. The setup seems to be fine since the initialization of one supplier by other works very fine. But i couldn't get the synchr