Problems about reading Japanese and writing Chinese

Hi all experts,
Now I have a encoding problem.
My task is, read some Japanese in a text-based file, and then replace that Japanese with a Chinese string.
That means, the program must be able to understand both the Japanese encoding and the Chinese encoidng. But the dilemma is that, in the OS I am using (Windows), you can only have one locale at a time. If you set your OS locale to Chinese, the program is able to write Chinese, but it cannot properly detect the Japanese. On the othe hand, if you set your OS locale to Japanese, the program is able to detect Japanese, but it cannot properly write Chinese.
So can any one help me get around this problem (for instance, there is some special API dealing with encodings and so on)?
Thanks a lot!

InputStreamReader and OutputStreamWriter constructors both accept parameters to specify the encoding of the data stream.
The New IO (NIO) classes have these and additional capabilities, including converting from one encoding to another using code like this:
Charset charset = Charset.forName("ISO-8859-1");
CharsetDecoder decoder = charset.newDecoder();
CharBuffer charBuffer = decoder.decode(buffer);Look at the java.nio.charset package.

Similar Messages

  • Problem About J2EE RI and PetStore Demo

    Hello ^^
    I have a problem about j2ee & petstore.
    I trird to set up sun j2ee RI 1.3.1 + pet store on win2000 or redhat.
    Everything run ok. But when I changed web port 8000 to any port (included
    80),
    j2ee ri server showed the error message below :
    java.net.ConnectException: Connection refused: connect
    java.security.PrivilegedActionException: javax.servlet.ServletException:
    An error occurred while evaluating custom action attribute "items" with
    value "${catalog.categories.list}": An error occurred while getting
    property "categories" from an instance of class
    com.sun.j2ee.blueprints.catalog.client.CatalogHelper
    I used root to start j2ee & cloudscape on linux,
    and changed database to postgresql, too.
    but the error is the same.
    How to solve this problem ??
    Thank you ~~
    Jovi

    Hi,
    I dont know how useful my reply would be since the question was posted about 2 yrs back, but just wanted to reply in case somebody faces the same problem.
    If you change the web port to some other port (other than 8000) then please check the sun-j2ee-ri.xml files. Actually the CatalogDAOSQL.xml is read using a url which includes the port you are running the server on. So, you need to change the port even in the sun-j2ee-ri.xml file.
    One of the sun-j2ee-ri.xml files, where you need to make the change is in the $PETSTORE_HOME/src/apps/petstore/src/sun-j2ee-ri.xml file.
    Other one is in $PETSTORE_HOME/src/apps/supplier/src/sun-j2ee-ri.xml file.
    Look for other sun-j2ee-ri.xml files where the url is hardcoded. (I think the two sun-j2ee-ri.xml files mentioned above, are the only places you need to make the change, but still look for other files in case i have missed)
    Change those urls and redeploy the ears.
    Hope this solves the problem.
    Regards,
    Archit

  • The problem about  integrate  Portal and R/3

    Hi everyone :
       We want to achieve that our vendor can query R/3 report via our Portal. I had done SSO configuration.
       But we had about 500 vendors, it is impossible that we create 500 R/3 users for our vendors,  because the cost is too much .
       And there is another problem, vendor who had the authorization to query report can query the other vendor's data at same time. But we expect that certain vendor can query his data only.
       I think this is a general problem when integrate Portal and R/3, BW .
       Is there somebody had solved this problem or give any advice?
       Any discuss is welcome.
    Best Regards,
    Jianguo Chen

    Hi,
    I would say: get in contact with your SAP account manager anc check which options SAP can offer you...
    Normally every user using a R/3 system has to have a valid user license in that system. Expecially when you want to access control to data on user (vendor) level you nedd to identifiy the user clearly and uniquely which by standard means you need a user for every vendor.
    Hth,
    Michael

  • The problem about  integrate  Portal and R/3 : vendor query report problem

    Hi everyone :
       We want to achieve that our vendor can query R/3 report via our Portal. I had done SSO configuration.
       But we had about 500 vendors, it is impossible that we create 500 R/3 users for our vendors,  because the cost is too much .
       And there is another problem, vendor who had the authorization to query report can query the other vendor's data at same time. But we expect that certain vendor can query his data only.
       I think this is a general problem when integrate Portal and R/3, BW .
       Is there somebody had solved this problem or give any advice?
       Any discuss is welcome.
    Best Regards,
    Jianguo Chen

    Hi,
    I would say: get in contact with your SAP account manager anc check which options SAP can offer you...
    Normally every user using a R/3 system has to have a valid user license in that system. Expecially when you want to access control to data on user (vendor) level you nedd to identifiy the user clearly and uniquely which by standard means you need a user for every vendor.
    Hth,
    Michael

  • Problem with Reader download and McAfee

    I am the administrator of a small charity with a number of very naive users. They need to be able to read PDFs and so must have a PDF reader. I can tell them the link to download the Adobe Reader but unless they untick the McAfee box they will install McAfee. Most of them will then be thrown in unrecoverable confusion. It's no great help if I warn them that they need to untick the McAfee box - many will forget. And uninstalling McAfee will be way beyond many of them.
    Is there a link I can give them which will enable them to download the Reader without getting McAfee by default?
    I could find an alternative non-Adobe reader and give them the link to that, but there is a further complication that we have got some more competent users who need to edit and return the PDFs I send them. Is there an alternative product which would enable them to do that?
    I don't want to have to provide two links, one for naive users to a non-Adobe reader and the other for more competent users to the Adobe Reader with a warning about unticking McAfee.

    Many thanks to Pat for the very prompt response.
    I followed the link suggested by Pat and requested the right to distribute the Reader as the Administrator of the charity. The email granting the right gave me a link to a window from which I was able to download the Installer for the Reader, an executable file, without having to untick McAfee. That is what I would like our members to be able to do, but it seems to me that the only person allowed to use this link is me as the Administrator - I don’t think I can pass it on to the members.
    I think that instead I am expected to pass the installer executable file to the members. The email says I would do that, for example, as a download bundled in with the Distributer’s installer. We don’t have anything like that. I assume that in principle I could attach the file to an email and send it to the members, but it is far too large for an email attachment. Other means of getting it to the members, such as a private Dropbox, would get too complicated for our least technically able members.
    I can’t find any way to email Adobe Support about this, so hope that pat or other people in this group might have some ideas.

  • Problems Installing Reader X and FlashPlayer on Mac running 10.7.3

    Attempted to install both Reader X and Flashplayer on two new Macs, both running 10.7.3. Downloads went without a problem. Unfortunately, installations begin but never complete. No error messages are posted, the installer simply never completes. No antivirus SW installed. Was able to download Reader 9.

    Grab the install.log file for Acrobat located at "/var/log/install.log". 
    Paste the contents in the forum.
    I'm guessing but you probably have a perms issue somewhere interfering with the installation.

  • About DAQ task and writing to a line

    Hi all,
      I swtich from Labview to Labwindows and switch from traditional DAQ to DAQmx. I have two questions about using the DAQmx. Based on the example from NI, I write a function for a single sample output to a single digitial line
    void WriteLine(int zero_or_one, char line_name[])
    int error=0;
    TaskHandle taskID=0;
    char errBuff[256];
    DAQmxErrChk(DAQmxCreateTask("", &taskID));
    DAQmxErrChk(DAQmxCreateDOChan(taskID, line_name, "", DAQmx_Val_ChanPerLine ));
    DAQmxErrChk(DAQmxStartTask(taskID));
    DAQmxErrChk(DAQmxWriteDigitalLines(taskID, 1, 1, 10.0, DAQmx_Val_GroupByChannel, &zero_or_one, NULL, NULL));
    Error:
    if (DAQmxFailed(error)) DAQmxGetExtendedErrorInfo(errBuff, 2048);
    if (taskID!=0)
    DAQmxStopTask(taskID);
    DAQmxClearTask(taskID);
     I am calling this function to a single digital channel. For example, WriteLine(0, "Dev1/port0/line0");. I wonder if above code really writing to a single line or a port (8 lines). I have 4 cables connecting 4 digital lines of one port to 4 external device (so to control the on/off of the device). I use the above code to control one line but don't know why seems sometimes there are something output to other three lines.
    The second question is: now every time I write to a line, I call above code, so it will create the task each time even I just write one bit to one line. In my code, write to the lines pretty often, so how much it cost to create task every time before I write to a channel? Should I create one task for each channel upon the initialization of the program and clear them when the code closed? I just wonder how labview do that? In labview, will it create the task on each writing?

    RobertoBozzolo wrote:
    Creating and destroying a task is a relatively time consuming activity, so if you need to write to the digital lines very frequently it is advisable that you create the task at program start and destroy it at the end, leaving only the start/stop inside the write function.
    As of my knowledge, LabVIEW can be structured in a similar way if you use low level functions, while it creates and destroys the task if you use a DAQ assistant (there is a note on this in the help).
    With reference to your last question, you could have a single task for analog generation and simply set the appropriate rate with calling DAQmxCfgSampClkTiming before starting the task.
    Thanks RobertoBozzolo. I am still in confusion regarding the analog output in DAQmx. I have an array of samples (totally 512 samples), I need to send to a specifc analog channel (A0) such that each sample will be sent at the interval 1millisecond. From your link, I use DAQmxCfgSampClkTiming
    int error=0;
    TaskHandle taskid;
    double samples[512];
    // initialize samples here
    DAQmxCreateTask("mytask", &taskid);
    DAQmxCreateAOVoltageChan(taskid, "Dev2/ao0","",-10,10,DAQmx_Val_Volts,NULL);
    DAQmxCfgSampClkTiming(taskid, NULL, 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 512); // sample rate is 1000, so 1sample/ms, 512 samples in total
    DAQmxWriteAnalogF64(taskid, 512,0, 10, DAQmx_Val_GroupByChannel, samples, NULL, NULL);
    // I don't start the task automatically
    // some other time-consuming code here
    // after other code running, I start it manually
    DAQmxStartTask(taskid);
    DAQmxWaitUntilTaskDone(taskid, 10.0);
    DAQmxStopTask(taskid);
     I wonder if this code looks right? There are 512 samples to send, so I set the numSampsPerChan in DAQmxWriteAnalogF64 to 512, is that correct? 
    The same channel will be used for other output also. So after the above task done, if I want to send one sample instead of 512 to the same channel, does the following code work?
    double one_sample_value = 0.2;
    DAQmxStartTask(taskid);
    DAQmxWriteAnalogScalarF64(taskid, 1, 10.0, one_sample_value,NULL);
    DAQmxStopTask(taskid);
     What I am asking is do I have to reset the timing since it was set for outputing multiple sample at some rate before but now I only have to send one sample immediately, so does the time or update rate matter?
    I am porting a big system which written in Labview 8 to CVI but there are so many code needed to be changed, I don't even know how to tell if the DAQ do the same thing or not. So I separate it as above code for testing.

  • A problem about reading from serial port

    Hi,
       I just sent '0x03' from MCU to PC continuously, and then sent  '/n' as a stop character after every '0x03'. I use labview to read the data. The problem is when it get two '03' it get a '0', another two '03' and another a '0'. I don't know where is the '0' from?
      PS: Hyper terminal can display natrually.
       Thank you! 
    帖子被hengfo在08-08-2007 10:14 PM时编辑过了
    Attachments:
    serial read.vi ‏36 KB

    I think the problem may be the loop reading the serial port is running too fast.  There is no timing delay in the loop, so you are reading it as fast as you can, and probably faster than the device is sending data.  So sometimes the buffer is empty, and then the empty string gets converted to a numeric zero.  The way to know for sure is to put an indicator on the error wire coming out of the serial port read.  I bet you will see errors about the read buffer being empty.
    Put a wait timer in the loop to slow down the execution just slightly.  This is a good idea so that LV doesn't eat up all the CPU resources.  Look at the example for Basic Serial Write and Read.  You may want to have a loop ahead of the read that waits until there are a certain number of bytes at the port before it reads the serial port.  You may want to put a loop around the serial port that waits until a valid number is read in before it exits the loop and goes to the numeric conversion.
    Message Edited by Ravens Fan on 08-09-2007 08:50 AM

  • Problem with Searching file and writing

    Hi guys,
    i m writing a program to search for a file and if the file exists it will write .
    otherwise printing astatement saying file not found.
    i m passing directory name as an argument.
    in tht there are many ip files.
    the program will search for a particular file in all the zip files.
    i m passing arguments are
    <directory-name> <search-file-name>
    the code is finding the particular file but its not writing to another file.
    i m getting exception as Filenot found.. the code as follows:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Enumeration;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    import java.io.*;
    public class SearchFile {
    public static void main(String args[]) {      
         try{
         Testme(args[0],args[1]);
         catch(Exception e){System.out.println(e);}
    public static void Testme(String lists,String sfile)
         File dir = new File(lists);
    File[] children = dir.listFiles();
         int length =children.length;
    if (length < 0) {
    System.out.println("sorry No files found");
    } else {
    for (int i=0; i<length; i++) {
    // Get filename of file or directory
    File fl=children;
              System.out.println("the File name is "+fl.getName());
                        if(fl.getName().endsWith(".zip"))
                   //System.out.println("The zipped files are"+filename);
                   SearchZip(fl,sfile);
    public static void SearchZip(File zipfile,String searchfile)
              //System.out.println("welcome"+zipfile);
              boolean state=false;
    try {
         int count=0;
              ZipFile zf = new ZipFile(zipfile);
              System.out.println("----------------------------");
              System.out.println("Searching in "+zipfile);
              Enumeration entries = zf.entries();
              //System.out.println("the passed file File name is "+args[1]);
              while (entries.hasMoreElements()) {
              ZipEntry ze = (ZipEntry) entries.nextElement();
              System.out.println("----------------------------");
              System.out.println("Listing FIles " + ze.getName() );
              String files=ze.getName();
              System.out.println("----------------------------");
              File f = new File("geetha.txt");
              byte[] buf = new byte[8184];
              String inputLine = "y";
              if (inputLine.equalsIgnoreCase("y")) {
                   long size = ze.getSize();
                   if (size > 0) {
                        System.out.println("name is " files "size is"+ size);
                        BufferedReader br = new BufferedReader(
                             new InputStreamReader(zf.getInputStream(ze)));
                        String line;
                        if(files.equals(searchfile))
                             System.out.println("File Found...............");
                             FileInputStream in = new FileInputStream(files);
                             FileOutputStream out = new FileOutputStream(f);
                             int len;
                        while ((len = in.read(buf)) > 0) {
                             state=true;
                        out.write(buf, 0, len);
                        System.out.println("successfully Written the file");
                        System.out.println("The File Found is "+state);
              catch (Exception e) {
              System.out.println("File Not Found Please check the File"+e);

    This is a multipost of http://forum.java.sun.com/thread.jspa?threadID=692507&tstart=0
    Please return to that thread Santhosh as you have been given a couple of answers already in that thread.

  • Several Problems about setting tabs and MMS

    Hello,
    I have recently started using my Unlocked Iphone 4 with T-mobile and have encountered a few problems.
    1.) I am missing a few settings such as network, MMS, cellular editting, ect.
    2.) My phone perfers Edge over 3g and only picks up 3g when I am on the road.
    3.) my Phone drops connection a lot and goes into "searching..."
    4.) I can not group chat BUT I am still able to text
    How would I be able to fix the problems at hand?
    Would I be able to go to the genius bar even if I bought my iphone on craigslist? I still have the original SIM from the owner.

    brianhasazoo wrote:
     2.) My phone perfers Edge over 3g and only picks up 3g when I am on the road.
    NO, not entirely correct.  TMO has a very limited 3G network that is compatible with the iPhone.  This is one of the downsides of using an iPhone on TMO.  Until TMO upgrades their network to provide more 3G coverage that is compatible with the iPhone, users with iPhones will be restricted to the EDGE network.

  • Problem to read/write and Analyse/Regenerate Signal

    hey,
    i would like to do a complex platform. i have a RF signal, i would like to save it in a binary File (like TDMS file) and after that, i would like to regenerate it, but i have a problem with that.
    My configuration: Labview 8.5 with modulation toolkits, OS Windows XP, PXI-5660 (Analyser) and PXI-5670 (Generator) 
    Find two VIs attached, please help me 
    Seb_MDI
    France
    Attachments:
    Save_read_test_dynamique_trigger_IQ.vi ‏87 KB
    read_emit_test_dynamique_IQ.vi ‏87 KB

    Hello,
    You can use the Arbitrary Waveform Generation Mode, in order to generate custom data with your RF signal generator.
    You will find an example doing this with a simple file : LabVIEW » Help » Example Finder and look for RFSG Write Signal From File.vi
    This will help you do what you want. You will have to retrieve the data from your TDMS file like it is done in the example with binary files.
    Have a nice day.
    Regards,

  • Problem ACS reader ACR128 and card JCOP 3.1

    Hi I have problem with ACS ACR 128U reader and card with JCOP3x JCOP4x.
    When I load applet throud ICC or SAM interface eclipse write ERROR.
    When I use Reader Omnikey CardMAn 5321 or PICC interface all is OK.
    terminal "winscard:4|ACS ACR128U ICC Interface 0"
    --Opening terminal
    /card+--Waiting for card...+
    +ATR=3B FA 18 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 ;.....1.EJCOP41V+
    +32 32 31 9D 221.+
    +ATR: T=1, FI=1/DI=8 (31clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP41V221"+
    +> 00 A4 04 00 07 A0 00 00 00 03 00 00 00 .............+
    +jcshell: Unable to select Card Manager or invalid FCI: Unknown Global Platform Java Card.+
    +Subsequent commands might fail! Inspection might not be possible!+
    +> /terminal "winscard:4|OMNIKEY CardMan 5x21 0"+
    +--Opening terminal+
    +> /card+
    +--Waiting for card...+
    +ATR=3B FA 18 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 ;.....1.EJCOP41V+
    +32 32 31 9D 221.+
    +ATR: T=1, FI=1/DI=8 (31clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP41V221"+
    +> 00 A4 04 00 07 A0 00 00 00 03 00 00 00 .............+
    +(152585 usec)+
    +> 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 o..............e+
    +01 FF 90 00 ....+
    +Status: No Error+
    ++
    PCSC function SCardTransmit return 0x0000045d
    I dont knou where is problem.
    Thanks
    Edited by: martan007 on Nov 10, 2009 5:45 AM

    the problem is the reader/firmware/driver
    my advice: don't use an ACR128 or an ACR122.
    These readers are bad, we only have problems with them here.
    use an omnikey or a SDI (sdi010 is my friend)
    regards

  • Problem with intermittent sampling and writing to file(s)

    I am describing the functionality that I am trying to achieve via the attached VI.
    The VI opens with a sequence structure. In the first sequence step analog output voltages for 2 AO channels are set
    The next sequence step consists of analog data acquisition
    Custom linear scales for 3 input channels are specified, to convert input ‘volts’ to respective physical quantity being measured
    The input voltage signal is with +/- 10V but the physical quantity (forces) are greater than 10N
    The headers for the data files are created as strings
    The acquisition is set for finite sample acquisition
    The VI is set for periodic acquisition, wherein the data is acquired for specific time period given by ‘Sampling on’ and then ignored for time period specified by ‘Interval off’.
    The VI is set to write instantaneous data to multiple files. Each time the While loop is executed the instantaneous data, number of samples read (sampling rate x Sampling on time),  is written to a ‘.dat’ file.
    Statistical operations on data collected for each While loop execution is performed. These values (average & st. dev) are then written to another file ‘*.sum’ with respective headers
    The headers for the ‘*.sum’ file are written only for the first execution of the While loop
    The VI is designed to run for a specific duration after which the execution of  While loop is stopped
    Certain safety features are incorporated to terminate the execution of the While loop if the ratio of measured quantities exceeds a preset limit.
    In the last sequence the analog outputs are set to zero
    I am having following problems with the execution of the VI:
    The VI does not write instantaneous data to data files (*.dat)
    The VI writes the averaged data for *.sum file for only the first execution of the While loop.
    It also truncates the values to around 10.5 written in *.sum file. While implies that the custom scale is not working as intended.
    I would really appreciate if you would tell me how to fix these bugs with the VI. I would really appreciate your help.
    Have a happy holiday season.
    Thanks,
    Dinesh
    Attachments:
    VLBT_Sequence_AnalogIP_2.vi ‏437 KB

    Lynn, he may actually not be to blame for the diagram size. It does not change if you "clean" it, which leads me to believe that this is what he did. But a very entertaining diagram it is. A true case study :-)
    Now, the strange thing is that stuff like this remains in it:
    As Lynn said, the reason why the file is updated only once is that there must be an error after the first acquisition completes. The only way to figure out which one it is (in order to avoid or correct it) is to debug your code in situ (using a probe on the error wires). It might be because you try to restart your acquisition within the loop (you probably should stop it first if you really want to restart it anyhow). I would put the start out of the while loop and try this way. The error might occur elsewhere though or for another reason...
    Since you recreate your dat file at each iteration, the second giving you nothing because of an (unknown) error, will essentially erase your first successful iteration.
    I don't understand the truncation statement.

  • Facing Many Problems About Creating Directory and an External Table

    Question:
    The weird thing is if you look at question 10-b in page 3-41, it says:
    (page 3-41 "Oracle Database 10g SQL Fund. II Vol.1")
    Merge the data in the EMP_DATA table created in the last lab into the data in the emp_hist table. Assume
    that the data in external EMP_DATA table matches the EMP_HIST table, update the email column
    of the EMP_HIST table to match the EMP_DATA table row. If a row in the EMP_DATA table does not
    match, insert into the EMP_HIST tables. Rows are considered matching when the employee's first and
    last name are identical.
    To me, this question is constructed wrongly. First of all in the last lab we have not been asked to create EMP_DATA. Secondly, EMP_DATA is empty.
    Thirdly, this question asks us to merge into EMP_HIST table while EMP_DATA is empty.
    EMP_HIST table currently has copied data from employees table. EMP_HIST structure:
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(45)
    Anway, i did the merge as following:
    merge into emp_hist e
    using emp_data d
    on (e.first_name = d.first_name)
    when matched then
    update set
    e.last_name = d.last_name,
    e.email = d.email
    when not matched then
    insert values (d.first_name, d.last_name, d.email);
    I get this error:
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file emp.dat in EMP_DIR not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    On the other hand, i said let me try this:
    merge into emp_data d
    using emp_hist e
    on (d.first_name = e.first_name)
    when matched then
    update set
    d.last_name = e.last_name,
    d.email = e.email
    when not matched then
    insert values (e.first_name, e.last_name, e.email);
    I get this error because external table is final once its created as far as i know:
    Error report:
    SQL Error: ORA-30657: operation not supported on external organized table
    30657.0000 - "operation not supported on external organized table"
    *Cause:    User attempted on operation on an external table which is
    not supported.
    *Action:   Don't do that!
    I do not know what to do. I did my best, please help.
    Edited by: user11164565 on Jul 27, 2009 2:43 AM

    user11164565 wrote:
    NOTE: I did my best, i did all what i can do, but the problem persists. Please help
    I will mention all the steps i did clearly....
    I gave scott the following grants:
    grant create any directory to scott;
    grant read on directory emp_dir to scott;
    1. Created a directory and its been created successfully:
    create or replace directory emp_dir
    as 'F:\emp_dir';
    Then i did the following just to make sure my directory is recognized:
    SELECT *
    FROM dba_directories;
    I found the drive amongst the results...
    OWNER DIRECTORY_NAME
    DIRECTORY_PATH
    SYS EMP_DIR
    F:\emp_dir
    SYS SUBDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\/2002/Sep
    SYS XMLDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\
    2. I created an external table emp_data (the script is given by the text book): done successfully
    drop table emp_data;
    CREATE TABLE emp_data
    (first_name VARCHAR2(20)
    ,last_name VARCHAR2(20)
    , email VARCHAR2(30)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY emp_dir
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    NOBADFILE
    NOLOGFILE
    FIELDS
    ( first_name POSITION ( 1:20) CHAR
    , last_name POSITION (22:41) CHAR
    , email POSITION (43:72) CHAR )
    LOCATION ('emp.dat') ) ;
    3. I went to F:\ drive to see if emp_dir folder exist or not! I did not see it. I checked hidden files, nothing there. Anyway, i ignored it and did step 4.
    <snip>
    "Anyway, I ignored it . . . "
    and hence the rest of your problems. I did not see in the steps you recounted that you acually created a directory ("folder") named "\emp_dir" on your f: drive. Nothing you create within the database will actually create that directory on the OS. Createing a directory in Oracle, createing an external table in Oracle, will only create pointers to objects that Oracle will simply assume actually exists.

  • Problem in reading Data and Inserting...Urgent help..

    INITIALIZATION.
      AUTHORITY-CHECK OBJECT 'ZZABAP'
               ID 'ZZABAP' FIELD 'ZCOU2006'
               ID 'ZZAKTI' FIELD '1'.
      IF sy-subrc <> 0.
        MESSAGE e001(zm) WITH text-001.
      ENDIF.
    *... Selektionen .......................................................
      PARAMETER:
        bu AS CHECKBOX,
        p_vtweg LIKE zknvh-vtweg OBLIGATORY.           ".. Update JA/NEIN ?
    START-OF-SELECTION.
    *... Löschen ZKNVH .....................................................
      IF NOT bu IS INITIAL.
        DELETE FROM zknvh WHERE hityp = 'A'.
        IF sy-subrc GT 4.
          ROLLBACK WORK.
          MESSAGE e001(zm) WITH text-002.
        ENDIF.
      ENDIF.
    *Select the Vtweg and perform based on the Vtweg..
    *Running two Variants in the BG processing..
      IF p_vtweg EQ 'MZ'.
        PERFORM form_06.
      ELSEIF p_vtweg EQ 'AU'.
        PERFORM form_04.
      ENDIF.
          FORM form_06                                                  *
    FORM form_06.
    *... Fuellen LKNVH ....................................................
      SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor = '06'.
      MESSAGE i002(zm) WITH text-005 sy-dbcnt.
    *... Fuellen Knoten KKNVH .............................................
      SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor LT '06'.
    *... Aufbau BU_ZKNVH ..................................................
      LOOP AT lknvh.
        CLEAR: bu_zknvh, flag.
        MOVE-CORRESPONDING lknvh TO bu_zknvh.
        zaehler = 6.
        DO 4 TIMES.
          zaehler = zaehler - 1.
          UNPACK zaehler TO help_hzuor.
          bu_zknvh-hier05 = lknvh-hkunnr.
          IF sy-index = 1.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = lknvh-hityp
                       kunnr = lknvh-hkunnr
                       vkorg = lknvh-hvkorg
                       vtweg = lknvh-hvtweg
                       spart = lknvh-hspart.
          ELSE.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = kknvh-hityp
                       kunnr = kknvh-hkunnr
                       vkorg = kknvh-hvkorg
                       vtweg = kknvh-hvtweg
                       spart = kknvh-hspart.
          ENDIF.
          IF sy-subrc = 0.
            CASE help_hzuor.
              WHEN '05'. bu_zknvh-hier04 = kknvh-hkunnr.
              WHEN '04'. bu_zknvh-hier03 = kknvh-hkunnr.
              WHEN '03'. bu_zknvh-hier02 = kknvh-hkunnr.
              WHEN '02'. bu_zknvh-hier01 = kknvh-hkunnr.
            ENDCASE.
          ELSE.
            WRITE: / text-004,
                     kknvh-hityp,
                     kknvh-kunnr,
                     kknvh-vkorg,
                     kknvh-vtweg,
                     kknvh-spart,
                     kknvh-hkunnr,
                     kknvh-hvkorg,
                     kknvh-hvtweg,
                     kknvh-hspart,
                     kknvh-hzuor.
            flag = 'X'.
            EXIT.
          ENDIF.
        ENDDO.
        IF flag IS INITIAL.
          APPEND bu_zknvh.
        ENDIF.
      ENDLOOP.
    ENDFORM.                                                    " form_06
    Form_4 looks exactly like form_6 just the table name changed and Hier05 and Hier04 fields are Blanks..
    INSERT zknvh from Table bu_zknvh.
      MESSAGE i002(zm) WITH text-006 sy-dbcnt.
      IF sy-subrc <> 0 OR bu IS INITIAL.
        ROLLBACK WORK.
        MESSAGE e001(zm) WITH text-003.
      ELSE.
        COMMIT WORK.
      ENDIF.
    INSERT zknvh from Table au_zknvh.
      MESSAGE i002(zm) WITH text-006 sy-dbcnt.
      IF sy-subrc <> 0 OR bu IS INITIAL.
        ROLLBACK WORK.
        MESSAGE e001(zm) WITH text-003.
      ELSE.
        COMMIT WORK.
      ENDIF.
    1) When I select VTWEG 'MZ' everything is working without anyproblem...
    2) When I select VTWEG 'AU' I can see only one RECORD.. where as their are around 41,000 records.. in this Selection..
    Normally with this prog the ZKNVH table should be filled with the specified fields..
    Only if the VTWEG is AU the Hier05 and Hier04 is Blank and others are filled with data.. bcoz in the Customer Hierarchy of AU has only 4 levels...
    and if VTWEG is MZ all the fields should be filled with data as the Customer Hierarchy of Mz has 6 levels..
    Please check the prog and suggest me how I can Fill append the table ZKNVH with data when I select AU..
    Thanx in advance...
    Preethu
    Message was edited by: Preethu

    HERE IS THE FULL CODE:: please help
    REPORT zcou2006.
    TABLES: zknvh.
    *... Datentypen ................................
    TYPES:
         BEGIN OF t1_knvh,                 "... Knoten
            mandt LIKE knvh-mandt,
            hzuor LIKE knvh-hzuor,
            hityp LIKE knvh-hityp,
            kunnr LIKE knvh-kunnr,
            vkorg LIKE knvh-vkorg,
            vtweg LIKE knvh-vtweg,
            spart LIKE knvh-spart,
            hkunnr LIKE knvh-hkunnr,
            hvkorg LIKE knvh-hvkorg,
            hvtweg LIKE knvh-hvtweg,
            hspart LIKE knvh-hspart,
            grpno LIKE knvh-grpno,
            bokre LIKE knvh-bokre,
            prfre LIKE knvh-prfre,
          END OF t1_knvh,
          t2_knvh LIKE knvh,
          t3_zknvh LIKE zknvh,
          t4_zknvh LIKE zknvh,
        t1_hknvh TYPE HASHED TABLE OF t1_knvh WITH UNIQUE KEY
                  mandt hzuor hityp kunnr vkorg vtweg spart.
    DATA:
      lknvh TYPE t2_knvh OCCURS 0 WITH HEADER LINE,
      bu_zknvh TYPE t3_zknvh OCCURS 0 WITH HEADER LINE,
      au_zknvh TYPE t4_zknvh OCCURS 0 WITH HEADER LINE,
      kknvh TYPE t1_hknvh WITH HEADER LINE,
      flag(1) TYPE c,
      help_hzuor LIKE knvh-hzuor,
      zaehler TYPE p.
    INITIALIZATION.
      AUTHORITY-CHECK OBJECT 'ZZABAP'
               ID 'ZZABAP' FIELD 'ZCOU2006'
               ID 'ZZAKTI' FIELD '1'.
      IF sy-subrc <> 0.
        MESSAGE e001(zm) WITH text-001.
      ENDIF.
      PARAMETER:
        bu AS CHECKBOX,
      p_vtweg LIKE zknvh-vtweg OBLIGATORY.          
    START-OF-SELECTION.
      IF NOT bu IS INITIAL.
        DELETE FROM zknvh WHERE hityp = 'A'.
        IF sy-subrc GT 4.
          ROLLBACK WORK.
          MESSAGE e001(zm) WITH text-002.
        ENDIF.
      ENDIF.
      IF p_vtweg EQ 'MZ'.
        PERFORM form_06.
      ELSEIF p_vtweg EQ 'AU'.
        PERFORM form_04.
      ENDIF.
    FORM form_06.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor = '06'.
      MESSAGE i002(zm) WITH text-005 sy-dbcnt.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor LT '06'.
      LOOP AT lknvh.
        CLEAR: bu_zknvh, flag.
        MOVE-CORRESPONDING lknvh TO bu_zknvh.
        zaehler = 6.
        DO 4 TIMES.
          zaehler = zaehler - 1.
          UNPACK zaehler TO help_hzuor.
          bu_zknvh-hier05 = lknvh-hkunnr.
          IF sy-index = 1.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = lknvh-hityp
                       kunnr = lknvh-hkunnr
                       vkorg = lknvh-hvkorg
                       vtweg = lknvh-hvtweg
                       spart = lknvh-hspart.
          ELSE.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = kknvh-hityp
                       kunnr = kknvh-hkunnr
                       vkorg = kknvh-hvkorg
                       vtweg = kknvh-hvtweg
                       spart = kknvh-hspart.
          ENDIF.
          IF sy-subrc = 0.
            CASE help_hzuor.
              WHEN '05'. bu_zknvh-hier04 = kknvh-hkunnr.
              WHEN '04'. bu_zknvh-hier03 = kknvh-hkunnr.
              WHEN '03'. bu_zknvh-hier02 = kknvh-hkunnr.
              WHEN '02'. bu_zknvh-hier01 = kknvh-hkunnr.
            ENDCASE.
          ELSE.
            WRITE: / text-004,
                     kknvh-hityp,
                     kknvh-kunnr,
                     kknvh-vkorg,
                     kknvh-vtweg,
                     kknvh-spart,
                     kknvh-hkunnr,
                     kknvh-hvkorg,
                     kknvh-hvtweg,
                     kknvh-hspart,
                     kknvh-hzuor.
            flag = 'X'.
            EXIT.
          ENDIF.
        ENDDO.
        IF flag IS INITIAL.
          APPEND bu_zknvh.
        ENDIF.
      ENDLOOP.
    ENDFORM.                                                    " form_06
    FORM form_04.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE lknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor LE '06'.
      MESSAGE i002(zm) WITH text-005 sy-dbcnt.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE kknvh
               FROM knvh
               WHERE hityp = 'A'
               AND   datbi GE sy-datum
               AND   hzuor LT '06'.
      LOOP AT lknvh.
        CLEAR: au_zknvh, flag.
        MOVE-CORRESPONDING lknvh TO au_zknvh.
        zaehler = 6.
        DO 4 TIMES.
          zaehler = zaehler - 1.
          UNPACK zaehler TO help_hzuor.
          au_zknvh-hier05 = '          '.
          IF sy-index = 1.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = lknvh-hityp
                       kunnr = lknvh-hkunnr
                       vkorg = lknvh-hvkorg
                       vtweg = lknvh-hvtweg
                       spart = lknvh-hspart.
          ELSE.
            READ TABLE kknvh WITH TABLE KEY
                       mandt = sy-mandt
                       hzuor = help_hzuor
                       hityp = kknvh-hityp
                       kunnr = kknvh-hkunnr
                       vkorg = kknvh-hvkorg
                       vtweg = kknvh-hvtweg
                       spart = kknvh-hspart.
          ENDIF.
          IF sy-subrc = 0.
            CASE help_hzuor.
              WHEN '05'. au_zknvh-hier04 = '          '.
              WHEN '04'. au_zknvh-hier03 = kknvh-hkunnr.
              WHEN '03'. au_zknvh-hier02 = kknvh-hkunnr.
              WHEN '02'. au_zknvh-hier01 = kknvh-hkunnr.
            ENDCASE.
          ELSE.
            WRITE: / text-004,
                     kknvh-hityp,
                     kknvh-kunnr,
                     kknvh-vkorg,
                     kknvh-vtweg,
                     kknvh-spart,
                     kknvh-hkunnr,
                     kknvh-hvkorg,
                     kknvh-hvtweg,
                     kknvh-hspart,
                     kknvh-hzuor.
            flag = 'X'.
            EXIT.
          ENDIF.
        ENDDO.
        IF flag IS INITIAL.
          APPEND au_zknvh.
        ENDIF.
      ENDLOOP.
    ENDFORM.                                                    " form_04
    END-OF-SELECTION.
      INSERT zknvh FROM TABLE bu_zknvh.
      MESSAGE i002(zm) WITH text-006 sy-dbcnt.
      IF sy-subrc <> 0 OR bu IS INITIAL.
        ROLLBACK WORK.
        MESSAGE e001(zm) WITH text-003.
      ELSE.
        COMMIT WORK.
      ENDIF.
      INSERT  ZKNVH FROM TABLE AU_ZKNVH.
      MESSAGE I002(ZM) WITH TEXT-006 SY-DBCNT.
      IF SY-SUBRC <> 0 OR BU IS INITIAL.
        ROLLBACK WORK.
        MESSAGE E001(ZM) WITH TEXT-003.
      ELSE.
        COMMIT WORK.
      ENDIF.
      CALL FUNCTION 'Z_SELECT_OPTIONS_PRINT'
           EXPORTING
                irepid  = 'ZCOU2006'
                ausgabe = ' '
           EXCEPTIONS
                OTHERS  = 1.
    Message was edited by: Preethu

Maybe you are looking for