How 2 exit the Loop..?

Hello all,
Can any tell me how to get out of this Loop in case of changing the range registered or stored in the db on update in a reange smaller than rang_to i got the message and the raise poped up i need the following logic 2 covers all possible ranges so can any boady help me, sorry 4 the cap locks and sorry that i have to leave 2 4 a vacation..)) reallly..!
Well the following code describes my case is as follows:
=========================================
--------------------------------RANGE VALIDATION----------------------
DECLARE
V_MESSAGE NUMBER(2);
V_RANGE_TO DATE ;
V_RANGE_FROM DATE;
--V_TANK_COUNT       NUMBER;     
CURSOR RANGE_CURSOR IS
SELECT TANK_CODE,RANGE_TO,RANGE_FROM
FROM PLN_TANK_DEPTH_RANGE
WHERE TANK_CODE= :PLN_TANK_DEPTH_RANGE.TANK_CODE;
BEGIN
FOR I IN RANGE_CURSOR LOOP
--- INSIDE THE RANGE
IF ((:PLN_TANK_DEPTH_RANGE.RANGE_FROM >= I.RANGE_FROM ) AND(:PLN_TANK_DEPTH_RANGE.RANGE_TO <= I.RANGE_TO ) ) OR ((:PLN_TANK_DEPTH_RANGE.RANGE_FROM > I.RANGE_FROM ) AND (:PLN_TANK_DEPTH_RANGE.RANGE_FROM <= I.RANGE_TO )) THEN          
V_MESSAGE := FUNC_MSG(1,'not within the range);
RAISE FORM_TRIGGER_FAILURE;          
          ELSIF (:PLN_TANK_DEPTH_RANGE.RANGE_FROM > I.RANGE_FROM ) AND (:PLN_TANK_DEPTH_RANGE.RANGE_FROM < I.RANGE_TO ) AND (:PLN_TANK_DEPTH_RANGE.RANGE_TO > I.RANGE_TO ) THEN     
V_MESSAGE := FUNC_MSG(1,'not within the range);
          RAISE FORM_TRIGGER_FAILURE;
          ELSIF (:PLN_TANK_DEPTH_RANGE.RANGE_FROM < I.RANGE_FROM ) AND (:PLN_TANK_DEPTH_RANGE.RANGE_TO > I.RANGE_FROM ) THEN               
          V_MESSAGE := FUNC_MSG(1,'not within the range);          RAISE FORM_TRIGGER_FAILURE;     
          ELSIF (:PLN_TANK_DEPTH_RANGE.RANGE_FROM < I.RANGE_FROM ) AND (:PLN_TANK_DEPTH_RANGE.RANGE_TO > I.RANGE_TO ) THEN     
                    V_MESSAGE := FUNC_MSG(1,'not within the range);          RAISE FORM_TRIGGER_FAILURE;     
          END IF;          
     END LOOP;          
END;
===========================================================
Any suggestions will be welcomed,
Regards,
Abdetu..
===========================================================

Exit;

Similar Messages

  • Exiting the loop.....

    I am writing an app that reads an arbitrary # of int's ranging from 0 to 50 inclusive and counts how many times each number is entered. After the input has been processed - prints all the values and number of occurances for each number.
    Here is what I have so far. I am having trouble exiting the do..while loop without getting errors. I don't want the user to have to reply "y" or "n" after each entry. Any ideas?????
    import cs1.Keyboard;
    public class IntegerCount
    public static void main (String[] args)
    final int MIN = 0;
    final int MAX = 50;
    int[] numbers = new int[MAX];
    int[] numbers2 = new int[MAX];
    int index = 0;
    int num = 0;
    char stop;
    System.out.println ("Enter a number between 0 and 50: ");
    System.out.println ("To summarize your values enter the = ");
    do
    stop = Keyboard.readChar();
    num = Keyboard.readInt();
    numbers[index] = num;
    index++;
    while ((num>=0 && num<=50) && stop != '=');
    index = 0;
    for (int i = index; index < numbers.length; index++)
    if (numbers[index] != 0)
    System.out.println (index + " " + numbers[index]); //test numbers[]
    numbers2[numbers[index]] = numbers2[numbers[index]] + 1;
    index = 0;
    for (int i = index; index < numbers2.length; index++)
    if (numbers2[index] != 0)
    System.out.println (index + " " + numbers2[index]);

    It looks like the limitation requiring the entry of a y or an
    n is contained in the Keyboard class. If you will
    substitute this code for the do loop, it will take care of
    the problem:
    String s = "";
    int num = 0;
    int total = 0;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    do {
         try {
              s = br.readLine().trim();
         catch (IOException ioe) {
              ioe.printStackTrace();
         if (s.charAt(0) != '=') {
              try {
                   num = Integer.parseInt(s);
              catch(NumberFormatException nfe) {
                   System.out.println("Invalid number.  Zero substituted.");
                   num = 0;
              total += num;
    while(s.charAt(0) != '=' && (num >= 0 && num <= 50));Mark

  • Exit the loop of screen in Module pool

    Hi,
    My requirement is : in my screen i have Table control. When i select any line (the value of select coloum will be 'X' ) and click on one button (Detail is button in my screen) the loop - endloop should exit at that line.
    for example : if i select 5th line of table control then the data of 5th line will be in the header of internal table and the value of select coloum will be 'X'. i want to exit at that point itself. i dont want internal table to loop in PAI.
    my code is :
    PROCESS AFTER INPUT.
    LOOP AT IT_ZINVH.
      MODULE EXIT_LOOP.
    ENDLOOP.
    MODULE EXIT_LOOP INPUT.
    IF IT_ZINVH-SEL = 'X'.
    EXIT .
    ENDIF.
    ENDMODULE.  but here if i use EXIT it is only comming out of IF-ENDIF contidion.
    Thanks & Regards

    Hi,
    Try this way.
    <li>Code PAI like below
    PROCESS AFTER INPUT.
      LOOP AT it_zinvh.
        MODULE read_table_control.
      ENDLOOP.
      MODULE user_command_1001.
    <li>Module read_table_Control should be like below.
    *&      Module  READ_TABLE_CONTROL  INPUT
    MODULE read_table_control INPUT.
      MODIFY it_nfal INDEX tchkbox-current_line.
      "The above Modify statement modifies the table for the column SEL = 'X'.
    ENDMODULE.                 " READ_TABLE_CONTROL  INPUT
    <li>Write action when you click on DETAIL button. Lets say DETAIL is the function code for Details screen button.
    *&      Module  USER_COMMAND_1001  INPUT
    MODULE user_command_1001 INPUT.
      CLEAR ok_code.
      ok_code = sy-ucomm.
      CASE ok_code.
        WHEN 'DETAIL'.
          LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
          LOOP AT it_zinhv WHERE sel = 'X'.
            WRITE:it_zinhv.
            EXIT.
          ENDLOOP.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1001  INPUT
    Thanks
    Venkat.O

  • Prematurely exit enumeration loop

    i am enumerating thru a loop
    upon a certain condition, i want to exit the loop, while keeping the object of the current enumeration in tact.
    Foo foo = null;
    Enumeration = fooVector.elements();
    while(Enumeration.hasMoreElements())
      foo = (Foo) enumeration.nextElement(); // get a foo
      if (some condition is met)
        // exit loop, but keep object foo in tact
        // that is, don't do foo = nextElement()
    }I suppose i could do the following, but is there anything more graceful?
    Foo foo = null;
    Foo foundFoo = null;
    boolean found = false;
    Enumeration = fooVector.elements();
    while(Enumeration.hasMoreElements())
      foo = (Foo) enumeration.nextElement(); // get a foo
      if ((some condition is met)  && (! found))
        foundFoo = new Foo(foo);
        found = true;
    // use foundFoo

    Foo foo = null;
    Enumeration = fooVector.elements();
    while(Enumeration.hasMoreElements())
    foo = (Foo) enumeration.nextElement(); // get a
    a foo
    if (some condition is met)
    {break; //This is what you want to do
    // exit loop, but keep object foo in tact
    // that is, don't do foo = nextElement()
    /Kaj

  • Set a container element inside class to exit a loop

    Hi,
    I want to set a container element inside a class to exit a loop.
    The element is marked as import/export parameter and the binding from the task to the container exists as well.
    The loop has a condition  &finish& = X but I cannot exit the loop. Looks like the value gets never updated in the container.
    When i am using a container operation to set the element its working but i want to do this out of my method in the class.
    Is it not possible to change a container element inside a loop without using a container operation?
    Thanks,
    Christoph

    Hi,
    Using the container operation is a good method to solve the problem. But if you intend to do that in the method coding itself then you will have to have it as the export parameter of the method. You can view all the import and export parameters of a method by going to the Business Object Builder (SWO1) and then choose the method and click on the "Parameters" Button. Once you are done with the interface of the method use that method in the workflow builder as a task and in the binding there are two rows. One for the import that occurs just below the container elements and the export parameters appear below the import in a separate window. Make sure you have the binding set there too as this is where you can transfer the container elements back to the workflow container from the task container and it should work. Maybe you are missing that in the binding.
    Hope it helps,
    Sudhi

  • EXITING FROM LOOP

    if in a loop iam checkin a condition n if the condition satisfies then which is the best way to exit the loop.

    Hi Sushant,
    Use EXIT in the LOOP after the condition .If u use STOP it will exit from the Program.
    Try this example creating a Program by uncommending EXIT and STOP.
    DATA: t_mara TYPE STANDARD TABLE OF mara.
    DATA: w_mara TYPE mara,
              sum     TYPE i.
    SELECT matnr mtart FROM mara INTO CORRESPONDING FIELDS OF TABLE t_mara
    WHERE mtart EQ 'KMAT' OR mtart EQ 'FERT' OR mtart EQ 'LGUT'.
    sum = 0.
    IF sy-subrc EQ 0.
      SORT t_mara BY mtart.
      LOOP AT t_mara INTO w_mara.
        IF w_mara-mtart EQ 'LGUT'.
          sum = sum + 1.
    EXIT.
          *STOP.
        ENDIF.
      ENDLOOP.
    ENDIF.
    WRITE : sum.
    Reward Points if useful.
    Regards
    Avi...

  • How do I create a 1d array that takes a single calculation and insert the result into the first row and then the next calculation the next time the loop passes that point and puts the results in thsecond row and so on until the loop is exited.

    The attached file is work inprogress, with some dummy data sp that I can test it out without having to connect to equipment.
    The second tab is the one that I am having the problem with. the output array from the replace element appears to be starting at the index position of 1 rather than 0 but that is ok it is still show that the new data is placed in incrementing element locations. However the main array that I am trying to build that is suppose to take each new calculation and place it in the next index(row) does not ap
    pear to be working or at least I am not getting any indication on the inidcator.
    Basically what I am attempting to do is is gather some pulses from adevice for a minute, place the results for a calculation, so that it displays then do the same again the next minute, but put these result in the next row and so on until the specifiied time has expired and the loop exits. I need to have all results displayed and keep building the array(display until, the end of the test)Eventually I will have to include a min max section that displays the min and max values calculated, but that should be easy with the min max function.Actually I thought this should have been easy but, I gues I can not see the forest through the trees. Can any one help to slear this up for me.
    Attachments:
    regulation_tester_7_loops.vi ‏244 KB

    I didn't really have time to dig in and understand your program in depth,
    but I have a few tips for you that might things a bit easier:
    - You use local variables excessively which really complicates things. Try
    not to use them and it will make your life easier.
    - If you flowchart the design (very similar to a dataflow diagram, keep in
    mind!) you want to gather data, calculate a value from that data, store the
    calculation in an array, and loop while the time is in a certain range. So
    theres really not much need for a sequence as long as you get rid of the
    local variables (sequences also complicate things)
    - You loop again if timepassed+1 is still less than some constant. Rather
    than messing with locals it seems so much easier to use a shiftregister (if
    absolutely necessary) or in this case base it upon the number of iterations
    of the loop. In this case it looks like "time passed" is the same thing as
    the number of loop iterations, but I didn't check closely. There's an i
    terminal in your whileloop to read for the number of iterations.
    - After having simplified your design by eliminating unnecessary sequence
    and local variables, you should be able to draw out the labview diagram.
    Don't try to use the "insert into array" vis since theres no need. Each
    iteration of your loop calculates a number which goes into the next position
    of the array right? Pass your result outside the loop, and enable indexing
    on the terminal so Labview automatically generates the array for you. If
    your calculation is a function of previous data, then use a shift register
    to keep previous values around.
    I wish you luck. Post again if you have any questions. Without a more
    detailed understanding of your task at hand it's kind of hard to post actual
    code suggestions for you.
    -joey
    "nelsons" wrote in message
    news:[email protected]...
    > how do I create a 1d array that takes a single calculation and insert
    > the result into the first row and then the next calculation the next
    > time the loop passes that point and puts the results in thsecond row
    > and so on until the loop is exited.
    >
    > The attached file is work inprogress, with some dummy data sp that I
    > can test it out without having to connect to equipment.
    > The second tab is the one that I am having the problem with. the
    > output array from the replace element appears to be starting at the
    > index position of 1 rather than 0 but that is ok it is still show that
    > the new data is placed in incrementing element locations. However the
    > main array that I am trying to build that is suppose to take each new
    > calculation and place it in the next index(row) does not appear to be
    > working or at least I am not getting any indication on the inidcator.
    >
    > Basically what I am attempting to do is is gather some pulses from
    > adevice for a minute, place the results for a calculation, so that it
    > displays then do the same again the next minute, but put these result
    > in the next row and so on until the specifiied time has expired and
    > the loop exits. I need to have all results displayed and keep building
    > the array(display until, the end of the test)Eventually I will have to
    > include a min max section that displays the min and max values
    > calculated, but that should be easy with the min max function.Actually
    > I thought this should have been easy but, I gues I can not see the
    > forest through the trees. Can any one help to slear this up for me.

  • How to exit from the loop

    loop at itab.
    if <CONDITION>
    <EXIT LOOP>
    endif
    endloop.
    this ths condition , pz tel how to exit from loop

    Hi
    Loop
       statements
    EXIT
    Endloop.
    Will comes out of the loop.
    Regards,
    Sreeram Kumar.Madisetty

  • How to EXIT the while loop in Event response section?

    I'm writing a program to grab image using a NI card. The application uses the Event structure. When the GRAB button was pressed, it snaps image continually by putting the SNAP function in a while loop. Is there some way to exit the while loop?(Note :The while loop was put in the GRAB IMAGE event response section.)

    edit this event-case AND uncheck "lock front panel until the event case for this event completes".
    BTW, your thanks should go to Ankita, <a href='http://forums.ni.com/ni/board/message?board.id=170&message.id=151282'>here</a>
    cheers! 
    Message Edited by Dynamik on 11-13-2005 01:26 AM
    Message Edited by Dynamik on 11-13-2005 01:38 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    untitled.GIF ‏20 KB

  • HOW DO I KEEP AN ARRAYLIST IN RANDOM ORDER AFTER EXITING THE SUB ROUTINE CONTAINING IT

    PLEASE HELP!I am trying to go from VB4 which I loved to VB2010 which I find somewhat more challenging. I’ve searched the web for help and have adapted the following to my project. This code does
    rotate randomly through every card in the deck and displays unique cards until all have been drawn. BUT I want to draw one card
    only from the first “hat” of Boy’s names; then draw the second card from the second “hat” of Girl’s names and repeat this process until all cards in both decks have been drawn. How do I get the TextBox (OR any
    MsgBox) to display JUST ONE unique random card at a time so I can exit that deck and go to the next deck?
    On my form, I have two TextBoxes (to display the names (as drawn), two buttons (to re-load each deck once exhausted) and one command (&End)control (to end the process). I created two ArraysLists
    (to hold the Boys names and Girls names separately) and two ArrayLists to hold the cards for the random decks when created in code.
    I can
    NOT get this code to draw random UNIQUE names once I exit the deck. I have tried to ReDim the deck; randomly pull a card from the second (temp) deck, etc
    NOTHING seems to work.
    WHY does my deck lose randomness once I exit it?
    How can I fix it? I don’t understand this. Below is the code for the "hat" with the 10 girl's names.
    Also, when I don't loop through all the cards, I usually get "An Out of Index exception was not handled" error. Hope someone can help me with this problem. It seems like this should
    be easy BUT I'm baffled. Thank you for any help.
    Imports System.Collections.Generic
    Public Class Form1
    Dim Count As Integer
    Dim Rcard As New ArrayList
    Dim Dcard As New ArrayList
    Dim NewRDeck As New ArrayList
    Dim NewDDeck As New ArrayList
    Dim temp_Rnum As Integer
    Dim temp_Dnum As Integer
    Dim MyRand As New Random()
    Public Sub Rcards_Click(sender As Object, e As System.EventArgs) Handles Rcards.Click
    While Rcard.Count > 0
    Dim temp_Rnum As Integer = Int(MyRand.Next(Rcard.Count))
    NewRDeck(temp_Rnum) = Rcard(temp_Rnum)
    Rem Check that the ArrayLists work correctly and display properly
    MsgBox(Rcard(temp_Rnum), , "New random card selected is: ")
    Console.WriteLine(Rcard(temp_Rnum))
    Rcard.Text = (Rcard(temp_Rnum))
    REM Now remove the Rcard with the random number generated so it can't be drawn again
    Rcard.RemoveAt(temp_Rnum)
    End While
    REM When all 10 cards have been picked, alert player to re-load deck if desired.
    MsgBox("No new cards left in deck; please Re-Load the cards. Thank you.")
    EndSub
    End Class

    Hi Acamar,
    Thank you for such a fast response. Sorry if my text wasn't clear. I'm really struggling with creating unique random elements in Collections in VB2010 and feel I understand ArrayLists better than some of the other Collection types.The code works perfectly
    and generates unique random cards until the original deck is exhausted. Then it prompts the user to re-load the original deck so it can be reused if needed. But I need to draw one card only and exit the deck. Then when I click on the TextBox again, I want
    that deck to be in the same random order - just minus any cards I have already drawn and thrown away.  Thanks again for your help.
    Here's the rest of the code for just the girl's "hats" of names, if it helps:
    Private Sub btnShuffleRCards_Click(sender
    As System.Object, e
    As System.EventArgs)
    Handles btnShuffleRCards.Click
    Dim j As
    Integer
    For j = 1 To 10
    NewRDeck.Add(j)
    Next j
    Randomize()
    REM Create original Deck with names for the girls.
    Rcard.Add("1 HELEN”)
    Rcard.Add("2 OLIVIA")
    Rcard.Add("3 <st1:city w:st="on"><st1:place w:st="on">ALICE</st1:place></st1:city>")
    Rcard.Add("4 VALERIE")
    Rcard.Add("5 DONNA")
    Rcard.Add("6 ZELDA")
    Rcard.Add("7 MARGARIE")
    Rcard.Add("8 <st1:city w:st="on"><st1:place w:st="on">NANCY</st1:place></st1:city>")
    Rcard.Add("9 WANDA")
    Rcard.Add("10 IRENE")
    End Sub

  • Multi-record block (how do I loop through the block)

    I created a two canvas form. On the first canvas, the user enters data and selects 1 - 30
    reports that they want to run. When they click on <NEXT> button, I create a multi-record
    control block and display each record on the second screen using
    go_block;
    clear_block;
    move data;
    create_record;
    The user then selects on the second canvas which reports to run now and which to run later via
    a LOV. When they press the <RUN> button, I want to start at the first record and either run the
    report or schedule it. Then I want to move onto the second and the third until all selected reports
    have been handled. I know I should use a loop but can't seem to make it work.
    So my question is, How do I loop through the records in a multi-record control block, pass the information
    for that one record to a parameter form and then execute the request? Each control block record contains
    10 parameter fields.
    Thanks.
    Bob

    go_record(1);
    << do your processing >> -- This is executed only for the first record.
    if :system.last_record = 'TRUE' then -- If the 1st record is also the last record.
    RETURN;
    end if;
    LOOP
    next_record;
    << do your processing >>
    if :system.last_record = 'TRUE' then
    EXIT;
    end if;
    END LOOP;
    I created a two canvas form. On the first canvas, the user enters data and selects 1 - 30
    reports that they want to run. When they click on <NEXT> button, I create a multi-record
    control block and display each record on the second screen using
    go_block;
    clear_block;
    move data;
    create_record;
    The user then selects on the second canvas which reports to run now and which to run later via
    a LOV. When they press the <RUN> button, I want to start at the first record and either run the
    report or schedule it. Then I want to move onto the second and the third until all selected reports
    have been handled. I know I should use a loop but can't seem to make it work.
    So my question is, How do I loop through the records in a multi-record control block, pass the information
    for that one record to a parameter form and then execute the request? Each control block record contains
    10 parameter fields.
    Thanks.
    Bob

  • How to exit from loop after 3  time

    hi
    how to exit from loop after 3  time
    loop at itab.
    <exit after 3 time>
    endloop.
    thanks

    Hi,
    You can check the value of SY_TABIX inside loop,
    For Example:
    Loop at itab.
    if sy-tabix  = 3.
    Exit.
    endif.
    Endloop.
    Hope it helps
    Regrds
    Mansi

  • How can I access the value of a loop index outside the loop?

    I have a sequence structure in Labview 8.6.  At one frame of the sequence I have a while loop.  The loop runs for a while and then stops and the program then moves to the next frame of the sequence.  Several frames further on down the sequence I have a cluster, the elements of which are outputs on the front panel.  The index of the mentioned loop is one of the cluster elements, an numeric output.  While the loop is running, I want the index to be displayed on the front panel in the output contained in the cluster.  How can I do this?

    The easiest way to do this is to use a local variable of your cluster.  You'll need one copy set to read; connect that to a bundle by name, bundle in your index value from the loop, and wire the bundle output to a write copy of your local variable.  You can create a local variable by right-clicking on the cluster terminal (in the block diagram) and choosing create local variable.  You can change the local variable to read or write by right-clicking on it.
    However, in general the use of both local variables and sequence structures is discouraged, and the right solution may be to rewrite your code with a while loop containing a case structure in which you update the cluster every time through the loop.  This will look like a state machine; you'll also need a shift register in place of the loop iteration counter.  If you post your code (ideally the VI, but if not then a screenshot of the block diagram) then we can provide more useful assistance.

  • Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Working in Logic 9, how do I use a drum loop WITH ITS PRESET EFFECTS? I can drag and drop the loop but it plays dry in timeline. thanks

    Here's the short-cut solution:
    Green Apple tracks are MIDI files (so to speak). If you drag one from the loop browser (Capitol C Orchestral hit, as you mentioned in this exable) directly into the arrange page it creates the MIDI file and the instrument to play it back on.
    HOWEVER.If you create and audio track first, THEN drag the green Apple loop onto that track, the loop will get "bounced" with the reverb in tact and you'll have the exact sound that you heard in the preview.
    Make sense?

  • I have had a reinstall nightmare getting my loops back they are in the apple library, I can access them through the media browser but I only have a few available through the loop browser, how do I get them all back there again? please help

    I have had a reinstall nightmare getting my loops back they are in the apple library, I can access them through the media browser but I only have a few available through the loop browser, how do I get them all back there again? please help

    "Where do I find my hundreds of dollars of downloads I have done since 2005?"
    They will only be where you put them  If you are doing the very basics, then they will be on your computer and they will be in your backup copy of your computer.
    The itunes store is not global at all, never has been. You cannot redownload your content from another country.  You can only use the countrys itunes store for the country that you are physically located.

Maybe you are looking for

  • My left speaker is no longer working after update

    I just got my iphone5s, the speakers both worked before I updated the phone now the left speaker does not work. How do I fix this?

  • Why would only the first line of my data set txt file work?

    Hi - I had a lot of success using variables and external data sets until today. I have an external text file that I have imported as a data set (Image/Variables/Data Sets/Import...).  All of the variables have been defined and confirmed (at least PSD

  • Compressing "masked' quicktime movie-mask has ragged edges and white areas

    I have been masking quicktime movies with quicktime pro. I get a good-looking masked quicktime movie. But when I try to export to mp4 or other file types, the mask looks terrbile, the edges are ragged and some previously masked areas are now white. H

  • ESB Error after installation.

    Hi, I just completed installation of SOA Suite 10.1.3.1 on a RHEL 4 Linux Box. I was checking the status of my OC4J services, when I noticed two things through the EM: One: There were two, one called home, another soadev, which is what I named it dur

  • Hide attributes in adobe interactive form.

    Hi All, Can anybody help how to how to hide/show attributes in adobe interactive forms? The scenario is like this: In data view there are 2 attributes a1,a2. Currently i am showing both the attributes in the form. But only that attribute will be show