How can i improve this code ?

DATA: t_bkpf TYPE bkpf.
DATA: t_bseg type bseg_t.
DATA: wa_bseg like line of t_bseg.
select * from bkpf into t_bkpf where document type ='KZ' and bldat in s_bldat.
select single * from bseg into wa_bseg where belnr = t_bkpf-belnr.
append wa_bseg to t_bseg.
endselect.
loop at t_bseg into wa_bseg.
  at new belnr.
     if wa_bseg-koart EQ 'K'.
        // pick vendor wrbtr
     else
       // pick other line item's wrbtr
     endif.
  endat.
endloop.
i am guessing my select statements arnt efficient performance wise, secondly in the loop when i use  'at new belnr' it aint showing my any values  whereas i get all the vendors(KOART EQ 'K') when i dont use 'at new belnr' .
why is this so and how can i make the code efficient ?
Thanks..
Shehryar

Hi,
1.Dont read all the fields from the table unless it is required in your program.
This will tremendously improve your performance.
2.Make use of the key fields of the table wherever possible
In your scenario you could use the fields BUKRS,BELNR,GJAHR of the table BKPF in the WHERE Clause rather than
other fields.This will improve your performance a lot..
3.As BSEG is a cluster table it will cause performance problem in most cases.So try to read
the required fields from it rather than reading all the fields.Again Make use of the key fields in the WHERE Clause
here too to improve the performance..
4.Remove SELECT..ENDSELECT and replace it with FOR ALL ENTRIES to improve the performance.
Cheers,
Abdul Hakim
Mark all useful answers..

Similar Messages

  • Hello there,  there is a rare window that keeps popping up every time i start Logic.  I'd like to send a screenshot... anyway, it's a "tempo" window with strange layout about midi effects and so,.... is it normal?  How can i improve this?  Thanks.

    hello there,  there is a rare window that keeps popping up every time i start Logic.  It's a "tempo" window with strange layout about midi effects and so,.... is it normal?  How can i improve this?  Thanks.

    Hmm, that's some sort of MIDI Arpeggiator setup in your environment. Strange that you don't know it, this has to be custom-installed, it is not part of the standard setup.
    You can do two things about it:
    1.unlock your current screenset (shift-L), then close the (Bass Driver) window, then relock the screenset (shift-L). Next time you open up this project you won't see the Bass Driver, but it is still in the project.
    2. You can remove the whole page: open the Environment (cmd-8), then go to the dropdown menu arrow top left of the Environment window and select the Bass Driver layer. If it is selected, dropdown again and choose Delete. Now Save your project under a different name (Save As...), so that you still keep the Bass Driver setup in the original project. If you don't need to keep it, you can simply Save.

  • Finally upgraded to Lions OSX. The Mac screen is now hard to view as everything has a grey tinge. How can I improve this? Tried

    Finally took the plungs and upgraded to Lion OSx so that I could access icloud. Everything worked ok but I now find it difficult to view the screen. Everything has a grey tinge and with my poor eyesight it's really frustrating. Zooming in is ok but I would really like more contrast. What was wrong with crisp white and deep black? Have tried to change the profiles in System Preferences but it's confusing to follow and after 3 attempts I still don't like any of the profiles. My photos all have an unnatural colour now. How can I improve this and bring everything back to 'normal'? Whose 'bright' (?) idea was it to make everyting grey and why???

    Thanks. Very helpful. It's now less of a strain for me. But the fonts are still too pale. I really need to be able to read words that are black. In Mail, the sender and headings are dark enough, but the content is still too light for me to read without straining. Any other suggestions?

  • How can i improve this query.

    Hi guys i am beginner , just wanted to know some info , how can i improve this query ..
    select *
    from tableA A, viewB B,
    where A.key = B.key
    and a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    one more thing should function should be on left side of equal sign.
    will a join make it better or something else is needed more than that .

    952936 wrote:
    Hi guys i am beginner , just wanted to know some info , how can i improve this query ..
    select *
    from tableA A, viewB B,
    where A.key = B.key
    and a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    one more thing should function should be on left side of equal sign.
    will a join make it better or something else is needed more than that .If you are a beginner try to learn the ANSI Syntax. This will help you a lot to write better queries.
    Your select would look like this in ANSI.
    select *
    from tableA A
    JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_function(a.key);The good thing here is that this separates the typical joining part of the select from the typical filter criteria.
    The other syntax very often let you forget one join. Just because there are so many tables and so many filters, that you just don't notice correctly anymore what was join and what not.
    If you notice that the number of column is not what you expect, you can easiely modify the query and compare the results.
    example A
    Remove View B from the query (temporarily comment it out).
    select *
    from tableA A
    --JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)
    example B
    You notice, that values from A are missing. Maybe because there is no matching key in ViewB? Then change the join to an outer join.
    select *
    from tableA A
    LEFT OUTER JOIN viewB B ON A.key = B.key
    WHERE a.criteria1 = '111'
    and a.criteria2 = some_funtion(a.key)(The outer keyword is optional, left join would be enough).

  • How  can i run this code correctly?

    hello, everybody:
        when  i run the code, i found that it dons't work,so ,i  hope somebody can help me!
        the Ball class is this :
        package {
        import flash.display.Sprite;
        [SWF(width = "550", height = "400")]
        public class Ball extends Sprite {
            private var radius:Number;
            private var color:uint;
            private var vx:Number;
            private var vy:Number;
            public function Ball(radius:Number=40, color:uint=0xff9900,
            vx:Number =0, vy:Number =0) {
                this.radius= radius;
                this.color = color;
                this.vx = vx;
                this.vy = vy;
                init();
            private function init():void {
                graphics.beginFill(color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
    and the Chain class code is :
    package {
        import flash.display.Sprite;
        import flash.events.Event;
        [SWF(width = "550", height = "400")]
        public class Chain extends Sprite {
            private var ball0:Ball;
            private var ball1:Ball;
            private var ball2:Ball;
            private var spring:Number = 0.1;
            private var friction:Number = 0.8;
            private var gravity:Number = 5;
            //private var vx:Number =0;
            //private var vy:Number = 0;
            public function Chain() {
                init();
            public function init():void {
                ball0  = new Ball(20);
                addChild(ball0);
                ball1 = new Ball(20);
                addChild(ball1);
                ball2 = new Ball(20);
                addChild(ball2);
                addEventListener(Event.ENTER_FRAME, onEnterFrame);
            private function onEnterFrame(event:Event):void {
                moveBall(ball0, mouseX, mouseY);
                moveBall(ball1, ball0.x, ball0.y);
                moveBall(ball2, ball1.x, ball1.y);
                graphics.clear();
                graphics.lineStyle(1);
                graphics.moveTo(mouseX, mouseY);
                graphics.lineTo(ball0.x, ball0.y);
                graphics.lineTo(ball1.x, ball1.y);
                graphics.lineTo(ball2.x, ball2.y);
            private function moveBall(ball:Ball,
                                      targetX:Number,
                                      targetY:Number):void {
                ball.vx += (targetX - ball.x) * spring;
                ball.vy += (targetY - ball.y) * spring;
                ball.vy += gravity;
                ball.vx *= friction;
                ball.vy *= friction;
                ball.x += vx;
                ball.y += vy;
    thanks every body's help!

    ok, thanks for your reply ! I run this code in the Flex builder 3!and the Ball class and the Chain class are all in the same AS project!
      and i changed the ball.pv property as public in the Ball class, and  the Chain class has no wrong syntactic analysis,but the AS code don't run.so this is the problem.
    2010-04-21
    Fang
    发件人: Ned Murphy <[email protected]>
    发送时间: 2010-04-20 23:01
    主 题: how  can i run this code correctly?
    收件人: fang alvin <[email protected]>
    I don't see that the Ball class has a pv property, or that you even try to access a pv property in the Chain class.  All of the properties in your Ball class are declared as private, so you probably cannot access them directly.  They would need to be public.  Also, I still don't see where you import Ball in the chain class such that it can use it.

  • How can i know how to redeem the code? how can i get this code?

    how can i know how to redeem the code? how can i get this code? please i need you help
    <Email Edited by Host>

    You are trying to create a new Apple ID? You don't have one yet? Is that correct?
    If so, then see this article on how to creat your Apple ID - and make up a password for it. Remember to write it down immediately.
    http://support.apple.com/en-us/HT203993

  • I forgot the codeslot of my ipod. How can I delete this code?

    I forgot the codeslot of my ipod. How can I delete this code? Can anybody help help me? I'm sorry for the bad English.

    Connect it to iTunes and Restore it.

  • How can i rewrite this code into java?

    How can i rewrite this code into a java that has a return value?
    this code is written in vb6
    Private Function IsOdd(pintNumberIn) As Boolean
        If (pintNumberIn Mod 2) = 0 Then
            IsOdd = False
        Else
            IsOdd = True
        End If
    End Function   
    Private Sub cmdTryIt_Click()
              Dim intNumIn  As Integer
              Dim blnNumIsOdd     As Boolean
              intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
              blnNumIsOdd = IsOdd(intNumIn)
              If blnNumIsOdd Then
           Print "The number that you entered is odd."
        Else
           Print "The number that you entered is not odd."
        End If
    End Sub

    873221 wrote:
    I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
    I'm just trying to get you to think about what your post actually says, and what others will take from it.
    what does this error mean? what code should i replace and add? thanks for all response
    C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=true;
    ^
    C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=false;
    ^
    2 errors
    Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
    It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
    So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

  • How can I improve this?

    It's basically to add lots of tasks that should execute after a certain amount of time and execute them efficiently. How can I improve it? I've already thought of making the Events loop able.
    package eventmanager;
    import java.util.Collections;
    import java.util.LinkedList;
    import java.util.List;
    * Handles the processing of timed event
    * very efficiently.
    * @author Colby
    public class EventEngine {
        public static void main(String[] args) {
            Event e1 = new Event(1000) {
                @Override
                public void execute() {
                    System.out.println("Executed 1000ms");
            Event e2 = new Event(2000) {
                @Override
                public void execute() {
                    System.out.println("Executed 2000ms");
            EventEngine engine = new EventEngine();
            engine.add(e1);
            engine.add(e2);
        public static abstract class Event implements Comparable {
            public Event(long timeUntilExecute) {
                this.timeCreated = System.currentTimeMillis();
                this.timeUntilExecution = timeUntilExecute;
            @Override
            public int compareTo(Object o) {
                if (!(o instanceof Event)) {
                    throw new IllegalArgumentException("Input Object must inherit from eventmanager.Event");
                Event e = (Event) o;
                long thisLeft = getTimeUntilExecution();
                long otherLeft = e.getTimeUntilExecution();
                return thisLeft < otherLeft ? -1 : otherLeft < thisLeft ? 1 : 0;
            public abstract void execute();
            public boolean timeToExecute() {
                return getTimeUntilExecution() < 1;
            public long getTimeCreated() {
                return timeCreated;
            public long getTimeUntilExecution() {
                return timeUntilExecution - (System.currentTimeMillis() - timeCreated);
            private long timeCreated;
            private long timeUntilExecution;
        public EventEngine() {
            this.events = new LinkedList<Event>();
            Runnable task = new Runnable() {
                @Override
                public void run() {
                    while (true) {
                        try {
                            cycle();
                        } catch (InterruptedException e) {
                            e.printStackTrace();
            Thread t = new Thread(task);
            t.setName("Event Manager");
            t.start();
        private void cycle() throws InterruptedException {
            synchronized (this) {
                if (events.isEmpty()) {
                    wait();
                } else {
                    Collections.sort(events);
                    Event e = events.get(0);
                    if (e.timeToExecute()) {
                        e.execute();
                        events.remove(0);
                    } else {
                        wait(e.getTimeUntilExecution());
        public void add(Event e) {
            synchronized (this) {
                events.add(e);
                notify();
        private List<Event> events;
    }Edited by: Jadz_Core on Jan 21, 2010 4:05 PM

    Jadz_Core wrote:
    Melanie_Green wrote:
    Jadz_Core wrote:
    Nobody has any criticism :O
    return thisLeft < otherLeft ? -1 : otherLeft < thisLeft ? 1 : 0;MelBecause it's against conventions or can it be done better?The code is barely readable.
    if(thisLeft < otherLeft) {
      return -1;
    else if(otherLeft < thisLeft) {
      return 1;
    else {
      return 0;
    }Is slightly more readable yet not quite adequate. In fact this looks something similar to hmmmm....
    Long thisLeft = getTimeUntilExecution();
    Long otherLeft = e.getTimeUntilExecution();
    return thisLeft.compareTo(otherLeft);Ahhhhhhhhh
    Mel

  • How can i improve this function?i need your help....

    Hi guys,
    i'm a pratical question for you.
    I've developed a jas application that reads a txt file and convert it
    into an array of byte,fro putting it into a blob field of a db mysql.
    With big file i go in heap size memory!
    I want to improve my function that makes it,but i'm a bit
    inexpert...can you help me?
    I have a file so made...
    Each line has the same number of value,but i know this number only when
    i read the file
    string1 string2 string3................
    stringx double double......(ever double)
    stringy double double......(ever double)
    and other lines equals to them from the second.
    Only the first line has only strings.
    I have read this file using a string array to read the first line and
    an arraylist of "Riga" object to read the others lines.....i've used a
    vector to store partial data from lines reading and at the end i've
    created an array of byte in which i copy the vector.
    Can you help me improving my code?
    The file has about 50000 rows......so i go in heap memory size...
    i know my code isn't too optimized.....can you help me?Please,i'm a
    newbie,help me with code if possible...
    When i encode the objects i've created into an array of byte i use a
    whitespace to separe different value and a ; to separe different lines.
    I've done it because in a second moment i've to read the array of byte.
    Thanks...this is my code
    public class MyBean {
            private UploadedFile myFile;
            private ArrayList rows = new ArrayList();
        private List lines = new ArrayList();
        public MyBean(){
        public List getLines(){
            return lines;
        public void setLines(List lines){
            this.lines=lines;
    public boolean insRighe(Riga nuovo){
               return rows.add(nuovo);
        public UploadedFile getMyFile() {
            return myFile;
        public void setMyFile(UploadedFile myFile) {
            this.myFile = myFile;
        public ArrayList getRows() {
                    return rows;
            public void setRows(ArrayList rows) {
                    this.rows = rows;
        public String carica() throws IOException {
            Riga r;
            Double val[];
            Head h;
            int col=0;
            int row=0;
            byte middlerow=' ';
            byte endrow=';';
            byte[] data=null;
            Vector temp=new Vector();
            int numberOfNumericColumns=0;
            String geneid=null;
            String g=null;
            String[]intest=null;
            BufferedReader br = new BufferedReader(new
    InputStreamReader(myFile.getInputStream()));
                    String line = null;
            while ((line = br.readLine()) != null) {
                    line = line.replace (',', '.');
                    StringTokenizer st = new StringTokenizer(line);
                    numberOfNumericColumns = (st.countTokens()-1);
                    col=(numberOfNumericColumns+1);
                //se siamo nella prima riga(contatore segna 0)
                    if(row==0){
                            intest=new String[col];
                            int j=0;
                            while(st.hasMoreTokens()){
                                    intest[j]=(st.nextToken().trim());
                                    j++;
                            h=new Head(intest);//crei l'oggetto head
                            String []qa=h.getHvalues();
                            String asd="";
                        for(int i=0;i<=qa.length-1;i++){
                            asd=asd.concat(qa[i]+" ");
                        System.out.println("head "+asd);//stampo contenuto
    dell' head
                        row=1;
                    }//fine if
                    else
                            Double[] values=new Double[numberOfNumericColumns];
                        int z=0;
                        geneid=st.nextToken();
                        while (st.hasMoreTokens()) {
                            String app=st.nextToken();
                            values[z]=Double.valueOf(app);
                            z++;
                        r=new Riga(geneid,values); //crei l'oggetto riga
                        System.out.println("riga");
                        System.out.println(r.getgeneid());
                        values=r.getvalues();
                        for(int e=0;e<values.length;e++){
                            System.out.println(values[e]);
                        insRighe(r); //aggiungi
                    row++;
                    int i = 0;
                    while (i < intest.length) {
                            byte[] bytesnew = intest.getBytes();
    // temp.addAll(bytesnew);
    // memorizza in byte un elemento del vettore alla volta
    for (byte b : bytesnew)
    temp.add(new Byte(b)); // provare Byte
    // temp.addElement(intest[i].getBytes());
    temp.addElement(Byte.valueOf(middlerow));
    i++;
    temp.addElement(Byte.valueOf(endrow));
    System.out.println("Intestazione convertita in byte");
    for (int l = 0; l < rows.size(); l++) {
    r = (Riga) rows.get(l);
    g = r.getgeneid();
    // temp.addElement(g.getBytes());
    byte[] byte2 = g.getBytes();
    for (byte c : byte2)
    temp.add(new Byte(c));
    temp.addElement(Byte.valueOf(middlerow));
    val = r.getvalues();
    byte[] tempByte1;
    for (int e = 0; e <= val.length - 1; e++) {
    // Returns a string representation of the double argument.
    tempByte1 = Double.toString(val[e]).getBytes();
    for (int j = 0; j < tempByte1.length; j++) {
    temp.addElement(Byte.valueOf(tempByte1[j]));
    temp.addElement(Byte.valueOf(middlerow));
    temp.addElement(Byte.valueOf(endrow));
    data = new byte[temp.size()];
    for (int t = 0; t < temp.size(); t++) {
    data[t] = (((Byte) temp.elementAt(t)).byteValue());
    return data;
    public class Riga{
         private String geneid=null;
         private Double[] values=null;
         public Riga(String idGene,Double[] x ) {
    this.geneid=idGene;
    this.values=x;
         public String getgeneid(){
              return this.geneid;
         public void setgeneid(String idGene){
              this.geneid=idGene;
         public Double[] getvalues(){
              return this.values;
         public void setvalues(Double[] x){
              this.values=x;
    Message was edited by:
    giubat

    Maybe I didn't understand you, but why are you putting a file with 50000 rows as one single BLOB into a DB? Don't you think it's time for a new table?

  • How can i improve this 2min countdown timer?

    Hello
    I'm trying to see if anyone has any ideas on how to improve this simple 2 minute countdown timer.  All suggestions are welcome!
    Thanks in advance!
    -noviceLabVIEWuser
    Solved!
    Go to Solution.
    Attachments:
    2min Countdown Timer.vi ‏38 KB

    As an alternative, I used a case structure to eliminate some calculations for Sample Time while Air Time is counting down and vice versa.  I don't know if this is necessarily better.  Your original code was simple and it worked fine.
    False case showing:                                          ​                                 True case showing:
    - tbob
    Inventor of the WORM Global

  • How can I get this code to display 20 lines

    I need to get this code I have written to display 20 lines at a time, then the 20 using the Enter key.
    How would I approach this?
    I thought of making a RandomAcessFile object, but that seems like overthinking the problem, and I'm not sure that I could get that to work anyway.
    import java.io.*;
    public class ReadIt
    public static void main(String[] args)
         throws IOException
              System.out.println ("Enter The Desired .java Filename.");
              System.out.println ("Do not add the .java extention.");
              String fname;
              EasyIn type = new EasyIn();
              fname = type.readString();
              String fndotjava = new String(fname + ".java");
              //System.out.println (fndotjava);
              File inFile = new File(fndotjava);
              InputStream istream;
              OutputStream ostream;
              istream = new FileInputStream(inFile);
              ostream = System.out;
              int c;
              try
                     while((c = istream.read()) != -1)
                           ostream.write(c);
              catch(IOException e)
                     System.out.println("Error: " + e.getMessage());      
              finally
                    istream.close();
                    ostream.close();                 
    }Thanks
    Brad

    Well, a RandomAccessFile together with a counter should work. However, you can also achieve this by buffering the input rather than writing it directly out
    java.util.Vector vect = new java.util.Vector();
    try{
         while((c = istream.read()) != -1){
             vect.append(c);
    catch(IOException e){
         System.out.println("Error: " + e.getMessage());      
    finally{
         istream.close();                 
    }     with the help of
    java.util.Vector.size() and
    java.util.Vector.elementAt(int index)
    you are able to display only 20 lines at a time, you just need the additional code for reading System.in
    public static void prompt(String s){
        System.out.print(s + " ");
        System.out.flush();
      public static String readData ( BufferedReader in)  {
        boolean verfuegbar = true;
        while ( verfuegbar){
          try{
            S = in.readLine();
            if ( S != null)verfuegbar = false ;
          catch (IOException e){System.out.print (e);}
        return S;
      }now it should work with
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    prompt("return for continuing");
    int twentscount = 0;
    int count = 0;
    do{
       while( count < 20 && twentscount+count < vect.size() ){
           outstream.write(vect.elementAt(twentscount + count).toString() );
           count++;
    prompt("return");
    readData(in);
    twentscount += 20;
    count = 0;
    while(twentscount + count < vect.size());sure, this is code from head, and you can make many changes (e.g. instead of using twentscount use the modulo (%) operator saving one variable (while count % 20 != 0 ).
    I'm also not sure if it will definitly run , since i haven't tested it (especialy for index borders).
    I hope this will give you enough hints for this possible solution.
    Adrian

  • How can I use this code in Muse?

    Please, tell me with details how to paste this code, which the "add this" widget on Muse to appear...
    <!-- AddThis Smart Layers BEGIN -->
    <!-- Go to http://www.addthis.com/get/smart-layers to customize -->
    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-538d2f0f4872fcfe"></script>
    <script type="text/javascript">
      addthis.layers({
        'theme' : 'transparent',
        'follow' : {
          'services' : [
            {'service': 'facebook', 'id': 'africa.si.zgz'},
            {'service': 'twitter', 'id': 'Africa_Si'},
            {'service': 'google_follow', 'id': 'u/0/b/103262715708033329485/103262715708033329485/posts'},
            {'service': 'linkedin', 'id': 'África-sí', 'usertype': 'company'},
            {'service': 'youtube', 'id': 'africasizgz'}
        'whatsnext' : {} 
    </script>
    <!-- AddThis Smart Layers END -->
    Thank you!

    Thank you, but I still have a problem.... When a copy it directly on Muse through "ctrl + v" I see the whole code as text on Muse and when I paste it thorugh object--> Insert HTML Muse says that they "couldn't generate de miniature", do you know what I'm doing wrong?
    Thank you!

  • How can i modify this code in BI?

    hi friends,
    suppose i have data in infosource with deffirent customers.
    like from usa,germany,uk.
    i created 3 cubes and uploaded records corresponding countries.
    i have written code like this in 3.5
    loop at data_package.
    if data_package-/bic/zcustomer <> 'usa'.
    delete data_package.
    endif.
    endloop.
    same logic i need to write in BI 7.0 now where can i write this logic, what modifications i need to change for BI 7.0
    regards
    suneel.

    Hi,
    Check this link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    I guess, you just need to change the DATA_PACKAGE to the new naming convention.
    Hope this helps.
    PB

  • How can I fix this code ?

    hello,
    I have a small problem with this code:
    #include  <fstream>
    #include  <iostream>
    #include  <algorithm>
    #include  <iterator>
    #include  <string>
    #include  <vector>
    using namespace std;
    int main()
         string from, to;
         cin >> from >> to;
         ifstream is(from.c_str());
         istream_iterator<string> ii(is);
         istream_iterator<string> eos;
         //  line 24: Error:
         vector<string> b(ii, eos);  //  line 24: Error:
         sort(b.begin(), b.end());
         ofstream os(to.c_str());
         ostream_iterator<string> oo(os, "\n");     
             unique_copy(b.begin(), b.end(), oo);     
             return !is.eof() && !os;          
             return 0;
    }When I compile this happens
    bash-2.05$ CC -V
    CC: Sun C++ 5.6 2004/06/02
    bash-2.05$ CC -o std_vector.out std_vector.cpp
    "std_vector.cpp", line 24: Error:
    Could not find a match for
    std::vector<std::string>::vector(std::istream_iterator<std::string, char, std::char_traits<char>, int>, std::istream_iterator<std::string, char, std::char_traits<char>, int>)needed in main().
    1 Error(s) detected.
    What can I do ?
    best regards
    Morten Gulbrandsen

    You have run into a documented limitation of the default libCstd implementation of the C++ standard library. The default library is not a complete implementation, and in particular lacks required template member functions that allow implicit type conversions. We still use this library for binary compatibility with earlier releases.
    The optional STLport version of the library is a full implementation of hte C++ Standard Library. If you don't need binary compatibility, meaning you don't need to link to code that uses libCstd, you can add the option -library=stlport4 to every CC command line, compiling and linking. Your sample code compiles with STLport.
    If you need to use libCstd, you might get this code to work by inserting explicit type conversions. I have not tried to see whether that actually can be done.

Maybe you are looking for

  • Help combining output data from an HP4140B and a LakeShore 330

    Hi! First of all, I would like to apologize if this question has already been answered in the forums, but I haven't been able to find anything for this particular situation... I am using LabView v.8.6 so as to conduct TSC (thermally stimulated curren

  • Error while creating search help

    Hi, I am getting an error "Elementary search help without hit list is meaningless" while creating a search help,.what could be the problem? Thanks, Rakesh.

  • JTable in JPanel cut off

    I'm trying to put a JTable with several elements in a JPanel and it is getting cut off. I have tried extending the gridbagconstraints with ipady but no luck. public class PumpMonitor extends JPanel JTable Table1; PumpMonitor() Table1Model dm = new Ta

  • Transfering data to new G5

    Pardon my ignorance but - I have an iMac G3 and would like to purchase a new G5 and I was wondering if I could simply connect the two via the USB port and tranfer files from old to new. thanks for your help, Rick

  • Adobe Premiere Elements 7 Smartfix

    I am working with APE 7 video and cannot get smartfix to be activated, I cannot find where to use it nor am I getting any dialog box. Here is what I found in the help file...I will run smart tagging, then drag the file over to the sceneline, but no d