Two array objects compareTo:

Have two arrays: ttt and ppp. I have to have a method to compare them.
public int compareTo(object ob)
both of the arrays are int type and both have super long numbers in them.
Thanks

Actually, the reflection api is pretty fast since
JDK1.4.0...No. Reflection could not be fast. In J2SDK1.4 it seems to be faster then in previous releases. But improvments do not include array operations. So here are some results of simple benchmark:
bash-2.05a$ /usr/java/jdk1.3.1_04/bin/java TestArray
Result for reflect copiing (3 elements, 1000000 times): 4915ms
Result for system copiing (3 elements, 1000000 times): 460ms
Result for pure java copiing (3 elements, 1000000 times): 137ms
bash-2.05a$
bash-2.05a$ /usr/java/j2sdk1.4.0_01/bin/java TestArray
Result for reflect copiing (3 elements, 1000000 times): 6082ms
Result for system copiing (3 elements, 1000000 times): 491ms
Result for pure java copiing (3 elements, 1000000 times): 115ms
bash-2.05a$
bash-2.05a$ /usr/java/j2sdk1.4.1/bin/java TestArray
Result for reflect copiing (3 elements, 1000000 times): 5738ms
Result for system copiing (3 elements, 1000000 times): 497ms
Result for pure java copiing (3 elements, 1000000 times): 157ms
bash-2.05a$
As you can see, in new Java reflect operations on arrays are even slower then in jdk1.3.1. System copiing is good alternative for pure java (element by element) copiing, espetially for big arrays. And here is the code of this benchmark, test it on your PC also:
import java.lang.reflect.*;
public class TestArray {
    static void doNothing(){}
    static int field;
    public static void main(String[] args) throws Exception {
        final int COUNT = 3, TIMES = 1000*1000;
        final String[] arr1 = new String[COUNT];
        final String[] arr2 = new String[COUNT];
            long time = -System.currentTimeMillis();
            for(int i=TIMES; i-->0;)
                copyReflect(arr1, arr2, COUNT);
            time += System.currentTimeMillis();
            System.out.println("Result for reflect copiing ("+COUNT+" elements, "+TIMES+" times): "+time+"ms");
            long time = -System.currentTimeMillis();
            for(int i=TIMES; i-->0;)
                copySystem(arr1, arr2, COUNT);
            time += System.currentTimeMillis();
            System.out.println("Result for system copiing ("+COUNT+" elements, "+TIMES+" times): "+time+"ms");
            long time = -System.currentTimeMillis();
            for(int i=TIMES; i-->0;)
                copyPureJava(arr1, arr2, COUNT);
            time += System.currentTimeMillis();
            System.out.println("Result for pure java copiing ("+COUNT+" elements, "+TIMES+" times): "+time+"ms");
    private static void copyReflect(Object src, Object dst, int count) {
        for(int i=count; i-->0; ) Array.set(dst, i, Array.get(src, i));
    private static void copySystem(Object src, Object dst, int count) {
        System.arraycopy(src, 0, dst, 0, count);
    private static void copyPureJava(String[] src, String[] dst, int count) {
        for(int i=count; i-->0; ) dst[i] = src;

Similar Messages

  • Comapring two Calender Objects  for same Date object

    hi,
    I am having problem with Comparing two Calender Objects which is having same Date value but time stamp is not same.when i printed as Calender.getTime()---->i found them as.
    Cal1----->Wed Feb 28 20:26:29 IST 2007
    Cal2------>Wed Feb 28 00:00:00 IST 2007
    Now the method:
    While(Cal1.getTime().compareTo(Cal2.getTime()) ==0 ) is Evaluating false.
    i dont want to be concerned with time stamp.i want condition to be true.
    Please help me .thx in advance.
    Cheers
    Akash

    My comment was directed at the fact that you gave the same answer I did, only faster. There is no other way I am aware of that will be any quicker. Of course, that is looking at a small piece of code out of context, so there may well be a better way.
    ~Tim
    Message was edited by:
    SomeoneElse

  • Can findText find two different objects at once?

    I have written a script that finds all italicized words, then compares them to a character style that italicizes characters. If there are any italicized words that do not use the character style, the user is alerted.
    Of course, not all fonts use a fontStyle that equals "Italic." Some use a fontStyle called "Oblique."
    I was trying to figure out how the findText function could find two fontStyles at the same time. My solution was to realize that each find is an array. So I made two finds and the concatenated the arrays. The resultant array (here called myFoundItems) elements can be searched through to find any that do not have the correct character style applied.
    My question is if the findText function can find more than two different objects at once or are we stuck with concatenating arrays?
    Below is part of the script:
    var myDoc = app.activeDocument;
    initFindReplace(); [This function zeros out anything left in the find/change preferences]
    app.findTextPreferences.fontStyle = "Italic";
    var myFoundItems1 = myDoc.findText();
    initFindReplace();
    app.findTextPreferences.fontStyle = "Oblique";
    var myFoundItems2 = myDoc.findText();
    initFindReplace();
    var myFoundItems = myFoundItems1.concat(myFoundItems2);
    Thanks,
    Tom

    Tom,
    The reason why you end up with an array of arrays is this: you define an array allMyFoundItems, then you iteratively collect other arrays using findText and insert ("push") these arrays into allMyFoundItems. Instead, you should use concatenate:
    var allMyFoundItems = new Array;
    for (. . .
       var myFoundItems = myDoc.findText();
       allMyFoundItems = allMyFoundItems.concat (myFoundItems)
    If you'll allow me a further comment, you could formulate your test to check whether a fontstyle name contains oblique or italic in one line:
    >if (arrFontStyles[k].search (/(italic|oblique)/i) > -1)
    And as the script searches but doesn't change anything, there's no need to set the ChangeTextPreferences. Your script could then be stated as follows:
    var myDoc = app.activeDocument;
    var arrFontStyles = myDoc.fonts.everyItem().fontStyleName;
    aa = findFontStyle (arrFontStyles);
    function findFontStyle (arrFontStyles)
       var allMyFoundItems = new Array;
       var myFoundItems2 = new Array;
       app.findTextPreferences = NothingEnum.NOTHING;
       for(var k = 0; k < arrFontStyles.length; k++)
          if (arrFontStyles[k].search (/(italic|oblique)/i) > -1)
             app.findTextPreferences.fontStyle = arrFontStyles[k];
             var myFoundItems = myDoc.findText();
             allMyFoundItems = allMyFoundItems.concat (myFoundItems);
             }//end if
          }//end for k
       return allMyFoundItems;
       }//end findFontStyle function
    As to formatting scripts in the forum, you can do this by wrapping your code in <pre> and </pre>. Also replace < with &lt; (< causes all lines of code to be displayed on one line). You should also replace curly quotes with straight codes, and tabs with (non-breaking) spaces. I use the following script for that:
    tf = app.documents.add().textFrames.add ({geometricBounds: [0,0,'700pt','500pt']})
    tf.insertionPoints[0].select();
    app.activeDocument.textPreferences.typographersQuotes = false;
    app.paste();
    app.findGrepPreferences = app.changeGrepPreferences = null;
    sara (tf, '&', '&amp;');
    sara (tf, '<', '&lt;');
    sara (tf, '\\t', '   ');
    sara (tf, "'", "'");
    sara (tf, '"', '"');
    tf.parentStory.insertionPoints[0].contents = '<pre>';
    tf.parentStory.insertionPoints[-1].contents = '</pre>';
    function sara (tf, f, r)
       app.findGrepPreferences.findWhat = f;
       app.changeGrepPreferences.changeTo = r;
       tf.parentStory.changeGrep ()
    Copy the text of the script you want to prepare for posting, then run this above script. It creates a new InDesign document, pastes your script into it, and makes all the necessary changes. Then copy that and paste it into the forum.
    Peter

  • Trying to pass Oracle array/object type to Java

    I have a Java class with two inner classes that are loaded into Oracle:
    public class PDFJ
        public static class TextObject
            public String font_name;
            public int font_size;
            public String font_style;
            public String text_string;
        public static class ColumnObject
            public int left_pos;
            public int right_pos;
            public int top_pos;
            public int bottom_pos;
            public int leading;
            public TextObject[] column_texts;
    }I have object types in Oracle as such that bind to the Java classes:
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT" AS OBJECT
    EXTERNAL NAME 'PDFJ$TextObject'
    LANGUAGE JAVA
    USING SQLData(
      "FONT_NAME" VARCHAR2(25) EXTERNAL NAME 'font_name',
      "FONT_SIZE" NUMBER EXTERNAL NAME 'font_size',
      "FONT_STYLE" VARCHAR2(1) EXTERNAL NAME 'font_style',
      "TEXT_STRING" VARCHAR2(4000) EXTERNAL NAME 'text_string'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT_ARRAY" AS
      TABLE OF "PROGRAMMER"."PDFJ_TEXT";
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN" AS OBJECT
    EXTERNAL NAME 'PDFJ$ColumnObject'
    LANGUAGE JAVA
    USING SQLData(
      "LEFT_POS" NUMBER EXTERNAL NAME 'left_pos',
      "RIGHT_POS" NUMBER EXTERNAL NAME 'right_pos',
      "TOP_POS" NUMBER EXTERNAL NAME 'top_pos',
      "BOTTOM_POS" NUMBER EXTERNAL NAME 'bottom_pos',
      "LEADING" NUMBER EXTERNAL NAME 'leading',
      "COLUMN_TEXTS" "PROGRAMMER"."PDFJ_TEXT_ARRAY" EXTERNAL NAME 'column_texts'
    CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN_ARRAY" AS
        TABLE OF "PROGRAMMER"."PDFJ_COLUMN";
    /I successfully (as far as I know) build a PDFJ_COLUMN_ARRAY object in a PL/SQL procedure. The PDFJ_COLUMN_ARRAY contains PDFJ_COLUMN objects; each of those objects contains a PDFJ_TEXT_ARRAY of PDFJ_TEXT objects (Example: pdf_column_array(i).pdf_text_array(i).text_string := 'something';). In this procedure, I pass this PDFJ_COLUMN_ARRAY as a parameter to a Java function. I assume the Java function parameter is supposed to be a oracle.sql.ARRAY object.
    I cannot figure out how to decompose this generic ARRAY object into a ColumnObject[] array. I also tried Googling and searching the forums, but I can't figure out matching search criteria. I was wondering if anyone here knows anything about passing user-defined Oracle type objects to a Java function and retrieving the user-defined Java class equivalents that they are supposedly mapped to--especially a user-defined array type of user-defined object types containing another user-defined array type of user-defined object types.

    Ok. I will try asking on the JDBC forum. So, don't
    flame me for cross-posting. :PWe won't, if over there you just post basically a
    link to this one.
    sigh Guess what, he did it the flame-deserving way. It's crossposted at:
    http://forum.java.sun.com/thread.jspa?threadID=602805
    <flame level="mild">Never ceases to amaze me how people don't think that posting a duplicate rather than a simple link isn't wasteful, as people could end up answering in both of them, not seeing each other's answers</flame>

  • Printing every possible pair combination of elements in two arrays??

    Hi there,
    I'm trying to implement the problem of printing every possible pair combination of elements in two arrays. The pattern I have in mind is very simple, I just don't know how to implement it. Here's an example:
    g[3] = {'A', 'B', 'C'}
    h[3] = {1, 2, 3}
    ...code...??
    Expected Output:
    A = 1
    B = 2
    C = 3
    A = 1
    B = 3
    C = 2
    A = 2
    B = 1
    C = 3
    A = 2
    B = 3
    C = 1
    A = 3
    B = 1
    C = 2
    A = 3
    B = 2
    C = 1
    The code should work for any array size, as long as both arrays are the same size. Anybody know how to code this??
    Cheers,
    Sean

    not a big fan of Java recursion, unless tail recursion, otherwise you are bound to have out of stack error. Here is some generic permutation method I wrote a while back:
    It is generic enough, should serve your purpose.
    * The method returns all permutations of given objects.  The input array is a two-dimensionary, with the 1st dimension being
    * the number of buckets (or distributions), and the 2nd dimension contains all possible items for each of the buckets.
    * When constructing the actual all permutations, the following logic is used:
    * take the following example:
    * 1    2    3
    * a    d    f
    * b    e    g
    * c
    * has 3 buckets (distributions): 1st one has 3 items, 2nd has 2 items and 3rd has 2 items as well.
    * All possible permutaions are:
    * a    d    f
    * a    d    g
    * a    e    f
    * a    e    g
    * b    d    f
    * b    d    g
    * b    e    f
    * b    e    g
    * c    d    f
    * c    d    g
    * c    e    f
    * c    e    g
    * You can see the pattern, every possiblity of 3rd bucket is repeated once, every possiblity of 2nd bucket is repeated twice,
    * and that of 1st is 4.  The number of repetition has a pattern to it, ie: the multiplication of permutation of all the
    * args after the current one.
    * Therefore: 1st bucket has 2*2 = 4 repetition, 2nd has 2*1 = 2 repetition while 3rd being the last one only has 1.
    * The method returns another two-dimensional array, with the 1st dimension represent the number of permutations, and the 2nd
    * dimension being the actual permutation.
    * Note that this method does not purposely filter out duplicated items in each of given buckets in the items, therefore, if
    * is any duplicates, then the output permutations will contain duplicates as well.  If filtering is needed, use
    * filterDuplicates(Obejct[][] items) first before calling this method.
    public static Object[][] returnPermutation(Object[][] items)
         int numberOfPermutations = 1;
         int i;
         int repeatNum = 1;
         int m = 0;
         for(i=0;i<items.length;i++)
              numberOfPermutations = numberOfPermutations * items.length;
         int[] dimension = {numberOfPermutations, items.length};
         Object[][] out = (Object[][])Array.newInstance(items.getClass().getComponentType().getComponentType(), dimension);
         for(i=(items.length-1);i>=0;i--)
              m = 0;
              while(m<numberOfPermutations)
                   for(int k=0;k<items[i].length;k++)
                        for(int l=0;l<repeatNum;l++)
                             out[m][i] = items[i][k];
                             m++;
              repeatNum = repeatNum*items[i].length;
         return out;
    /* This method will filter out any duplicate object in each bucket of the items
    public static Object[][] filterDuplicates(Object[][] items)
         int i;
         Class objectClassType = items.getClass().getComponentType().getComponentType();
         HashSet filter = new HashSet();
         int[] dimension = {items.length, 0};
         Object[][] out = (Object[][])Array.newInstance(objectClassType, dimension);
         for(i=0;i<items.length;i++)
              filter.addAll(Arrays.asList(items[i]));
              out[i] = filter.toArray((Object[])Array.newInstance(objectClassType, filter.size()));
              filter.clear();
         return out;

  • Can we create a 2 dimensionnal array (Object[][]) from List.toArray() ?

    I have a List that contains arrays and want to obtain a 2D array from the data stored into the list.
      //Creation of the list
      List list = new ArrayList() ;
      Object anArray = new Object[]{"One", "Two", "Three"} ;
      list.add(anArray) ;
      anArray = new Object[]{"Four", "Five", "Six"} ;
      list.add(anArray) ;
      anArray = new Object[]{"Seven", "Eight", "Nine"} ;
      list.add(anArray) ;
      //Creation of the array
      Object[][] data = (Object[][]) list.toArray() ;
      //We should obtain the same as :
      data = new Object[][]{
        {"One", "Two", "Three"},
        {"Four", "Five", "Six"},
        {"Seven", "Eight", "Nine"}
      } ;How can I, with a single instruction convert my List to an array of arrays (Object[][]) ?

    Object[][] data = (Object[][]) list.toArray(new Object[0][0]);

  • Problem w/ Arrays objects

    Hi there.
    I have two arrays. One contains three rectangles, and the other contains three circles. Something like this:
    var myRectArray:Array = [rect1, rect2, rect3];
    var myCircleArray:Array = [circle1, circle2, circle3];
    All six objects are clickable. How can I know to which array belongs the object clicked by the client?
    Please, I'll be very thankfull with any help regarding this issue.

    There are two variants:
    1. Create a Dictionary (see docs for more info) to get an array by object.
    So you need to add each object and an array.
    dict[rect1] = myRectsArray;
    dict[tr1] = myTrArray;
    and after
    var arr:Array = dict[event.target];
    Something like this.
    2. Create an extended Rectangle to save any data you need.
    I think the first variant is better.

  • Two resultset objects

    IS it possible to define two resultset objects with two different queries inside the same DB class?java.sql.SQLException: Invalid state, the ResultSet object is closed.
         at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(JtdsResultSet.java:299)
         at net.sourceforge.jtds.jdbc.MSCursorResultSet.next(MSCursorResultSet.java:1123)
         at DB5.getDetails(Daily_Quote_Response_report.java:238)
         at Daily_Quote_Response_report.main(Daily_Quote_Response_report.java:74)
    java.util.List items = null;
            String query;
            String query2;
            try {
                query =
                       "select * from oqrep_except_resp_summary";
                query2 = "select * from oqrep_except_resp_detail";
                Statement state = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                        ResultSet.CONCUR_READ_ONLY);
                ResultSet rs = state.executeQuery(query);
                ResultSet rs2 = state.executeQuery(query2);
              //cannot create two rs objects // ResultSet rs2 = state.executeQuery(query);
                items = new ArrayList();Edited by: bobz on 03-Dec-2009 11:16
    Edited by: bobz on 03-Dec-2009 11:16

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

  • About combing two array into one

    Hi all,
      I post a questiona bout converting an array of integer into char (byte) array and I got a solution already http://forums.ni.com/t5/LabVIEW/how-to-display-char-code-properly/m-p/2596087#M780368
    However, I enouther another problem while dealing with an array of  U16 type. I would like to extract the high and low byte from numbers (U16) stored in array. I extract the high and low byte for each U16 number and convert them as char, concatenate them to a string. Repeat this process for each element in the array so to get a big string with each element is a char for high and low byte. My code is enclosed as follows
    It works fine but I am concerning the speed. Is that any other way to do it fast and don't use loop (in real case, I will deal with pretty big array many times, efficiency is a problem). Note that the high and low bytes array extracted from the original array with the module Split number.vi, but how can I combine these two array in one code with data arranged as high-low-high-low ... ? Thanks.
    Solved!
    Go to Solution.

    PKIM wrote:
    However, I enouther another problem while dealing with an array of  U16 type. I would like to extract the high and low byte from numbers (U16) stored in array. I extract the high and low byte for each U16 number and convert them as char, concatenate them to a string. Repeat this process for each element in the array so to get a big string with each element is a char for high and low byte. My code is enclosed as follows
    It works fine but I am concerning the speed. Is that any other way to do it fast and don't use loop (in real case, I will deal with pretty big array many times, efficiency is a problem). Note that the high and low bytes array extracted from the original array with the module Split number.vi, but how can I combine these two array in one code with data arranged as high-low-high-low ... ? Thanks.
    You need to be more clear.
    Looking at the code, you are dealing with I16, not U16. Also your index array primitives could be replaced by autoindexing. Your use of the feedback node only makes sense if you want to append strings forever with stale data, thus growing data structures without limits. If you only want to convert the current data, remove the feedback mode and use a "concatenate strings" with a single input. A for loop is one of the most efficient data structures and using it is not a problem. One way or another the code needs top oerate on all data.
    All that said, I agree with Tim that most likely all you need to do is insert a typecast after the "to I16" and eliminate all other code.
    LabVIEW Champion . Do more with less code and in less time .

  • Two response objects within one servlet...

    Heya guys, quite new to java and got stuck for the whole day on this.
    I need to combine two responses inside one servlet. One response retrieves picture from the database and it works fine. Another one retrieves text from database also works fine on its own. Second i try to use both end up with hundreds of exceptions.
    Any idea what to do, not how...but what???
    Thanks

    Compiling 1 source file to F:\gopal\weba\WebApplication6\build\web\WEB-INF\classes
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:48:
    processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:57: processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    2 errors
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:295: The following error occurred while executing this line:
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:149: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)
    You cannot use two response object.

  • Two remote objects calls on the same php class

    Hi to all,
           I've encountered a strange issue while developing with remote objects.
    I've a mxml component with an init() method inside which is called by a menu.
    When the init() method is called it makes 7 remote object calls which are bound to some components' dataprovider.
    Among this calls I've got 2 remote object which refer to the same remote class. This because I have to call the class twice and the bind the result to two different combobox. Below you find the code:
    <mx:RemoteObject id="myFile" source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    <mx:RemoteObject id="myXls"  source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    in the init function I make this calls:
    myFile.listDir("dir_1")
    myXls.listDir("dir_2")
    then in the mxml code I bound the result of myFile to combobox1 and the result of myXls on combobox2.
    The problem arise when I call the myXls' listDir method. When I call it I receive the following error:
    code:
    Client.Error.DeliveryInDoubt
    Message:
    Channel disconnected
    Detail:
    Channel disconnected before an acknowledgement was received
    The strange thing is that not only the myXls object returns this error, but also all the other 6 remote object return the same error above.
    I'm not sure, but I guess that the error could be caused by the two remote object which call the same php remote class. If I comment one of the two calls everything works fine.
    Do you have any suggestion about?
    Thanks!!
    Bye
    Luke

    Hi Jan.
    1) We have the 2 VO, each with 3 rows to fill in data. What I mean is that when i just fill in all the fields for the first row of the first VO, and the value of one of these fields is bigger than 50, then after the exception is thrown and the message is displayed, the fields for the first VO are duplicated and shown in the second VO as if the user had inserted them.
    2) We tried yesterday the validateEntity and a Method and Atributte Validator approaches after reading that white paper with the same results.
    The validation is correctly done using any of the those methods.
    I will try to reproduce this issue with the HR schema.
    Thanks in advance once again.

  • Two authorizations objects with OR function instead of AND

    Hi,
    We have created two authorization (RSECADMIN) objects for a CRM InfoProvider:
    Organizational responsible
    Delivery unit.
    Both the two authorized relevant InfoObjects are used in the query.
    In the query we have used a two authorization variables.
    Now only values in the authorizations are checked where Organizational responsible are true AND Delivery unit are true.
    Is it possible to check the authorization where:
    Organizational responsible is true OR Delivery unit is true??
    Please help!
    Regards,
    Jos.

    Hi,
    hmmm Andreas, I must comment on that:
    what is required is to show any record having Object1 = True OR Object2 = TRUE.
    Logically it is the same than asking:
    Don't show records having (Object1 NOT True) AND (Object2 NOT True), correct me if I am wrong there (this is pure Boolean math...)
    Because BW doesn't support this it doesn't mean that ANY system cannot do it.
    Simply put with SQL
    SELECT * FROM TABLE
    WHERE OBJ1 = TRUE OR OBJ2 = TRUE works perfectly in ANY RDBMS.
    also
    SELECT * FROM TABLE
    WHERE NOT OBJ1 <> TRUE AND OBJ2 <> TRUE would work as well.
    It is just that BW always perform an AND when you filter two different objects.
    Jos could achieve what he wants by setting up some restricted key figures and work it out with conditions but definitively not with standard authorizations.
    Alternatively, as I already mentioned, compounding objects would work but not without modeling effort. Finally I believe that with user exits it would also be possible... I don't have time but I would as well investigate bringing both objects along with the provider in a multi and verify if that couldn't be done by semi/standard means finally...
    hope this shed some lights on the issue....
    regards,
    Olivier.

  • Two cost objects Sales order , OKB9 business area +order

    Hi All,
    While posting intercompany IR system thronging below error messageu2026
    Enter only one true account assignment
    Message no. KI249
    Diagnosis
    You made assignments to several objects in CO (cost center, order, project etc.). 2 of these have been created as true objects.
    System Response
    You are allowed only one account assignment for each cost-relevant account.
    What we found in our system:
    Conflict:  Actual Sales Order 3487909 is linked to PO via account assignment category 4& IC dummy sales order (OKB9 config Business area 3000 + order 807898 assigned.
    Due Two cost objects cannot be linked to one IR G/L account booking.
    What is the best solution for this to post Intercompany IR with conflict two cost objects.
    Regards,
    Adi

    Hi All,
    we facing an  issue with sales order cost objective vs OKB9 cost object.
    For IC PO service material, we assigned account assignment category 4.Reasonis Service material was not showing on G\R account.
    The G\L account 7898788, we assigned to Service Item (material type DIEN)  , for G\Cost 7898788 cost element is assigned in OKB9. Combination business + order 3478787.
    Now conflict with sales order cost objective vs OKB9  internal order cost object.
    While posting intercompany IR posting system thronging below error messageu2026
    Enter only one true account assignment
    Message no. KI249
    Diagnosis
    You made assignments to several objects in CO (cost center, order, project etc.). 2 of these have been created as true objects.
    System Response
    You are allowed only one account assignment for each cost-relevant account
    How to resolve this issue.. Do I make any config changes in the system to overcome this issue?
    Or any sub account to assinment  in VKOA config for internal orderu2026
    Regards,
    Adi

  • Two Business Objects to fill a Data Grid/table using Anchors?

    Hi,
    I have a SAP standard tile were a table (grid) is filled by an Business Object. I want to add an additional column and retrieve the value from another Business Object.
    My questions
    1) Can I use Anchors to automatically set the relationship between two Business Objects A & B, so that I can just Drag & Drop an additional field from Business Object B to the DataGrid of Business Object A in the design screen without writing additional code?
    2) Some BO's do come with a predefined relationship to other BO's, but in the case of I have to write a supply function do I have to use a specific "Data Source Type" such as "Business Object", "BusinessQuery" or "Business CollectioN"?
    3) I already tried to write a supply function, but I realized that the system does return for some BO's or BS's a object instance, if I call "gFactory.newBusinessQuery". Is there any logic/restriction behind?
    I know I can use RowLoaded2 and a unbound column, but I want to know if this approach is also possible?
    Thank you for any help,
    Regards,
    Andreas

    Hi Andreas,
    The answer to your question is YES. You can very well do it without any changes at the code level.
    The scenerio can be implemented using a concept called JointField Mapping in MAS.
    Scenerio 1 :
    If you want to display the extra field from another BO in a list tile on the click of a search button from the search tile , then
    Please do the following :
    1. Select the Busines Query that you have associated to the search tile and go to properties from the View Designer.
    2. In the properties, Click on the Joint Field Mapping and select the BO where the extra field id present and select the primary key, Segment Field associated, (extra field)BO Property that you want to display in the list tile.
    2. Add a new control (new Field) in the List tile - ie, From the Toolbox (Tileset COntrols).
    3.Go to properties of the newly added control. Associate the anchor as the same achor as the list tile was pointing to earlier. for eg : Y_BOCAPGEN.
    4. Then Go to BCOLFieldName property and give the property name as the newly added BO property name(New field).
    After everything is modelled, You will be able to see the extra field in your application!!!!
    NOTE : Ofcourse, After the Successful generation.
    Scenerio 2 :
    If you want to display an Extra Field in a Detail tile,
    1. Go to Relationship of the BO from the Detail tile and go to properties.
    2. In the properties, You can find the Joint Field Mapping porperty.
    3. This property is again modelled as explained in scenerio 1.
    Hope, It would have definetly helped and answered your query.
    Have a good day!!
    Best Regards,
    Vignesh Ravikumar.

  • Uix two view-objects on one entity-object synchronize

    Hi All
    I want to add some uix pages to an old project using ADF UIX and Business Components.
    I have an entity object to a table witch about 50 fields.
    Now I create two view objects due to a better performance. One witch seven attributes for the overwiew and one with all attributes for the detail page.
    They are related via a view link.
    I create the overview as a read-only-table and the detail-page as an input-form.
    The proplem is that the synchronization don't work. The detail page shows the first dataset ever.
    Has anyone a solution or a tip where I can found that?
    Is where a performance problem if I use one view-object for both pages?
    Thanks in advance
    Roger

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

Maybe you are looking for