How to avoid duplicates from the form

when I'm enter MR number , all the data(Part number , Desc details) are displaying correct and then search for desc the duplicate data is displaying actually not duplicate, their MR number is different , but in the form we r showing only the Partnumber & Desc details. and its directly from the table.
this is the code for search the desc
DECLARE
WERE VARCHAR2(2000);
WERE1 VARCHAR2(1000);
FIND VARCHAR2(30);
BEGIN
     :GLOBAL.CODE :=:BLK_MR.SEARCH;
     GO_BLOCK('MR_SELECT_VIEW');
     --WERE :='WHERE MRD_CCNO =  '||TO_CHAR(:BLK_MR.MRNO)||' AND
-- ITEM_DESC LIKE '''||'%'||:GLOBAL.CODE||'%'||''' ORDER BY ITEM_DESC ';
MESSAGE(TO_CHAR(:BLK_MR.ITEM61));
MESSAGE(TO_CHAR(:BLK_MR.ITEM61));
     WERE :='WHERE MRD_CCNO IN ( SELECT VE_CC_NO FROM VE_MASTER WHERE VE_GROUP_CODE=
'||TO_CHAR(:BLK_MR.ITEM61)||'
AND VE_SUBGROUP_CODE='||TO_CHAR(:BLK_MR.VE_SUBGROUP)||')
AND ITEM_DESC LIKE '''||'%'||:GLOBAL.CODE||'%'||''' ORDER BY ITEM_DESC ';
MESSAGE(WERE);
MESSAGE(WERE);
     SET_BLOCK_PROPERTY('MR_SELECT_VIEW',ORDER_BY,'');
     SET_BLOCK_PROPERTY('MR_SELECT_VIEW',DEFAULT_WHERE,WERE );
EXECUTE_QUERY;     
END;
how to take the distinct partno from the table, since its is directly from the table.
b'cos its checking MR number as a where condition

HI!
I advise you to create one more block with data type=From clause And as Name nest select (select distinct....)... and then, make, for example on pressing the button change data type of the block:
set_block_property(block_name, QUERY_DATA_SOURCE_TYPE, get_block_property(block_name(with from clause), QUERY_DATA_SOURCE_TYPE));
set_block_property(block_name, QUERY_DATA_SOURCE_NAME, get_block_property(block_name(with from clause), QUERY_DATA_SOURCE_NAME));

Similar Messages

  • How to avoid duplicate on OAF form

    Hi,
    I have developed a search page in OAF and after search it queries some rows in Table region. one item is a textinputItem called "sequence".
    In this field user write values like (1, 2, 3, 4, 5.. etc). My requirement is to stop user from entering one sequence value again.. Means if he enters (1,2,3,3,3,4,5) then it should throw error.
    Let me know if you people, couldn't understand my requirement..
    I have developed something like this:
    public void checkseq()
    String sequence = "";
    OAViewObject vo = (OAViewObject)findViewObject("XXBCR12ToolkitVO1");
    vo.executeQuery();
    System.out.println("the row are" + vo.getAllRowsInRange().length);
    Row r[] = vo.getAllRowsInRange();
    int n = vo.getAllRowsInRange().length;
    for (int i = 0; i < n; i++)
    Regards,
    Parag

    Hi Nani,
    I am sharing this code which in working condition now.
    In below code I was just missing one IF condition ( if (sequence!=null)) in second loop, becoz of which it was throwing null pointer exception.
    Thanks for your kind help..
    public void ValidateSequence() {
    OAViewObject vo = (OAViewObject)findViewObject("XXBCR12ToolkitVO1");
    int rowcount = vo.getRowCount();
    System.out.println("rowcount"+ rowcount);
    String sequence[] = new String[rowcount];
    RowSetIterator SeqIterator;
    XXBCR12ToolkitVORowImpl row = null;
    SeqIterator = vo.createRowSetIterator("SeqIterator");
    SeqIterator.setRangeStart(0);
    SeqIterator.setRangeSize(rowcount);
    for (int i = 0; i < rowcount; i++) {
    row = (XXBCR12ToolkitVORowImpl)SeqIterator.getRowAtRangeIndex(i);
    if (row.getAttribute("LegacyColumnSeqNum") != null)
    sequence[i] =
    row.getAttribute("LegacyColumnSeqNum").toString();
    //System.out.println("value of sequence:= "+i+"="+sequence[i] );
    for (int i = 0; i < rowcount; i++) {
    for (int j = i + 1; j < rowcount; j++) {
    //System.out.println("Main "+sequence[i]+sequence[j]);
    if (sequence[i]!=null) {
    if (sequence[i].equals(sequence[j]))
    System.out.println("inside if for: "+sequence[i]+sequence[j]);
    throw new OAException("Sequence value duplicated. Please enter enter sequence number.",
    (byte)0);
    else {
    System.out.println("inside else for: "+sequence[i]+sequence[j]);

  • How to insert data from the form to the database problematically

    Hi,
    Please anyone can help me with a code to insert a new record in database using code.
    i have dragged and dropped createInsert operation and on their action calling insert() method in backing bean.
    But wat i m suppose to write code so that data will be inserted as well as committed?

    Hi,
    Always mention your JDev version and technologies used.
    Have you tried executing the commit method as well (inside your insert() method)?
    -Arun

  • 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 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 pass Data from one form to the other

    Hi all
    Can any one suggest me how to pass data from one form to the other form, which i zoomed from the original one?
    I tried to do this by passing parameter in Event Procedure but i am getting error msg when i am opening the zoomed form.
    If any one of u have any idea, give me a reply
    Thank you
    Suhasini

    If you choose the second alternative you should erase these global variables after the second form is opened
    You can erase the global variable using:
    erase('global_var')
    Greetings,
    Sim

  • How to run the 9I report from the forms menue 9i

    how to run the 9I report from the forms menue 9i.
    Shehzad Latif

    Hi,
    1. create a Reports Object node in Forms. If you use teh same object node name then you can write generic code that works in all Forms
    2. Get the whitepaper about Forms/reports integrtion
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    Frank

  • HT4191 How do I get to "When prompted, select Delete Notes to remove the duplicates from the device."?  I can't get to this!

    I have duplicate Notes on my iphone 4 (upgraded to iOS 5.1.1)  I have followed your instructions to remove the duplicates.  How do I get "select Detete Notes" to appear on my Mac?  I have connected my phone to my Mac and selected it in iTunes.  I clicked the Info pane and deselected the option to Sync Notes.  THEN WHAT should I do?  How do I get the prompt "Select Delete Notes to remove the duplicates from the device.  (I do want to sync them using the over-the-air feature.)

    I would try the following:
    First sync your phone with iTunes to create a new backup (just in case).  When done, disconnect your phone from your computer.
    Next be sure that all of your Notes are on your mac (Don't proceed any further if they aren't).  If so, turn off iCloud syncing for Notes on your phone go to Settings>iCloud and turning Notes to Off.  When prompted choose to delete the notes from your phone.
    Next, without connecting your phone to your computer, open iTunes and go to iTunes>Preferences, on the Devices tab check "Prevent...from syncing automatically".
    Now connect your phone to your computer, click on the name of your phone when it appears in iTunes on the left sidebar.
    Go to the Info tab and under Other check Sync Notes, then further down under Advanced: Replace information on this iPhone, check Notes.
    Click Apply at the bottom right to sync your phone.  This should sync the Notes from your mac to your phone and you should no longer have duplicate Notes.
    Next, on the Info tab uncheck Sync Notes and click Apply, when prompted select to keep the Notes on your phone (haven't tested this step but I believe you will be given the option to keep them on your phone).
    Now disconnect your phone from your computer and check the Notes on your phone to confirm that they are still there and that you don't have any duplicates.
    Next turn on iCloud syncing on your phone again by going to Settings>iCloud and turning Notes to On.
    On your computer, without connecting your phone, go back to iTunes>Preferences>Devices and uncheck "Prevent…from syncing automatically" to re-enable automatic syncing.
    That should do it.

  • After restoring my 3Gs I now have duplicate--sometimes triplicate calendar entries. How can I delete the duplicates from the phone?

    On the info tab I'm told that my calendar is being synced through MobileMe and directly with the computer resulting in duplicated data. How do I prevent that? And how do I now delete the duplicates from the phone?
    I notice that the entries from the computer show "Busy" in the status while the others--probably from MobileMe-- do not.
    Ron

    Solved the problem...I think. In the Calendar app I clicked on the Calendars button. There I found, under Show All Calendars "From My Mac." There I found not only the calendars as they appear in iCal and MobileMe, but the same items with brackets containing my MobileMe address plus other info that isn't visible enough to see what it is (looks like "@calendar).
    Ron

  • I have duplicate songs on my iOS devices from iCloud merging. The duplicate is not in the iTunes library. How do I delete the duplicates from the iOS ? Thanks,

    Anyone know how to delete songs from the iPhone and iPad duplicated using the iCloud.. . ? The songs do not show as duplicated in the music library.

    iTunes menu File > Devices - Transfer purchases.

  • 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.

  • HT1438 dont i have to submit a slip before giving back in my ipod for fixing? what do i do? how do i fill in the form?

    how do i fill in the form to give back my ipod and get a new one? whats the website i go to and what do i type in? can i change the color of my ipod from black to white?

    Follow the instructions here:
    Apple - Support - iPod - Service FAQ
    I do not think you can change the color but you can ask.

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

  • Assign Task to a specific user based on the value of DDL from the form

    Hello,
    Can any one please advise me on how to assign a task to a specific user based on the value of the drop down list from the form. E.g. user fills the form and before they submit the form they have to select one of the name from the drop down list so the form can go to that person for approval.
    Thanks in advance,
    Han

    I got it works now by using the xpath expression (in workbench) to assign to the selected user from the DDL in the form.

  • 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

Maybe you are looking for

  • Javax.naming.LinkException: .  Root exception is javax.naming.NameNotFoundException

    Hi I have a startup class which needs to access a local entity bean. It used to work in weblogic 6.1, i am currently migrating to 8.1 and i get a Link Exception. I tried to make the startup class as a listener with in the application (EAR), it still

  • Special g/l config

    hi experts, inside the screen of the special g/l cofig in tcode obyr  there is a field PLANNING LEVEL , can u explain me what purpose does this field fulfills. please give some suitable examples if possible. best regards sayeed

  • Identifying the Destination Address of a Received UDP Datagram

    I have a application where a potentially large number of IP addresses route to a single host. I need to listen for UDP datagrams on that host, and to be able to determine the IP address to which any received datagrams were originally sent. Unfortunat

  • Sprint Nav after 1.3.1 update

    I have a bone stock Pre which was purchased on day one of availability.I am having an issue with Sprint Nav where it will randomly truncate / drop all or part of a street name while giving voice directions. I have used this app daily and this was nev

  • Reinstalling Photoshop Elements 8

    My laptop had died. How do I reinstal  Elements 8 on my new computer using the serial number.