Data transfer from text file to internal table

Hi, i am uploading data from a text file to an internal table itab.
one of the field in the text file is in the format of p(7,2).
while uploading , this is not not getting uploaded correctly,
for ex instead of uploading 00008.00 in the itab, it gives a strange value of 30303030382>3.03. how to correct this?
pls help

Hello Rahul,
Do the following:
types: begin of ty_upload,
         string type string,
       end of ty_upload.
types: begin of ty_fields,
         text1(20),
         wert      type p decimals 2,
         text2(20),
       end of ty_fields.
data: it_upload type table of ty_upload,
      it_fields type table of ty_fields,
      wa_upload type ty_upload,
      wa_fields type ty_fields.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = 'C:\aa_upload.txt'
   FILETYPE                      = 'ASC'
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  tables
    data_tab                      = it_upload
EXCEPTIONS
  FILE_OPEN_ERROR               = 1
Populate the internal table it_fields accordingly in a loop run, e.g.
loop at it_upload into wa_upload.
  wa_fields-text1 = wa_upload-string(20).
  wa_fields-wert  = wa_upload-string+20(10).
  wa_fields-text2 = wa_upload-string+30.
  append wa_fields to it_fields.
endloop.
When your offsets are set correctly, there shouldn't be any problem.
Regards,
Heinz

Similar Messages

  • How to get data of tabulated text file into internal table

    hi all,
    i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding  how to convert excel file into internal table but i didnt get posts regarding text file.
    thanks
    SAchin

    try:
    DATA: BEGIN OF tabulator,
            x(1) TYPE x VALUE '09',
          END OF tabulator.
      READ DATASET file INTO wa.
    split wa at tabulator into table itab.
    A.

  • BAPI - DATA TRANSFER FROM .XLS FILE TO DB TABLE

    I am upload data from xls file to database table.
    first i have load xls file data to internal table (it_data) that is working.
    then from internal table to database table (zskv_rate) by function module (ZBAPI_RATE_SAVEDATA) which is not working.
    ex.
        LOOP AT IT_DATA.
    Header
        ZSKV_RATE-DIVN = IT_DATA-DIVN.
        ZSKV_RATE-REGN = IT_DATA-REGN.
        ZSKV_RATE-PLANT = IT_DATA-PLANT.
        ZSKV_RATE-RATE = IT_DATA-RATE.
       APPEND IT_DATA.
        CALL FUNCTION 'ZBAPI_RATE_SAVEDATA'
          EXPORTING
            HEADDATA = ZSKV_RATE
          IMPORTING
            RETURN = BAPI_RETURN
          TABLES
            DATA = IT_DATA
        IF BAPI_RETURN-TYPE = 'E'.
            WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,IT_DATA-DIVN.
        ELSEIF BAPI_RETURN-TYPE = 'S'.
            WRITE: 'Successfully created material' ,IT_DATA-DIVN.
        ELSE.
            WRITE:/ 'NONE' ,IT_DATA-DIVN.
        ENDIF.
      ENDLOOP.
    how to transfer data from internal table to database table.

    Hi Sanjeev,
    as u hv uploaded the excel file into  the internal table,
    u can update the ztable from internal table..
    modify <dbtab>from itab.
    regards.
    Mdi.Deeba

  • Saving data retrieved from text file to JDBC table

    Hi,
    I would like to save data, loaded from a text file to a dataset, into an existing JDBC table.
    The documentation I found on this subject is very brief, and no matter how I tried, I couldn't succeed.
    I would appreciate any help.
    Thank you in advance

    Hi there,
    Here is an example of reading a String and a date from a text file. Once you have what you need in the Strings (or whatever) it should be easy to insert them into and SQL statement. Let me know if you need an example of this as well and I'll post it in the morning. Right now I'm off to bed :o)
    Cheers
    Mark
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class WriteTest {
    public static void main(String [] arg) throws Exception {          
       Date today = new Date();          
       String name = "";          
       SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy");          
       File myfile = new File("hello.txt");               
       // how to input     
       BufferedReader in = new BufferedReader(new FileReader(myfile));          
       String name="",
       date="";          
       boolean eof = false;          
       do {
          name = in.readLine();               
          date = in.readLine();               
          if(!(eof = (name==null || date==null)))                    
          System.out.println(name+" "+formatter.parse(date));
       while(!eof);     
    }

  • Data transfer from ALV-Grid to internal table

    Hello,
    I use an editable alv-grid in my program. But the data changes in the alv-grid are not transferred back to the internal table which stores the data of the alv-grid. Is there a function I have to call to transfer the data or is there a property in the alv-grid I have to set? Thanks.
    Regards, Lars.

    Hi
    The problem is if you back from grid, the system doesn't trigger the PAI of grid, so your changing aren't moved to internal table.
    You should press some button of grid bar to update your internal table. So it should be better you insert a SAVE button in your status to update the changing.
    Max
    Message was edited by: max bianchi
    Message was edited by: max bianchi

  • FM????? Text file to Internal table in Background

    Hi,
    I need to execute my prog in background and as per my req i need to dwnload a file from prsentation server to internal table for processing. I'm not sure whch FM to use to dwnload from text file to internal table. I cannot use GUI_UPLOAD FM for background runs.....pls help
    Thanks in advance

    Chesat,
    You can not work for this requirement.You will have an idea on it.
    Introduction
    The use of FTP from ABAP seems to have been a hot topic on the ABAP Forums of late. I thought I might sit down and document whatever I could find on this subject and share it as a weblog.
    Over the years I have seen lots of different solutions for moving files on and off of a SAP system. I have seen external FTP scripts written in OS shell languages. I have seen full blown custom applications that are made to interface to the SAP system. However I think you will find that most of the technology you need to perform a simple FTP from ABAP is already contained in the standard system. All of my examples and screen shots will be coming from a 46C system.
    SAP's Solution
    If you have ever taken a look at the kernel directory of your SAP system, you might have noticed an interesting little executable: sapftp.exe (the name of the file on Windows SAP Kernels). It is this part of the Kernel that exposes FTP functionality to the ABAP Programming language.
    So you have a suspicion that there is FTP functionality in ABAP, but you’re not quite sure how to use it. Where do you start? I always turn to the Service Marketplace first. A quick search on SAPFTP reveals there is an entire component (BC-SRV-COM-FTP) on the subject. The most general note and our starting place is OSS Note 93042. This note starts off with a nice description of what SAPFTP is: A client RFC application that is accessed via RFC from ABAP. But we also find out that in addition to SAPFTP being part of the kernel, it is also part of the SAPGui. That means that we can perform FTP commands originating from our R/3 Server or from a Client Workstation.
    Well if this solution is accessed via RFC, then we must have to setup some RFC destinations. In fact we have two that we need; SAPFTP for Front-end FTP and SAPFTPA for access on the application server. Luckily we don't even have to mess with setting these RFC destinations up in SM59. SAP has supplied a program, RSFTP005, to generate the destinations for us.
    Now before we go off and start written code on our own to hit these FTP functions, why don't we make sure everything is setup and working. Once again SAP has helped us out by providing us with a test program, RSFTP002. (In case you are wondering the FTP functionality and many other test programs are all contained in SAP Development Class SFTP). When we run this test, we get a set input parameters for the server, username password, etc. We want to start out simple and just make sure we are getting a connection. Therefore we will just execute the pwd command (Print Working Directory).
    Your answer back should look something like this:
    If you are wanting to see a list of FTP commands, try using the command HELP in place of PWD:
    If something did go wrong during the test, I suggest that you active the trace option in SM59 for the FTP Destination. You can then use program RSFTP001 to display the current trace file.
    Programming the FTP
    Not only does the RSFTP002 program give us a test environment, but it also provides us with a programming example. We can see that the FTP functionality is really provided by a set of function modules all within the SFTP Function Group. We have the basic commands such as FTP_CONNECT, FTP_COMMAND, and FTP_DISCONNECT that can be strung together to create a complete file operation action. The FTP_COMMAND Function allows you to issue arbitrary FTP commands as long as the SAPFTP function, the Host, and the Destination server all support the command. Then you have the specialized functions such as FTP_R3_TO_SERVER, FTP_R3_TO_CLIENT, and FTP_CLIENT_TO_R3. This lets you take some data in memory and transfer it someplace else. This has the advantage of not having to write the data to the file system first and not to have to issue any FTP commands. However these functions are also limited to the scope described.
    If you are already familiar with FTP in general, working with these function modules should not seem to difficult. The Connect, Command, Disconnect actions would seem somewhat self explanatory. So instead of looking at the entire program in detail let's focus on two things that may be unfamiliar. First the program starts off with an ABAP Kernel System call to AB_RFC_X_SCRAMBLE_STRING. Well we don't want to pass a potentially sensitive password openly. Therefore the FTP_CONNECT function module requires that the password be encrypted before it receives it. It is this System call that performs that one-way encryption. Now I checked a 620 SP42 system and in this example, SAP has replace the AB_RFC_X_SCRAMBLE_STRING with a function call to HTTP_SCRAMBLE. Unfortunately HTTP_SCRAMBLE doesn't even exist in my 46C system. The only other thing that I wanted to point out about these function calls is the exporting parameter on the FTP_CONNECT. It passes back a parameter called handle. This handle then becomes an importing parameter to all subsequent calls: FTP_COMMAND and FTP_CLOSE. This handle is the pointer to the instance of FTP that we started with the FTP_CONNECT. This assures that we get reconnected to the same FTP session with each command we issue.
    FTP Development
    I thought I would share a few of the things that can be built using this FTP functionality. First off I didn't want a bunch of ABAP programs directly working with the SAP FTP Function modules. As you can see there is already a difference in the examples for encrypting the password between 46C and 620. Therefore I thought it would be best to encapsulate all the FTP function in one custom ABAP OO Class. Not only did I get the opportunity to hid the inner SAP functionality and make it easy to switch out during upgrades, but I also get consistent error handling as well. I accept the User Name, Password, Host, and RFC Destination in during the Constructor of the class. I then store these values away in Protected Attributes. Each function module is then implemented as a Instance Method. The Password encryption functionality is then all tucked away nicely in the class. Also the calling program doesn't have to worry about keeping track of the FTP handle either since it is an instance attribute as well.
    Next I got really carried away. I wanted a way to record entire FTP scripts that could be filled with values at runtime and ran as a step in a background job. My company used to have many interfaces that ran frequently sending files all over the place. We needed a mechanism to monitor and support these file moves. This was really the root of this tool, but it also gives you an idea of how powerful these functions can be.
    Closing
    I hope that anyone interested in FTP from ABAP will find this resource useful. If anyone has any other resources that should be included here, feel free to post them.
    Thomas Jung is an Application Developer for Kimball Electronics Group (www.kegroup.com) and a huge fan of ABAP.
    Comment on this weblog
    Showing messages 1 through 7 of 7.
    Titles Only
    Main Topics
    Oldest First
         New to SAP/ABAP-4
    2005-02-24 13:03:06 Thomas Godfrey Business Card [Reply]
    I've been in IT for over 30 years as a mainframe contract programmer/analyst. Recently a company hired me for my legacy knowledge of there business to become a developer on SAP for these same systems.
    My first task is to develop a generalized ftp application to send data to the mainframe and then on to financial institutions. I have created an ABAP/4 test program with literals for the dest/host etc. And it works fine. I need more detail/guidance in creating the Class/Method/Function you have described to make this parameter driven and callable by other programs. I know this is a lot to ask, any help in pointing me in the right direction would be greatly appreciated. When I mention class creation to the existing staff they all say "Oh, we don't use or know anything about that object oriented stuff, we just right programs."
    Thanks,
    Tom
         New to SAP/ABAP-4
    2005-02-24 13:13:33 Thomas Jung Business Card [Reply]
    "we don't use or know anything about that object oriented stuff" That's something I might have expected to hear 4 years ago. That's kind of like saying that you only want to use half of the programming lanuage (the old half at that).
    However it is true that you have to learn to walk before you run. There are some fundamentals to ABAP that are usefull to have down before you start in with ABAP OO. But I wouldn't let that hold you back for long.
    I'm afraid that I wouldn't be able to teach you everything you would need to know to create a function module or a class in this posting. There was a nice weblog that was just posted the other day that had the steps to create your first simple class. I suggest you start there.
    As far as my FTP class goes, I don't mind sending you the code for the class. My email address is already all over SDN (and spammers' lists) so just send me the address that you want the details sent to. My email is [email protected].
         New to SAP/ABAP-4
    2005-02-24 13:05:42 Thomas Godfrey Business Card [Reply]
    I just read what I typed, I meant "write programs" not "right programs" ... duh
         Good suggestions - now...
    2004-11-24 09:15:27 Jacques Claassen Business Card [Reply]
    ...any chance you've used FTP via an HTTP proxy?
    Any help using the HTTP* functions in the ZFTP function group will be greatly appreciated. Any one?
    Thx
         Good suggestions - now...
    2004-11-24 09:59:11 Thomas Jung Business Card [Reply]
    I'm afraid I haven't done either. However I have used the HTTP client functionality in the WebAS 620 (if_http_client) along with an HTTP proxy. I have an example of this in another weblog.
         Pretty insightful
    2004-11-15 19:27:26 Subramanian Venkateswaran Business Card [Reply]
    Thanks for this weblog, and I can be pretty sure there are some(many) more weblogs in the waiting.
    Regards,
    Subramanian V.
         I have been using a local include ...
    2004-11-15 16:29:39 Swapan Sarkar Business Card [Reply]
    On the other hand I have been using a local include of ZCL_FTP_BASE in my programs for some time. Here's the signature:
    <quote>
    *& Include ZHR9_FTP_CLASSES
    *& Utility class ZCL_FTP_BASE having all the
    functions to upload and download files from an
    FTP server.
    CLASS zcl_ftp_base DEFINITION.
    PUBLIC SECTION.
    Output file type
    TYPES: BEGIN OF t_scratch,
    data(1024) TYPE c,
    END OF t_scratch,
    t_str_tab TYPE STANDARD TABLE OF t_scratch.
    CONSTANTS: co_crlf(2) TYPE x VALUE '0D0A'.
    DATA: status TYPE c VALUE space.
    METHODS: constructor IMPORTING im_user TYPE string im_pwd TYPE string
    im_server TYPE string,
    send_table_data IMPORTING im_file TYPE string
    im_table TYPE t_str_tab,
    get_table_data IMPORTING im_file TYPE string
    EXPORTING ex_table TYPE t_str_tab,
    send_string_data IMPORTING im_file TYPE string
    im_string TYPE string,
    get_string_data IMPORTING im_file TYPE string
    EXPORTING ex_string TYPE string,
    disconnect.
    PRIVATE SECTION.
    DATA: v_user(64) TYPE c,
    v_pwd_clear(30) TYPE c,
    v_pwd(64) TYPE c,
    v_server(30) TYPE c,
    v_filename TYPE rlgrap-filename,
    v_handle TYPE i.
    METHODS: pwd_scramble IMPORTING im_pwd TYPE c.
    ENDCLASS. "ZCL_FTP_BASE DEFINITION
    </quote>
    Showing messages 1 through 7 of 7.
    Pls. mark if this doc. is useful

  • FM or Way to validate Date format. The date is from TEXT File

    Dear All,
    I need to validate a date field whether it is in proper format.
    The field is coming from TEXT file to Internal table by using FM GUI_UPLOAD.
    Can any one give me the FM name or guide me how to do that?
    Definitely points will be given for correct solution.
    Thanks & Regards,
    Neeraj

    try the function module 'DATE_CHECK_PLAUSIBILITY'
      call function 'DATE_CHECK_PLAUSIBILITY'
           exporting
                date                      = '23.09.2007'
           exceptions
                plausibility_check_failed = 1
                others                    = 2.
      if sy-subrc <> 0.
        write:/ 'Please verify the date'.
        exit.
      endif.

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How to extract data from  text file to database table

    Hi ,
    I am trying to upload  data in text file to database table  using GUI_UPLOAD function .what would be the program for that.
    thanks in advance.

    Hi,
    I don't think you have a standard sap program to upload data from file to database table...
    Instead you can create a custom program like this..
    DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
    DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\TEST.TXT'
      tables
        data_tab                      = T_FILEDATA
    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.
    LOOP AT T_FILEDATA.
      T_ZTABLE = T_FILEDATA.
      APPEND T_ZTABLE.
    ENDLOOP.
    MODIFY ZTABLE FROM TABLE T_ZTABLE.
    COMMIT WORK..
    Thanks,
    Naren

  • Upload long text from excel file into internal table

    I need to upload service master(T-code : AC02) data alongwith long text.Now i have data in excel as: Service no(ASMD-ASNUM) and corresponding long text for it.
    I am facing problem in getting entire lontext from excel into my internal table.It only takes till 255 characters i think.Any help in this regard woulg be highly appreciable.

    hi,
    what is the maximum length of your long text.
    and you can try with more than 255 chars. in the internal table it will take , if you want check it.
    i'm in 4.7 ,5.0 version, what about you ..
    please check , you can upload even more than 255.
    try
    regards
    vijay

  • Import data from text file to a table using t-sql

    Hi,
    I am trying to import data from a text file to a table using the below query but it is returning an error.
    SELECT *, 2 FROM OPENROWSET(BULK 'W:\file.txt',
    FORMATFILE = 'W:\format_file.xml', FIRSTROW = 1, LASTROW = 1) as f
    The error is:
    Bulk load data conversion error (truncation) for row 1, column 1 (COPYRIGHT_DETAIL_CODE).

    <BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <RECORD>
      <FIELD ID="1" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="2" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="3" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="4" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="5" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="6" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="7" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="8" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="9" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="10" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="11" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="12" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="13" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="14" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="2" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="15" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="3" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="16" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="4" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="17" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="43" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
     </RECORD>
     <ROW>
      <COLUMN SOURCE="1" NAME="Name1" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="2" NAME="Name2" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="3" NAME="Name3" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="4" NAME="Name4" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="5" NAME="Name5" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="6" NAME="Name6" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="7" NAME="Name7" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="8" NAME="Name8" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="9" NAME="Name9" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="10" NAME="Name10" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="11" NAME="Name11" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="12" NAME="Name12" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="13" NAME="Name13" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="14" NAME="Name14" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="15" NAME="Name15" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="16" NAME="Name16" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="17" NAME="Name17" xsi:type="SQLVARYCHAR"/>
     </ROW>
    </BCPFORMAT>
    The format file that I am using is just like the same one above.
       

  • Upload data from flat file into internal table

    Hi friends,
    I want to upload the data from a flat file into internal table , but the problem is that all the columns in that flat file are seperated by "|" character instead of tabs.
    Plz help me out.........

    HEllo,
    DO like this.
      CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
      FILENAME = LV_FILENAME
      FILETYPE = 'ASC'
      HAS_FIELD_SEPARATOR = 'X'  " Check here
    * HEADER_LENGTH = '1'
    * READ_BY_LINE = 'X'
    * DAT_MODE = ' '
    * CODEPAGE = ' '
    * IGNORE_CERR = ABAP_TRUE
    * REPLACEMENT = '#'
    * CHECK_BOM = ' '
    * IMPORTING
    * FILELENGTH =
    * HEADER =
      TABLES
      DATA_TAB = IT_COJRNL
      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.
    VAsanth

  • Exporting data from text file to a table using utl_file

    Dear all,
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown               
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown     
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

    Dear all,
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown               
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown     
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

  • Data Migration from CSV file to Database Table.

    Hi,
    I have checked few answered threads on Data Migration Issues but didn't find the solution yet.
    I am reading data from an CSV file to internal table but the complete row is coming under one field of the internal table.
    How i can get values in different fields of the internal table from the CSV file ?
    Thanks & Regards.
    Raman Khurana.

    Hi,
    If you are using GUI_UPLOAD, you might have missed to make has_field_separator  as 'X'.
      EXPORTING
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       filename                      = 'C:\File.csv'
       filetype                      = 'ASC'
       has_field_separator           = ' X'  "<= Set this as 'X'.
      TABLES
        data_tab                      = itab.
    Regards,
    Manoj Kumar P

  • Data Transfer from Flat file To SAP system,

    Hi SAP Guru's,
    My query is :
    How to update Material master data by using idoc type MATMAS05 . The data is present in flat file at application server.
    I am  new to idoc area.Please provide me the sample program that how to update material master data by using standard idoc type.
    I am clear with the point that we have to read flat file from application server to internal table.
    But i got stucked at this point that how to update data from internal table data , by using standard idoc type MATMAS 05.
    I am in real need.Please provide me with the answer of this query.
    I will really appreciate your <<removed by moderator>> reply.
    Thanks
    Simran
    Edited by: Simran_SAP on Aug 25, 2010 10:46 AM
    Edited by: kishan P on Aug 25, 2010 4:36 PM

    Hi Vinod,
    Thanks for reply..
    I am new to idoc area.and my requirement is to generate the idoc after reading data from a flat file. The file is passed to the application server
    by a middleware . The SAP interface program reads the file from the application server and then starts processing the data. Please help me how to create the inbound IDoc and which FM needs to be used.
    Please provide a sample Program .
    This will really help..
    Waiting fr ur early response.
    Thanks
    Simran

Maybe you are looking for

  • Unable to modify color management

    I am using OSX 10.9.1 I am attempting to print photographs to a Canon Pixma printer The Instructions state that I need to change "Color Matching" from the drop down box from "ColorSynch" to "Canon Color Matching" While both selections appear, they ar

  • Can slide objects be customised across slides through one command?

    I have 2 questions regarding editing multiple slides. 1. Is it possible to change the default position and size of the slide numbers? Or if I change the size of the slide number to say, 36 and place it top centre, can I use that as a master for the r

  • Ideas Update available now

    Adobe Ideas 2.7 is here! Our new update includes several user-requested features to the free iOS application that lets anyone create freeform vector illustrations on their iPad, iPhone or iPod Touch. Here's what's new: Stylus Support – Ideas now incl

  • My problem deals with the url bar.

    Before switching to 5.0, I was able to type in let's say something like, "Imdb.com jack nicholson" into the url bar & I would end up on the actors Imdb profile, but now since I switched, it just re directs me the google search for his page. So, is th

  • Runtime Engine installer spawns from unrelated software

    Hello all, When I run a completely unrelated app (Quickbooks timer, in case you're wondering), Windows Installer launches and attempts to install LabVIEW 7.1 runtime engine. Has anyone else encountered this, and why would it occur? Is there an easy s