How can I compare values in a multiple records block

I have a form with multiples records whit a date in each record. I need test if the date typed in record 2 is greather than the date on record 1, if the date typed in record 3 is greather than the date on record 1 and so on. How cai I do it???is grather than the date on record 1

Pedro,
Venelin's code works perfectly, but if you try to use it in a When-Validate-Item or When-Validate-Record trigger, it won't work since you can't invoke navigation routines (FIRST_RECORD, NEXT_RECORD) from these two triggers (among others).
First, we have to understand that Forms wasn't built to perform multi-row validations. It's a fact.
Second, the way I prefer to do this is: let the user enter the data as he wants.
When he commits, in a POST-FORMS-COMMIT trigger, you can check the values using SELECT statements, because they are already written to the data tables. If you don't like them, just issue a RAISE FORM_TRIGGER_FAILURE and the transaction gets rollbacked (and the inserts will be undone).
Hope this helps,
Pedro das Neves

Similar Messages

  • How can I compare the actual and expected values in Unit testing when they are XML files?

    I have created a unit test for a method in VS 2008. My expected value and actual value are XMLs. Therefore though the output is same as I expect it gives an error as I am doing string comparison now. How can I compare these 2 XMLs in expected output and
    actual output format in Unit Testing?
    mayooran99

    In unit test, when you want to validate XML files, you feed them into the class / struct that you want to feed the XML into and compare the values there (You don't just feed it in XMLReader and feed it line by line, right? But if it really is, that's how
    you should also test it in unit tests).
    In short, how you'd use the XML in your code, that's how you should test it in unit test.

  • How can I pass value in status and reason for rejection using BAPI_LEAD_CREATEMULTI when creating multiple lead

    Hello,
    I want pass value in STATUS and Reason for rejection according to requirement when i am creating multiple lead using BAPI_LEAD_CREATEMULTI. Please help me how can i pass value. Please give some sample code that in which table i have to pass values and please also tell me INPUT_FIELDS values. Please help me
    Regards,
    Kshitij Rathore

    Hello,
    Please help me for solve this problem. I am trying to solve problem from last 4 days but i didn't get any solution.
    Regards,
    Kshitij Rathore

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • How can I compare more than two VIs at a same time in labview 2009

    How can I compare more than two VIs at the same time. I am an Lab Engineer I have to check assignments submitted by students and I want to know how many of them are copied from each other. Labview compare VI can only compare two VI at a time while I want to check about 30 VIs at same time.
    Regards,

    I'm not aware of a tool to compare multiple VIs.  If you don't find anything, consider posting this to the LabVIEW Idea Exchange to expose this idea directly to NI R&D.
    Thanks!
    - Greg J

  • Java.util.Date oracle.jbo.domain.Date how can i compare?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){ // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    i get following error:
    Error(45,24): method <(java.util.Date,
    oracle.jbo.domain.Date) not found in class Class4
    if(calendar.getTime() <
    singleRow.getEO_ULN_BORROWFROM()); //singleRow returns
    oracle.jbo.domain.Date
    how can i compare those 2? You cannot compare these two values directly. You must convert the oracle.jbo.domain.Date object to a GregorianCalendar object. Something like:
      oracle.jbo.domain.Date dt = singleRow.getEO_ULN_BORROWFROM();
      GregorianCalendar gc = new GregorianCalendar(dt.getYear(), dt.getMonth(), dt.getDay());
      if (calendar.getTime() < gc.getTime())
      }

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • How can I compare two summary field in cross-tab?

    <p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab?  I have following cross-table:</p><p>Type          Sector1     Sector2    Sector3       Total </p><p>Outlook         10            11           9              30         </p><p>Target            5              3           1               9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>

    Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
    1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
    2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
    For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
    Best,
    Alexander

  • How can i compare in percentage, vowels and consonants in english and german language?

    how can i compare in percentage, vowels and consonants in english and german language?

    Hi,
    Try comparing the Unicode value of the characters, see the code samples in these threads:
    Generating unicode
    for arabic character similar to Character map in c#
    How
    do you get the numeric unicode value of a  character?
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i compare the character fields?

    I have a requirement to compare the character fields .
    I have to compare the 2 character fields of a table CDPOS
    As follows .
      If CDPOS-VALUE-OLD  GT  CDPOS-VALUE-NEW
          Populate    REDATED = ‘YES’.
    ELSE
          Populate  REDATED = ‘NO’.
    My doubt here is how can we compare the character fields.?
       When I do Extended Program Check: I am getting error like this ?
    Greater than/less than comparisons with character type operands may not be portable
    Please give me idea .
    Thanks ,
    Suresh Kumar.

    Hi suresh,
    DATA : a TYPE char10  VALUE 'DBCD',
           b TYPE char10  VALUE '4234',
           c TYPE char10  VALUE '3456',
           d TYPE char10  VALUE 'ADA',
           e TYPE char10 VALUE  '234567'.
    IF b GT c.        "this case checks for numeric values
      WRITE :/ 'B is bigger'.
    ELSE.
      WRITE :/ 'C is bigger'.
    ENDIF.
    IF a GT d.      "this case checks for alphbetical order
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF strlen( a ) GT strlen( d ). "this case checks for no of chars
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.
    IF a GT c.      "this case first alph then numerics
      WRITE :/ 'A is bigger'.
    ELSE.
      WRITE :/ 'D is bigger'.
    ENDIF.

  • How can I get values from listbox?

    Hi all,
    I need to get price values from Price List (Inventory -> Item Master Data screen). It's important to get values from field 'Price' BEFORE item will be added/updated.
    How can I get values from Pricelist listbox?
    Thanks for any suggestions or short sample code.
    Best regards,
    Andy

    Hi Andy
    Here is som sample code that will get the description of the price list and also the price that is displaying at the time. The item master must be open for this snippet of code
      Public Sub GetItemPriceFromOpenWindow()
            'this is assuming item master is open
            Dim oEdit As SAPbouiCOM.EditText
            oEdit = SBO_Application.Forms.GetForm("150", 1).Items.Item("34").Specific
            SBO_Application.MessageBox(oEdit.Value)
            Dim oCmb As SAPbouiCOM.ComboBox
            oCmb = SBO_Application.Forms.GetForm("150", 1).Items.Item("24").Specific
            SBO_Application.MessageBox(oCmb.Selected.Description)
        End Sub
    Hope it helps

  • HT1209 My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    My Itunes Library and iPhone have fallen out of sync on music over the yearsare - how can I compare my itunes library with my Iphone  to see what songs are missing from my library so I can then bring my Library up to date

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • How can I send a message to multiple contacts using "groups".

    How can I send a message to multiple contacts using "groups".
    It was easy on my sony ericssonn....do i need to download an app?

    There is no group send option like you are looking for.
    To send to a group you have to pick each person you want to send to and send as a group that way. Then don't delete that SMS thread and you can reuse it again later.
    As for an app, well SMS works via your carrier and the OS, not something an App can do unless the app send the data to them (a third party) and then they relay it to the carrier. Do you really want to be sending your SMS to some 3rd party first?

  • How can i organize my contacts on multiple devices

    how can i organize my contacts on multiple devices

    What I ment was: How can I organize my contacts into groups without leaving the "Contacts" app.

Maybe you are looking for

  • How do I install just the Lion installer via the lion recovery partition.

    I am trying to bootcamp windows 7 on my new macbook pro (early 2011), the installation was successfull but i am missing drivers on the windows side and cannot access the internet until i install them.  I installed all the bootcamp updates and put the

  • Tooltip in web dynpro abap

    Hi expert, i want to change the tooltip text at run time in my input filed . Thanks, Vikash

  • POVs on  PI7.1

    Hi, Can any one posted PI71. simple scenarios(ex : File to File, File to JDBC or SOAP to RFC etc..) demo steps at blogs ? Previously there are many blogs help me for learn & do on  XI and PI7.0. Please share those links to me. There are many but you

  • Who and Where am I ?

    Hi all, How can I get the name and path of the jar file that I was launched from ? Thank you

  • CPUJAN2008

    According to Metalkink and OTN cpujan2008 critical patch update is now available and can be found on metalink under the patches & updates tab. Anyone know how to find it? Patches & Updates offers me a search facility but no matter what product and ve