HOW TO SAVE THE FLAT FILE.

Hi Exports,
     Flat file comes to our Internal table.then i build our logic.After that i wann to save this flat file is some location(may be in presentation/ application server).that to file name along with date,time and location.agin i run the pgm and save same location and file name is also same.
here iam giving file format.
emp no               file name        location.
1                          XXX               h:\kkk.txt
2
3
4
5
again i am running same pgm
emp no               file name        location.
6                           XXX               h:\kkk.txt
7
8
9
10
file name and location same but diff emp no.
Regards,
Krishna.

Hi Krishna Kumar,
if u wnat to download in to presentation server..
then use GUI_DOWNLOAD.
if u want to save in application server (in AL11) then u need to use
open data set...
  DATA : dl_string(250).           " String
*--Open data set
    OPEN DATASET dg_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc <> 0.
      dg_subrc = sy-subrc.
    ELSE.
*--Transfer data
      DO.
        READ DATASET dg_filename INTO dl_string.
        IF sy-subrc = 0.
          APPEND dl_string TO dt_data.
          CLEAR  dl_string.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
*--Close data set
      CLOSE DATASET dg_filename.
    ENDIF.

Similar Messages

  • How to query the flat files?

    Hi
    How to query the flat files that are used in Etl From EBS source.

    That can be done in OBIEE. Save the flat file as .csv format. Then go to ODBC Administrator on windows machine where you BI server is running, and create an System DSN and select "Microsft Access Text Driver (*.txt, *.csv)" as driver type.
    Next, import tables in RPD using this ODBC connection. Rest of the steps as same as building model from a table source.
    Hope this helps.

  • How to store the flat file data into custom table?

    Hi,
    Iam working on inbound interface.Can any one tell me how to store the flat file data into custom table?what is the procedure?
    Regards,
    Sujan

    Hie
    u can use function
    F4_FILENAME
    to pick the file from front-end or location.
    then use function
    WS_UPLOAD
    to upload into
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'   "Function to pick file
        EXPORTING
          field_name = 'p_file'     "file
        IMPORTING
          file_name  = p_file.     "file
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                       = p_file1
        TABLES
          data_tab                      = it_line
    *then loop at it_line splitting it into the fields of your custom table.
    loop at it_line.
              split itline at ',' into
              itab-name
              itab-surname.
    endloop.
    then u can insert the values into yo table from the itab work area.
    regards
    Isaac Prince

  • How to save the report file in network drive

    Hi experts,
    Can any one of you pls tell me how can  save the report file in network drive.
    My requirement:
    by running a report i wll get daily data into a list.SO, i want to keep this in a common drive (network drive:Z) where every one can acces the txt file.
    I want the code in SAP to design this.
    Awaiting for an early reply.

    Is the Z drive in the application or presentation server ?
    make sure the server has write access to the required folder
    for presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = 'c:\test_xls.xls'
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = itab.
    for the application server, use
    data: outfile(120).
      OPEN DATASET outfile FOR APPENDING IN TEXT MODE ENCODING DEFAULT.

  • How to save the pdf file or word doc into sap table

    Hi Expertu2019s
       I have a pfd file in my presentation server .Now I want to save the pdf file into sap table using module pool program. Whenever i need, I want to open that file from the table and show it in the Screen. Please any one tell me how I can save the file. What is the table name, guide me.
    Regards,
    S.Nehru.

    Hi,
    Try the following code
    FORM gui_upload.
      DATA: lv_filetype(10) TYPE c,
            lv_gui_sep TYPE c,
            lv_file_name TYPE string.
      lv_filetype = 'PDF'.
      lv_file_name = <name of ur file>.
    DATA: tb_file_data TYPE TABLE OF text4096.
    * FM call to upload file
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lv_file_name
          filetype                = lv_filetype
          has_field_separator     = lv_gui_sep
        TABLES
          data_tab                = tb_file_data
        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 <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "gui_upload
    I dont think you can save the data into sap tables in PDF format.
    With the above code you can save data into an internal table.
    Regards,
    Manish

  • How to save the CorelDraw file as Tiff.

    I am new to CorelDraw. How to open the CorelDraw file in CorelDraw and save it as Tiff format using Visual Basic. Kindly help me with examples.
    Thanks,
    Prabudass

    Sorry but this is a Photoshop forum nothing to do with CoralDraw.
    You could try here. http://coreldraw.com/forums/

  • How to save the client file to DB?

    I use ENCTYPE="multipart/form-data" in the html,post the file binary stream to my servlet,but I don't know how to get the file binary stream and save them to the DB :
    The html:
    <form name="frmMain" method="POST" ENCTYPE="multipart/form-data" action="servlet/myservlet">
    <input type="file" name="fileName" size=35>
    <input type="submit" value="submit" >
    </form>
    The servlet included:
    String sql="insert into test(id,photo) values(?,?)";
    PreparedStatement ps=conn.prepareStatement(sql);
    ps.setInt(1,getNextId());
    ps.setBinaryStream(2,in,in.available()); //"in" is InputStream
    ps.executeUpdate();
    ps.close() ;
    how to get InputStream?how to write my servlet ?
    Thank for any help!
    Thanks in advance!

    Well, I'm not sure to have understood what you want to do, but you can get the inputStream of the client with HttpServletRequest.getInputStream() (for example in the doPost() method of your servlet).
    Just be careful that, in this way, you will retrieve the whole HTTP stream, including headers and multipart separators. You should parse this stream if you want to get only the binary stream of the file posted...
    Well, in fact you just have to implement/obtain a basic upload servlet...
    Hope it helps...

  • How to upload the flat file records into internal table by position?

    Hi
    I have a flat file which has 7 records in each row and they are NOT provided with CSV or Tab demilited...
    They are continous text without spaces....
    but i know the fixed length of each field Eg : 1st field 7 char and seconc field 3 char and so on...
    How can i upload this file into internal table by reading positions of each field...I know we can use GUI_UPLOAD and Read dataset and Open dataset...
    But please let me know to read the file with the fixed postions and load into internal table...
    Thanks in advance
    MM

    Hi
    As per my knowledge i dont think thr is some function module or so to read with a fixed positions.
    You can use the below method if you think this is the best way.
    Suppose your file has
    types : begin of ty_itab,
                field1 type char7,
                field2 type char3,
                field3 type chat3,
                field4 type char3,
                end of ty_itab.
    types : begin of ty_upload,
                 str type string,
                end of ty_upload.
    data : it_itab type standatd table of ty_itab,
              it_upload type standard table ot ty_upload,
              wa_itab type ty_itab,
              wa_upload type ty_upload.
    use gui_upload.get the data in it_upload.
    here you know that u have first 16 charcters makes a first row n then next 16 charcters next row
      Loop at it_upload into wa_upload.
       v_len =  strlen ( wa_upload ).
       v_len = v_len / 16.
        You get number of rows per record ,if it is decimal value make it final value if 3.9 make to 4.
        do v_len times.
          wa_itab = wa_upload.
          By this only first 16 characters are moved and respective fields will get a value.or else u can use offset
           wa_upload+0(16).
          append wa_itab to it_itab.
          Now shift 16 characters using shift command in wa_upload.
        enddo.
      endloop.
    Hope this syntax help you to resolve your issue.May be something i have missed .Right now i don't have sap system to send you the full correct syntax code.
    Cheers
    Joginder

  • I am in hurry,how to save  the xml file without attributes

    i have the following xml file with attributes,
    <?xml version="1.0"?>
    <Ve2.Configuration>
         <Ve2.Displaymanager>
              <type type="combobox">eVeDisplayStandardType</type>
              <setCounter type="bool">false</setCounter>
              <frames type="textfield">20</frames>
         </Ve2.Displaymanager>
    </Ve2.Configuration>
    but i want to save it without attributes, that means, my saved xml file look like this.:
    <?xml version="1.0"?>
    <Ve2.Configuration>
         <Ve2.Displaymanager>
              <type >eVeDisplayStandardType</type>
              <setCounter >false</setCounter>
              <frames20</frames>
         </Ve2.Displaymanager>
    </Ve2.Configuration>
    how can i do it with java.

    If you know the format of the XML file, then you can write a straight forward XSL file to transform it.
    Paul
    www.codetelligence.com

  • How to convert the flat file data into sap tables . ?

    how to upload flat file data into sap table . before upload mapping is also there in some filds . any one can give me some steps how to upload and mapping . ?

    Hi
    See the sample code
    REPORT zmmupload.
    Internal Table for Upload Data
    DATA: i_mara like MARA occurs 0 with header line
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_mara
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Upload the Data from Internal Table
      MODIFY MARA from TABLE i_MARA.
    Regards
    Anji.

  • Load of hierarchies from R/3 via flat file: how to generate the flat file?

    Hello,
    I need to build a custom extractor for a hierarchy. The hierarchy exists in R/3, but there's no standard datasource to extract it. I know I can upload it via flat file, but I have a question related to this.
    Does anyone know if there's a program (standard or custom by SAP) or function module in R/3 which allows me to generate that flat file, with the required format by BW?
    I would appreciate very much any help about this topic
    Thanks in advance

    In CO-PA there is a way to generate Hierarchy Extractors (see Note 422175 for more details). With a Custom Program you generate a specific DataSource.
    Hope it helps
    GFV

  • How to configure the flat file in 11G

    Hi,
    I am using OWB 11.1.0.6.0.
    For a map in OWB 10G having a source a flat file. I used to go and right click on the map--> then click Configure-->then Under "Source Data File" type the file name-->then give the location details and the exact flat file name with extention.
    IN when i do the same thing the node "Source Data File" is missing?? my question is do we need to configute the data file name and location details some were else in 11.1.0.6.0.
    The ERROR I get is
    "VLD-2398: No data file specified. Generated code will use the sampled file name and the file location 'FILE_LOCATION1'.
    To specify a data file configure the mapping, add a node under 'Source Data File', type in the file name and select the file location."

    There should be a node named 'Sql Loader Data Files' in the map's configuration tree (assuming it is a SQLLoader map), if you right click on that node you can create any number of data files, and define the name and location of the file. When you said 10g, were you talking about 10.1?
    Cheers
    David

  • LSMW - How to view the flat file on App Server

    Hi All,
    I'm trying to take a look at BC420_DOC_1_HEAD_POS.LEG which is the file for LSMW training BC420. However, this file is stored on the application (NT) server to which I have no access. Can I browse this file using R/3 utilities?
    I just want to see what a flat file for the training course looks like.
    Thanks so much!
    Roman

    Hi Roman,
    In general, the users will not have access to the directories on the application server directly at the OS level. You will have to go through an SAP program / transaction.
    Look at the transaction AL11. If the file that you are talking about resided in any of the directories listed in there you will be able to navigate to it.
    Regards,
    Anand Mandalika.

  • How to SaveAs the MSword file into xml file format using Java APIS?

    Hello all,
    I want to convert MSword file into Xml format using java APIS or any other inbuilt APIS that i can integrate in Java code.

    Sorry, that doesn't make much sense.
    The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
    Are you a user of this utility?

  • I download, but always saves files of 1KB.  How can I save the whole file.

    I registered the unlock of QT Pro. I try to download, it tries to save audio file as something.mov, but the file is 1KB in size. It actually does not save the whole thing.
    How can save the whole file from a URL?
    Thanks,
    Juan

    The site is probably using pointer movies which may indicate that the movies are streaming and so cannot be saved. I'd suggest checking with site's support staff and ask if the movies are downloadable or are streaming only.

Maybe you are looking for

  • Entity bean (ejb 3.0) refactoring problem

    I didn't find a better method than regenerating an entity bean after modifying the table definition and renaming the class after deleting the old one. I'm not sure i can delete the old class representing the entity bean before regenerating it without

  • Bind variable value to a Swing component

    I'm totally lost in this one. I've been reading Swing tutorials and books and cant figure it out. I have an array of objects and their value is constantly changing as the program runs. What I want is their value reflected inside some Swing componente

  • How to centre the html pages & How to set the Index as Homepage (just upgraded to CS5 and am lost)

    Hi Ive just upgraded to CS5 and am a bit lost!! 1st Problem I updated our website design (which was previously designed in fireworks using CS3) using Fireworks CS5 and exported the images etc as html and loaded into the website folder.... however now

  • SQL TEXT and ID from previous Snaps

    Hi Gurus, Need help please, few days ago a SQL was ran in one of our database release 10.2.0.4 which contains the bind variables values passed by the application. That SQL is not in library cache and can't run due to missing/unknown variable values.

  • Temporary Fix for custom folder icons now working in dock...

    First of all, this is kinda simplistic and you will NOT be able to use stacks with it. When you click these icons, the folder will open in finder immediately. All you have to do is create an alias to the folder you want and then drag the ALIAS to the