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.

Similar Messages

  • How to import data from a text file into a table

    Hello,
    I need help with importing data from a .csv file with comma delimiter into a table.
    I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
    I have not been able to find a simple instruction on how to use the Wizard.
    I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
    Neither one gave me enough instruction to be able to do the import successfully.
    Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
    Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
    For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
    For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
    What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
    I submitted the job and I got ORA-31619 invalid dump file error.
    I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
    I tried to use the "imp" utility in command-line window.
    After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
    C:\>imp
    Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Username: user1
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Import file: EXPDAT.DMP > c:\securParms\securParms.csv
    Enter insert buffer size (minimum is 8192) 30720> 8192
    IMP-00037: Character set marker unknown
    IMP-00000: Import terminated unsuccessfully
    Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
    We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
    I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
    I appreciate if someone could show me how to the import from a file into a table!
    Thanks,
    Mitra

    >
    I can say that anybody with
    no experience could easily do an export/import in
    MSSQLServer 2000.
    Anybody with no experience should not mess up my Oracle Databases !

  • Getting Issue while uploading CSV file into internal table

    Hi,
    CSV file Data format as below
         a             b               c              d           e               f
    2.01E14     29-Sep-08     13:44:19     2.01E14     SELL     T+1
    actual values of column   A is 201000000000000
                     and  columen D is 201000000035690
    I am uploading above said CSV file into internal table using
    the below coding:
    TYPES: BEGIN OF TY_INTERN.
            INCLUDE STRUCTURE  KCDE_CELLS.
    TYPES: END OF TY_INTERN.
    CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
        EXPORTING
          I_FILENAME      = P_FILE
          I_SEPARATOR     = ','
        TABLES
          E_INTERN        = T_INTERN
        EXCEPTIONS
          UPLOAD_CSV      = 1
          UPLOAD_FILETYPE = 2
          OTHERS          = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    am getting all columns data into internal table,
    getting problem is columan A & D. am getting values into internal table for both; 2.01E+14. How to get actual values without modifying the csv file format.
    waiting for your reply...
    thanks & regards,
    abhi

    Hi Saurabh,
    Thanks for your reply.
    even i can't double click on those columns.
    b'se the program needs be executed in background there can lot of csv file in one folder. No manual interaction on those csv files.
    regards,
    abhi

  • 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

  • How to load data in plain-text file into database by using EJB?

    Hi,
    We need to develop an on-line application which requires us to load input data
    from a selected plain-text file on the Web server (iplanet server) into the backend
    oracle database. How could I use EJB to make it happen? it seems like using Entity
    EJB is not feasible.
    Really appreciate your help!
    Corona

    Hi Corona,
    "Corona Fang" <[email protected]> wrote in message
    news:3f3b0ea3$[email protected]..
    We need to develop an on-line application which requires us to load inputdata
    from a selected plain-text file on the Web server (iplanet server) intothe backend
    oracle database. How could I use EJB to make it happen? it seems likeusing Entity
    EJB is not feasible.If you are talking about loading thousands of records,
    the preferable way is using plain JDBC calls utilizing
    batch methods.
    Regards,
    Slava Imeshev

  • Importing data from a text file into a table

    Hi Experts,
    I have the following flat file
    weekly_eft_repo  1.0                                                                                                       Page: 1
    CDC:00304 / Sat Oct-31-2009     Weekly EFT Sweep for 25/10/09 - 31/10/09  Effective Date 03/11/09         Sat Oct-31-2009 22:06:14
    Bill to
    Retailer Retailer Name                  Name on Bank Account           Bank ABA   Bank Acct            On-line Amount  Instant Amount  Total Amount
    ======== ============================== ============================== ========== ==================== =============== =============== ===============
    0200101 Triolet Popular Store          Triolet Popular Store          111111111  62030100130659            10,868.00            0.00       10,868.00
    0200103 Le Cacharel Snack              Le Cacharel Snack              111111111  62030100130813             9,728.00            0.00        9,728.00
    0200104 Advanced Co-operative Self Ser Advanced Co-operative Self Ser 111111111  111111111                  7,334.00            0.00        7,334.00
    0200105 Chez Popo Supermarket          Chez Popo Supermarket          111111111  61030100044898            30,932.00            0.00       30,932.00
    0200106 Vana Supermarket               Vana Supermarket               111111111  111111111                 17,775.00            0.00       17,775.00
    0200107 Mont Choisy Store              Mont Choisy Store              111111111  62030100130804             8,840.00            0.00        8,840.00
    0200108 Vijay Store                    Vijay Store                    111111111  62030100131229            16,416.00            0.00       16,416.00
    0200109 Neptune Confection             Neptune Confection             111111111  62030100130931            11,077.00            0.00       11,077.00
    0200110 Antoine Store                  Antoine Store                  111111111  111111111                  2,470.00            0.00        2,470.00
    0200111 P.S.C Cold Storage             P.S.C Cold Storage             111111111  111111111                 10,431.00            0.00       10,431.00
    0200113 Mini Prix Boutique             Mini Prix Boutique             111111111  62030100131501            26,315.00            0.00       26,315.00
    0200114 Hotel Cassim                   Hotel Cassim                   111111111  111111111                135,147.00            0.00      135,147.00
    0200116 Aman Snack                     Aman Snack                     111111111  62030100129481             7,334.00            0.00        7,334.00
    0200117 Best For Less Company Ltd      Best For Less Company Ltd      111111111  111111111                  3,325.00            0.00        3,325.00
    0200118 Central Way                    Central Way                    111111111  111111111                 25,137.00            0.00       25,137.00I need to insert the data it contains into the following table
    TABLE weekly_eft_report_temp
    Name                                      Null?    Type                       
    BILL_TO_RETAILER                          NOT NULL VARCHAR2(15)               
    RETAILER_NAME                                      VARCHAR2(100)              
    NAME_ON_BANK_ACCOUNT                               VARCHAR2(100)              
    BANK_ABA                                           VARCHAR2(1)                
    BANK_ACCT                                          VARCHAR2(1)                
    ON_LINE_AMOUNT                                     NUMBER                     
    INSTANT_AMOUNT                                     NUMBER                     
    TOTAL_AMOUNT                                       NUMBER Whats the easiest and best way to proceed on that?
    Thanks
    Kevin

    I am with Chris on this one.
    If those headers are repeating in your text file, you could run a simple script to cleanse the data first and make the file fit for SQL*Loader.
    Here's an example with Perl, I hope the header of Page 2 and onwards resembles what you have in your file. I've snipped some data from the far right so that it fits on my terminal screen:
    $
    $ # show the contents of the data file
    $
    $ cat report.dat
    weekly_eft_repo  1.0                                                                                        Page: 1
    CDC:00304 / Sat Oct-31-2009 Weekly EFT Sweep for 25/10/09 - 31/10/09  Effective Date 03/11/09 Sat Oct-31-2009 22:06:14
    Bill to
    Retailer Retailer Name                  Name on Bank Account           Bank ABA   Bank Acct            On-line Amount
    ======== ============================== ============================== ========== ==================== ===============
    0200101 Triolet Popular Store          Triolet Popular Store          111111111  62030100130659            10,868.00
    0200103 Le Cacharel Snack              Le Cacharel Snack              111111111  62030100130813             9,728.00
    0200104 Advanced Co-operative Self Ser Advanced Co-operative Self Ser 111111111  111111111                  7,334.00
    0200105 Chez Popo Supermarket          Chez Popo Supermarket          111111111  61030100044898            30,932.00
    0200106 Vana Supermarket               Vana Supermarket               111111111  111111111                 17,775.00
    weekly_eft_repo  1.0                                                                                        Page: 2
    CDC:00304 / Sat Oct-31-2009 Weekly EFT Sweep for 25/10/09 - 31/10/09  Effective Date 03/11/09 Sat Oct-31-2009 22:06:14
    Bill to
    Retailer Retailer Name                  Name on Bank Account           Bank ABA   Bank Acct            On-line Amount
    ======== ============================== ============================== ========== ==================== ===============
    0200107 Mont Choisy Store              Mont Choisy Store              111111111  62030100130804             8,840.00
    0200108 Vijay Store                    Vijay Store                    111111111  62030100131229            16,416.00
    0200109 Neptune Confection             Neptune Confection             111111111  62030100130931            11,077.00
    0200110 Antoine Store                  Antoine Store                  111111111  111111111                  2,470.00
    0200111 P.S.C Cold Storage             P.S.C Cold Storage             111111111  111111111                 10,431.00
    weekly_eft_repo  1.0                                                                                        Page: 3
    CDC:00304 / Sat Oct-31-2009 Weekly EFT Sweep for 25/10/09 - 31/10/09  Effective Date 03/11/09 Sat Oct-31-2009 22:06:14
    Bill to
    Retailer Retailer Name                  Name on Bank Account           Bank ABA   Bank Acct            On-line Amount
    ======== ============================== ============================== ========== ==================== ===============
    0200113 Mini Prix Boutique             Mini Prix Boutique             111111111  62030100131501            26,315.00
    0200114 Hotel Cassim                   Hotel Cassim                   111111111  111111111                135,147.00
    0200116 Aman Snack                     Aman Snack                     111111111  62030100129481             7,334.00
    0200117 Best For Less Company Ltd      Best For Less Company Ltd      111111111  111111111                  3,325.00
    0200118 Central Way                    Central Way                    111111111  111111111                 25,137.00
    $
    $
    $ # snip off the headers using Perl so that the transformed file has just the data to load
    $
    $ perl -lne 'BEGIN{$/=""} s/^weekly.*?=\n//msg; print' report.dat
    0200101 Triolet Popular Store          Triolet Popular Store          111111111  62030100130659            10,868.00
    0200103 Le Cacharel Snack              Le Cacharel Snack              111111111  62030100130813             9,728.00
    0200104 Advanced Co-operative Self Ser Advanced Co-operative Self Ser 111111111  111111111                  7,334.00
    0200105 Chez Popo Supermarket          Chez Popo Supermarket          111111111  61030100044898            30,932.00
    0200106 Vana Supermarket               Vana Supermarket               111111111  111111111                 17,775.00
    0200107 Mont Choisy Store              Mont Choisy Store              111111111  62030100130804             8,840.00
    0200108 Vijay Store                    Vijay Store                    111111111  62030100131229            16,416.00
    0200109 Neptune Confection             Neptune Confection             111111111  62030100130931            11,077.00
    0200110 Antoine Store                  Antoine Store                  111111111  111111111                  2,470.00
    0200111 P.S.C Cold Storage             P.S.C Cold Storage             111111111  111111111                 10,431.00
    0200113 Mini Prix Boutique             Mini Prix Boutique             111111111  62030100131501            26,315.00
    0200114 Hotel Cassim                   Hotel Cassim                   111111111  111111111                135,147.00
    0200116 Aman Snack                     Aman Snack                     111111111  62030100129481             7,334.00
    0200117 Best For Less Company Ltd      Best For Less Company Ltd      111111111  111111111                  3,325.00
    0200118 Central Way                    Central Way                    111111111  111111111                 25,137.00
    $
    $ You could do an inline substitution with Perl, or redirect it to a temp file and then move back to the original file. In either case, you have just the relevant data for the next step.
    Again, Perl is just one option. On Unix/Linux systems, you have a large number of utilities/scripting languages that can perform almost any kind of data transformation.
    HTH,
    isotope

  • FM to upload TAB DELIMITED TEXT file into Internal table.

    Hello Friends,
    The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' is used to upload EXCEL file into a Internal table.
    Is there any FM which performs the simillar operation on TAB DELIMITED TEXT FILE.
    Thanks in advance!
    Ashish

    Hi,
    To upload text file with tab delimated you can use FM
    GUI_OPLOAD.
    In this function you have put X in the field HAS_FIELD_SEPARATOR.
    Regards,
    Sujit

  • 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

  • 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

  • How to convert xml file into internal table in ABAP Mapping.

    Hi All,
    I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
      <BookingCode>2KY34R</BookingCode>
    - <Passenger>
      <Name>SARVESH</Name>
      <Address>THANE</Address>
      </Passenger>
    - <Passenger>
      <Name>RAJESH</Name>
      <Address>POWAI</Address>
      </Passenger>
    - <Passenger>
      <Name>CARRON</Name>
      <Address>JUHU</Address>
      </Passenger>
    - <Flight>
      <Date>03/03/07</Date>
      <AirlineID>UA</AirlineID>
      <FlightNumber>125</FlightNumber>
      <From>LAS</From>
      <To>SFO</To>
      </Flight>
      </ns0:MTO_ABAP_MAPPING>
    AT the receiver side I wnat to concatenate the NAME & ADDRESS.
    I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
    but couldnt succeed to convert the xml file into internal table perfectly.
    Can anybody help on this. 
    Thanks in advance!!
    Sarvesh

    Hi Sarvesh,
    The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    Just in case you have not seen this
    regards
    Vijaya

  • Question about reading csv file into internal table

    Some one (thanks those nice guys!) in this forum have suggested me to use FM KCD_CSV_FILE_TO_INTERN_CONVERT to read csv file into internal table. However, it can be used to read a local file only.
    I would like to ask how can I read a CSV file into internal table from files in application server?
    I can't simply use SPLIT as there may be comma in the content. e.g.
    "abc","aaa,ab",10,"bbc"
    My expected output:
    abc
    aaa,ab
    10
    bbb
    Thanks again for your help.

    Hi Gundam,
    Try this code. I have made a custom parser to read the details in the record and split them accordingly. I have also tested them with your provided test cases and it work fine.
    OPEN DATASET dsn FOR input IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET dsn INTO record.
      PERFORM parser USING record.
    ENDDO.
    *DATA str(32) VALUE '"abc",10,"aaa,ab","bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"bbc"'.
    *DATA str(32) VALUE '"a,bc","aaaab",10,"bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"b,bc"'.
    *DATA str(32) VALUE '"abc","aaaab",10,"bbc"'.
    FORM parser USING str.
    DATA field(12).
    DATA field1(12).
    DATA field2(12).
    DATA field3(12).
    DATA field4(12).
    DATA cnt TYPE i.
    DATA len TYPE i.
    DATA temp TYPE i.
    DATA start TYPE i.
    DATA quote TYPE i.
    DATA rec_cnt TYPE i.
    len = strlen( str ).
    cnt = 0.
    temp = 0.
    rec_cnt = 0.
    DO.
    *  Start at the beginning
      IF start EQ 0.
        "string just ENDED start new one.
        start = 1.
        quote = 0.
        CLEAR field.
      ENDIF.
      IF str+cnt(1) EQ '"'.  "Check for qoutes
        "CHECK IF quotes is already set
        IF quote = 1.
          "Already quotes set
          "Start new field
          start = 0.
          quote = 0.
          CONCATENATE field '"' INTO field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            CONDENSE field.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
    *      WRITE field.
        ELSE.
          "This is the start of quotes
          quote = 1.
        ENDIF.
      ENDIF.
      IF str+cnt(1) EQ ','. "Check end of field
        IF quote EQ 0. "This is not inside quote end of field
          start = 0.
          quote = 0.
          CONDENSE field.
    *      WRITE field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CONCATENATE field str+cnt(1) INTO field.
      cnt = cnt + 1.
      IF cnt GE len.
        EXIT.
      ENDIF.
    ENDDO.
    WRITE: field1, field2, field3, field4.
    ENDFORM.
    Regards,
    Wenceslaus.

  • Uploading CSV file into internal table

    Hi,
    I want to upload a CSV file into internal table.The flat file is having values as below:
    'AAAAA','2003-10-11 07:52:37','167','Argentina',NULL,NULL,NULL,NULL,NULL,'MX1',NULL,NULL,'AAAA BBBB',NULL,NULL,NULL,'1',NULL,NULL,'AR ',NULL,NULL,NULL,'ARGENT','M1V','MX1',NULL,NULL,'F','F','F','F','F',NULL,'1',NULL,'MX','MMI ',NULL
    'jklhg','2004-06-25 08:01:57','456','hjllajsdk','MANAGUA   ',NULL,NULL,'265-5139','266-5136 al 38','MX1',NULL,NULL,'hjgkid GRÖBER','sdfsdf dfs asdfsdf 380 ad ased,','200 as ads, sfd sfd abajao y 50 m al sdf',NULL,'1',NULL,NULL,'NI ',NULL,NULL,NULL,'sdfdfg','M1V','dds',NULL,NULL,
    Here I can not even split at ',' because some of the values are having value like NULL and some have values with comma too,
    The delimiter is a quote and the separator is a comma here.
    Can anyone help on this?
    Thanks.
    Edited by: Ginger on Jun 29, 2009 9:08 AM

    As long as there can be a comma in a text literal you are right that the spilt command doesn't help. However there is one possibility how to attack this under one assumption:
    - A comma outside a text delimiter is always considered a separator
    - A comma inside a text delimiter is always considered a comma as part of the text
    You have to read you file line by line and then travel along the line string character by character and setting a flag or counter for the text delimiters:
    e.g.
    "Text","Text1, Text2",NULL,NULL,"Text"
    String Index  1: EQ " => lv_delimiter = 'X'
    String Index  2: EQ T => text literal (because lv_delimiter = 'X')
    String Index  3: EQ e => text literal (because lv_delimiter = 'X')
    String Index  4: EQ x => text literal (because lv_delimiter = 'X')
    String Index  5: EQ t => text literal (because lv_delimiter = 'X')
    String Index  6: EQ " => lv_delimiter = ' ' (because it was 'X' before)
    String Index  7: EQ , => This is a separator because lv_delimiter = ' '
    String Index  8: EQ " => lv_delimiter = 'X' (because it was ' ' before)
    String Index  9: EQ T => text literal (because lv_delimiter = 'X')
    String Index 10: EQ e => text literal (because lv_delimiter = 'X')
    String Index 11: EQ x => text literal (because lv_delimiter = 'X')
    String Index 12: EQ t => text literal (because lv_delimiter = 'X')
    String Index 13: EQ 1 => text literal (because lv_delimiter = 'X')
    String Index 14: EQ , => text literal (because lv_delimiter = 'X')
    String Index 15: EQ T => text literal (because lv_delimiter = 'X')
    Whenever you hit a 'real' separator (lv_delimiter = ' ') you pass the value of the string before that up to the previous separator into the next structure field.
    This is not an easy way to do it, but if you might have commas in your text literal and NULL values I gues it is probably the only way to go.
    Hope that helps,
    Michael

  • Uploading excel file into internal table

    Hi,
    Any function module is there to upload an excel file into internal table in CRM 7.0 system?
    Thanks.

    Hi Ginger,
    If u have access to ECC R/3 make use FM 'TEXT_CONVERT_XLS_TO_SAP' source code which is existing to convert to Excel to Internal table.  It will work in CRM also.
    As of Now I don't have access to SAP S/m. Mean while u can try as above said.
    Regards,
    Lokesh B

  • How do you read data from a text file into a JTextArea?

    I'm working on a blogging program and I need to add data from a text file named messages.txt into a JTextArea named messages. How do I go about doing this?

    Student_Coder wrote:
    1) Read the file messages.txt into a String
    2) Initialize messages with the String as the textSwing text components are designed to use Unix-style linefeeds (\n) as line separators. If the text file happens to use a different style, like DOS's carriage-return+linefeed (\r\n), it needs to be converted. The read() method does that, and it saves the info about the line separator style in the Document so the write() method can re-convert it.
    lethalwire wrote:
    They have 2 different ways of importing documents in this link:
    http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
    Neither of those methods applies to JTextAreas.

  • How to do import data from the text file into the mathscript window?

    Could anyone tell me how to do import data from text file into mathscript window for labview 8?
    MathScript Window openned, File, Load Data - it has options: custom pattern (*.mlv) or all files. 
    Thanks

    Hi Milan,
    Prior to loading data in Mathscript Window , you have to save the data from the Mathscript window (the default extension of the file is .mlv but you can choose any extension). This means that you cannot load data from a text file  that was not created using the Mathscript window.
    Please let me know if you have any further questions regarding this issue.
    Regards,
    Ankita

Maybe you are looking for

  • Using long text in Mobile 7.1

    Hello, We are using Mobile 7.1. We want to display a long text of the notification object in the Mobile Client. We defined this field as STRING data type in the DOE and set TEXT MEMO flag for it. Unfortunately we have a problem with its definition in

  • Iphone 5 shows 7GB used in the "Other" section

    When I have my Iphone5 connected to my PC for Syncing purposes, the yellow part of the bar (Other) shows 7.09GB of space used. I can't imagine what this includes. It prevents me from putting much music on the phone. I have very few photos,no podcasts

  • Photo Backup and Deletion

    My daughter has a 16MB iPhone 5 and needs to free up storage space.  Clearly her photos are what is taking up significant space.  What is the easiest and safest way to backup and then delete photos off of her iPhone......and NOT lose any of them!

  • Regarding Insert command

    Dear guys, I have internaltable with 10 fields with different data types. and i have addontable with 8 fields(with differnt data type) Now i want to insert records from internal table to addontable.which will be the best way. I have done as below..pl

  • PDF driver only print .prn

    I've done a search and can't find any thing about this. When selecting "Adobe PDF" in the File--->Print section of any Office App (Word, Powerpoint, etc) Adobe asks where I would like the PDF file saved, but the only option in the File Type drop down