How to avoid Duplicate values in Oracle forms

Hello Everyone,
I am new to Oracle forms, working on Oracle Applications : 12.1.2,
Here I have a form Receiving Transactions,
in that I have Lot_Number and quantity columns.
The purchased items need to be stored in Lot number.
If 100 quantities purchased then 100 quantities can be stored in single lot number
i.e
Lot_Number         Qty
  001                100or 100 quantities can be stored in different lot numbers.
i.e
Lot_Number         Qty
  001                50
  002                50(The qty may differ)but not like the following,
Lot_Number          Qty
  001                 50
  001                 50.For second line,If they selected same lot number as First lot number,
The error message has to be shown as "Lot number duplicated,Select Different Lot number or update the full qty in original line".
Can anyone help me to solve this.
Thank you.
Regards,
Gurujothi

Hi François Degrelle,
I added the following Plsql in the 'When-validate-Item' block,
declare
l_current_number varchar2(80);
begin     
l_current_number := :lot_entry.lot_number;
first_record;
loop
  if l_current_number = :lot_entry.lot_number then
     message ('Duplicate');
  end if;
  next_record;
end loop;Its started to check from First record itself and giving the message 'Duplicate',
How to check from second record?
when the first record is entered it should not check when the second record is entered it should compare with the First record value and if it is same then it should give message as 'Duplicate'.
Thank you.

Similar Messages

  • How to avoid duplicates values from alvgird see below code

    how to avoid duplicates values from alvgird see below code
    in below query docno no is repeated again and again
    how i can avoid duplication in this query.
    select * into corresponding fields of table itab
             from  J_1IEXCHDR
                     inner join  J_1IEXCDTL
                        on  J_1IEXCDTLlifnr =  J_1IEXCHDRlifnr
                     where  J_1IEXCHDr~status = 'P'.

    Hi Laxman,
    after that select statement
    select * into corresponding fields of table itab
    from J_1IEXCHDR
    inner join J_1IEXCDTL
    on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
    where J_1IEXCHDr~status = 'P'.
    <b>if sy-subrc = 0.
    delete adjucent duplicates from itab comparing <field name of itab internal table>
    endif.</b>
    this will delete your duplicate entries.once you done with this call the alv FM.
    <b>  call function 'REUSE_ALV_GRID_DISPLAY'</b>
    exporting
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = v_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'IT_USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       i_grid_title                      = 'Purchase Order Details'
      I_GRID_SETTINGS                   = I_GRID_SETTINGS
       is_layout                         = wa_layout
       it_fieldcat                       = it_fieldcat
      IT_EXCLUDING                      = IT_EXCLUDING
      IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
       it_sort                           = it_sort
      IT_FILTER                         = IT_FILTER
      IS_SEL_HIDE                       = IS_SEL_HIDE
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        = IS_VARIANT
       it_events                         = it_event
      IT_EVENT_EXIT                     = IT_EVENT_EXIT
      IS_PRINT                          = IS_PRINT
      IS_REPREP_ID                      = IS_REPREP_ID
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
      IT_HYPERLINK                      = IT_HYPERLINK
      IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
      IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
      IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER
        tables
    <b>      t_outtab                          = ITAB</b>
    exceptions
       program_error                     = 1
       others                            = 2
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Thanks
    Vikranth Khimavath

  • How to change the parameter's value of Oracle Forms Applet?

    Hello,
    I'm working with Oracle Forms 10.1.2.3.0 and JRE 1.6.0_14, we got some performance issues and we think are related with Java, so we enabled Java trace and we realized that every time user moves the cursor from one item to another, the applet sends a request to the server. This is the request.
    network: Connecting http://server/forms/lservlet;jsessionid=e53bb50b2f95ecb357451bf21a291367cc1747d2d9956b3ba1c4a05916d87d34.e34LaheTahaLai0LaxyLbN4ObxqTe6fznA5Pp7ftolbGmkTy with proxy=DIRECT
    I want to disable these connections as Sun states that sometimes they are not needed (not sure if this is the case but we want to test it).
    I got a possible answer from a Sun forum, the possible fix is to set the following property to false:
    <APPLET ...>
    <PARAM name="codebase_lookup" value="false">
    </APPLET>
    But I don't know how to pass that parameter to Oracle Forms applet.
    Does anybody know?
    Thanks.

    You can try passing the parameter in the HTML template file ... for example in the $ORACLE_HOME/forms/server/basejpi.htm
    i.e.
    <PARAM NAME="TYPE" VALUE="%jpi_mimetype%">
    <PARAM NAME="CODEBASE" VALUE="%codebase%">
    <PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
    <PARAM NAME="ARCHIVE" VALUE="%archive%" >
    <PARAM name="codebase_lookup" value="false">
    I have never done it myself so I do not know if it would be recognized though.

  • How can I code this in Oracle Forms?

    I have a master-detail form. In the detail block, I have several records. Here is my name table.
    ID Name_Type Name
    1 old Mike
    2 Current John
    3 old Peter
    4 old Andrew
    I would like to create a button trigger which shall perform the following:
    1) insert a record into database with a copy of current value. In the above case it will insert create a record for John as name_type = 'OLD'. So we have total of 5 records. Commit the transaction.
    2) Scroll through my detail records (5) and go to one specific record and erase the values from it. In the above case, it should find John's record with name_type = 'Current' and erase John from it.
    How can I accomplish this in Oracle forms using a button-pressed trigger?

    Hi,
    Simple, using current values you can create new id , 'old' and name so oracle will create record, now refresh block, next using next_record in loop you can find record,erase one and refresh block.
    Adinath Kamode

  • How to delete duplicate value in movement type 541 & 542(alv report)

    hi experts,
    i have some problem in alv report,
    input we can give some movement type for ex(101,102,541,542, etc)
    how to delete duplicate value in 541 and 542.
    regards
    gunasekaran.

    Try:
    Delete adjacent duplicates from ITAB comparing FIELD1, FIELD2.
    to do this the ITAB must be Sorted first.!

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to use unicode fonts in Oracle forms 10g?

    Hi I am working in forms 10g for quite a long time, the software that I have developed so far are all in English language. Now I have requirements to use Bengali Fonts in Forms 10g. I am facing difficulties doing that. Please reply with help. Thanks
    Hasan Al Mamun

    Check this forum post (though that is for 6i, it would be of helpful for you)
    How to use unicode fonts in Oracle forms 10g?
    -Arun

  • How to avoid duplicate posting of noted items for advance payment requests?

    How to avoid duplicate posting of noted items for advace payments request?

    Puttasiddappa,
    In the PS module, we allow the deletion of a component pruchase requisition allthough a purchase order exists. The system will send message CN707 "<i>A purchase order already exists for purchase requisition &</i>" as an Iinformation message by design to allow flexible project management.
    If you, however, desire the message CN707 to be of type E you have to
    modify the standard coding. Doing so, using SE91, you can invoke the
    where-used-list of message 707 in message class CN, and to change the
      i707(cn)
    to
      e707(cn)
    where desired.
    Also, user exit CNEX0039 provides the possibility to reject the
    deletion of a component according to customers needs e. g. you may
    check here whether a purchase order exists and reject the deletion.
    Hope this helps!
    Best regards
    Martina Modolell

  • How to invoke crystal reports from Oracle forms 11g R2 along with passing p

    How to invoke crystal reports from Oracle forms 11g R2 along with passing parameter to it.
    how to pass parameters to crystal report, please help.

    how to pass parameters to crystal report, please help.This would entirely depend on crystal reports and you might find informations on crystal reports related communities more likely...I for one have seen crystal reports the last time about 12 years ago. And even back then I simply acknowledged it's existence instead of working with it.
    Maybe crystal reports can be invoked via a URL call which would make it simple as you'd need simply build an URL and show the report using web.show_document. But that's pure speculation. Also you might not be the first with this requirement, so the solution to your problem might be right under your nose and just a little google search away ;)
    cheers

  • How to run others application in Oracle Forms on the web version?

    How to run others application in Oracle Forms on the web version?

    Pang,
    guess that you want to start client side programs from Forms on the Web. There is a sample on OTN (host bean) that allow you to acces sthe client and start executables.
    Frank

  • How to run batch file from oracle forms 9i

    Hi everyone.
    i have a data in csv file. i want to upload it to my database. i am using sql loader for it.
    i have made a batch file which run the sql loader and transfer my data to database.
    How to run batch file from oracle forms 9i.
    when i press the button, nothing uploads in my database. (when i simply run the batch file it works).
    here is my code
    Begin
    HOST('C:\temp\batchfile.bat');
    message('done');
    end;
    Thanks in advance
    regards
    sajid

    this is my log file, when i run manually.
    SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 1 23:27:53 2010
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: file_to_upload.ctl
    There are 2 data files:
    Data File: sk.csv
    Bad File: sk.bad
    Discard File: none specified
    (Allow all discards)
    Data File: sk1.csv
    Bad File: sk1.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table KHAN, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    SR FIRST * , O(") CHARACTER
    DATES NEXT * , O(") CHARACTER
    AGENT NEXT * , O(") CHARACTER
    COUNTRY NEXT * , O(") CHARACTER
    TRANSACTIONS NEXT * , O(") CHARACTER
    PKR NEXT * , O(") CHARACTER
    USD NEXT * , O(") CHARACTER
    BANK NEXT * , O(") CHARACTER
    Table KHAN:
    11088 Rows successfully loaded.
    0 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 132096 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 11088
    Total logical records rejected: 0
    Total logical records discarded: 0
    Run began on Thu Jul 01 23:27:53 2010
    Run ended on Thu Jul 01 23:27:54 2010
    Elapsed time was: 00:00:00.63
    CPU time was: 00:00:00.17

  • How to avoid Duplicate Records  while joining two tables

    Hi,
    I am trying to join three tables, basically two tables are same one is like history table, so I wrote a query like
    select
    e.id,
    e.seqNo,
    e.name,
    d.resDate,
    d.details
    from employees e,
    ((select * from dept)union(select * from dept_hist)) d
    join on d.id=e.id and e.seqno=d.seqno
    but this returing duplicate records.
    Could anyone please tell me how to avoid duplicate records of this query.

    Actually it is like if the record is processed it will be moved to hist table, so both table will not have same records and I need the record from both the tables so i have done the union of both the tables, so d will have the union of both records.
    But I am getting duplicate records if even I am distinct.

  • How to avoid duplicate data while inserting from sample.dat file to table

    Hi Guys,
    We have issue with duplicate data in flat file while loading data from sample.dat file to table. How to avoid duplicate data in control file.
    Can any one help me on this.
    Thanks in advance!
    Regards,
    LKR

    No, a control file will not remove duplicate data.
    You would be better to use an external table and then remove duplicate data using SQL as you query the data to insert it to your destination table.

  • How to raise an error message when duplicate value is entered in a tabular field column? Basically not allow duplicate value at the form level.

    Hi all,
    I have created a form with one data block MATURED_FD_DTL which looks like below:
    ACCT_FD_NO
    CUST_CODE
    FD_AMT
    FD_INT_BAL
    TDS
    CHQ_NO
    ADD_FD_AMT
    P_SAP_CODE
    P_TYPE
    CREATE TABLE MATURED_FD_DTL
      ACCT_FD_NO    VARCHAR2(17 BYTE)               NOT NULL,
      CUST_CODE     NUMBER(9),
      FD_AMT        NUMBER(15),
      FD_INT_BAL    NUMBER(15),
      TDS           NUMBER(15),
      CHQ_NO        NUMBER(10),
      ADD_FD_AMT    NUMBER(15),
      P_SAP_CODE    NUMBER(10),
      P_TYPE        VARCHAR2(1 BYTE)
    For MATURED_FD_DT.ACCT_FD_NO, Trigger: KEY_NEXT_ITEM, I have written the following code:
    DECLARE
    V1 NUMBER;
    V2 NUMBER;
    BEGIN
    V1:=:MATURED_FD_DTL.ACCT_FD_NO;
    MESSAGE('V1:'||V1);
    MESSAGE(' ');
    END;
         GO_ITEM('MATURED_FD_DTL.CUST_CODE');
    This is just a dummy code.
    When ever i enter the value in the field of ACCT_FD_NO, it pops up a message saying "V1:Value of ACCT_FD_NO",
    So i want to store that value .
    Compare them & if it is egual, it should pop up a message saying duplicate value is entered and must not allow to enter, at form_level.
    So how can I compare the ACCT_FD_NO value between FIRST_RECORD and NEXT_RECORD ??
    Help Me .
    Thank You.
    Oracle Forms 6i.
    Oracle 9i.

    Thank You HamidHelal.
    Actually before posting the code, I went through the first link you have mentioned. I tried also, it is quite tedious procedure, however i dint get the proper result, may be i have done some mistake. Anyways , can you tell me how do i check in database table, if a value exists OR IF VALUE FOUND & then message and raise form trigger failure; something like below.
    IF :MATURED_FD_DTL.ACCT_FD_NO EXISTS
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    OR
    IF :MATURED_FD_DTL.ACCT_FD_NO FOUND
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    Is there any equivalent in the form in oracle forms 6i?? Please let me know how do i do this??

  • How to avoid error while install oracle developer suite10g(forms & reports)

    hi dear all in recent times i am trying to install oracle developer suite 10g to learn forms and reports in my lap having windows 7 ultimate version ,32 bit,2.56 GB of ram .I downloaded two files ds_windows_x86_101202_disk1 and ds_window_x86_101202_disk2 and i downloaded Oracle universal Installer but i am unable to complete installation process ,When i click on complete(1.11gb) version which include forms,reports,xml,j developer I am facing this type of error message
    "Install has encountered an error while attempting to verify your virtual settings.please verify that the sum of the initial sizes of the paging files is at least 256 mb"
    Could any one help how to avoid this type of error message ? or else is there any other way to download Oracle forms and reports version

    Ok, Oracle Developer Suite (ODS) 10g (Forms/Reports) was not designed for Windows 7. In order to the ODS you must follow these steps for the installation to be successful.
    1. You must set the Virtual Memory (VM) size. The Oracle installer can not read Windows Managed VM. See the Microsoft article Change the size of virtual memory for more information on setting the VM size.
    2. The Oracle Installer does not recognize the internal version number of Windows 7, so you have to set the compatibility mode on the Setup.exe to Windows XP. Right-Click the SETUP.EXE and select properties. Then click the Compatibility Tab and in the Compatibility Mode area set this to "Run this program in compatibility mode" and select "Windows XP SP3".
    3. You must run the ODS setup.exe as the Administrator. Right-click the setup.exe and select "Run as Administrator".
    Having done these three steps, your installation should be successful.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • I cannot see the pictures in the photo albums (IPhone6)

    Hi, i have recently bought a new IPhone 6 and synced everything from Icloud to the new phone. Everything works perfectly except one little thing which i cannot solve.. I can see all the photo albums in the Photos but the albums i had created in my pr

  • Namespace Errors System Error 1355 - Specified domain does not exist or could not be contacted

    Ok, lets start with my environment: dc1 - windows server 2003 r2 dc2 - windows server 2012 r2 fs1- windows server 2003 r2 fs2 - windows server 2012 r2 Namespace - \\<fqdn>\data  (the fqdn would be like contoso.microsoft.com) I am in the process of mi

  • How to use the update mechanism in Photoshop CS10 for Camera Raw?

    Good Evenning! I would like to open .NEF files with Adobe Photoshop CS10 (RAW for Nikon D5200) but my version of Camera Raw is too old. I need at least the 7.3 version. When I try to download it, I have this message: Please use the update mechanism i

  • ORA-7445 followed by ORA-472

    Hi All, My System Configuration is CPU: Intel Xeon Dual Core 2.5GHz. RAM: 8 GB Databse : Oracle 10.2.0.2 Interim Oracle Patch: 18 SAP: Solution Manager OS: Windows 2003 Standard Edition x86_64 I have install the system successfully. I stop the SAP sy

  • Help with Signatures

    Hello, I am trying to sign a PDF with Adobe Reader XI on a MacBook Air.  I had an older version of Adobe that worked fine on another computer.  I've created a signature in the preferences and clicked it to be allowed to be used for signatures.  The s