Execute query by pressing Enter

hi all
i created 5 text items and side by side of these 5 text items i created more 5 text items i want when i enter numeric value in text item and next to this item it display string values like, i tried to use execute_query in Key_Enter trigger
9999---------------------after pressing enter key it display in next to item ------"Green Color"
1000---------------------Yellow ....
sarah

sarah,
There is no need to Call Sir, as every one is treated same, and helping each other. So its better to avoid calling Sir.
And you have to write the SELECT INTO statement in KEY-NEXT-ITEM trigger, not in KEY-ENTER. But the KEY-NEXT-ITEM trigger will not fire if you use mouse to navigate to another item. So its better to use WHEN-VALIDATE-ITEM trigger.
Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks.

Similar Messages

  • Create trigger to execute report upon pressing enter

    Hi,
    I have a screen where users input a vendor number and then have to click the execute button to view the report. I want to create some sort of trigger so when the user presses the enter button the program will execute instead of having to press the execute button or F8. Does anyone know how to create this event? Thanks for your help!
    Shane

    Hi,
    You need to check sy-ucomm at selection screen.If its  for "enter" then execute the program.Same as the execute button does.
    I am not sure if sy-ucomm gets captured there, It should be blank.Just try once.
    Edited by: sap_wiz on May 26, 2011 10:39 AM

  • I want to execute selection screen by pressing enter button

    Hi,
    I have a requirement like after giveing values in selection screen I want to execute it by pressing enter button not by pressing execute button.
    Please give some sample code if u have any solution.
    Thanks & Regards
    Venkatrami Reddy B

    Hi,
    You can achive this.
    You just need to do all your coding under even AT SELECTION-SCREEN OUTPUT.
    But you have to put a check also say counter.
    Define a variable of type integer and then put the check on the mail block of code (whole program eccept selection screen) as mentioned below.
    IF lv_count > 1.
    program lines..
    ENDIF.
    lv_count = lv_count + 1.
    Regards,
    Raj Gupta

  • Execute (F8) taking place upon pressing 'Enter' key

    Hi,
    I have developed two custom screens in separate programs. The second screen has been assigned a transaction code and is called from the first screen upon user command. Input in screen 1 is in the form of an IO field that takes two-character codes. The appropriate transaction is called depending on the value of the code input by the user.
    Before the second program is called (using call transaction statement), inputs are error checked using input checking modules. Pressing the enter key does not cause the second program to be called, which is as it should be. Only upon execution (F8) is the second program called. Once the second program has been called and exited (using leave program statement) it goes back to the first program (screen). This is alright. The issue is that now when the enter key is pressed, the transaction for the second program is called again. I don't want this to happen. This should happen only upon execute, not from pressing Enter. If I input a different value in the input field at this point then press enter it doesn't execute, which is ok. The issue I have described occurs only in the case of calling a transaction, exiting the second screen which is called (which takes you back to the first screen) and pressing Enter.
    My code:
    TABLES: ZSH_PROCS.
    Global data declarations.
    DATA: OK_CODE LIKE SY-UCOMM,
          PROC_INFO LIKE ZSH_PROCS,
          PROC_INPUT TYPE ZSH_DE_PN.
    Screen fields - Used in screen: '9500'.
    DATA: TBX_PROCESS    TYPE ZSH_DE_PN,
          LBL_PROC_STXT  TYPE ZSH_DE_PD.
    Modules
    MODULE INIT_9500 OUTPUT.
       SET PF-STATUS 'ZSH_GUIS_MAIN'.
       SET TITLEBAR  'ZSH_TITL_MAIN'.
    ENDMODULE.
    MODULE EXIT_9500 INPUT.
       OK_CODE = SY-UCOMM.
       CASE OK_CODE.
          WHEN 'BACK' OR 'EXIT' OR 'CANCEL' OR 'BTNEXIT'.
             LEAVE PROGRAM.
       ENDCASE.
    ENDMODULE.
    MODULE PROC_CHECK_9500 INPUT.
       PROC_INPUT = TBX_PROCESS.
       TRANSLATE PROC_INPUT TO UPPER CASE.
       SELECT SINGLE * FROM ZSH_PROCS INTO CORRESPONDING FIELDS OF
                                              PROC_INFO WHERE PRNAM EQ
                                              PROC_INPUT.
       IF SY-SUBRC NE 0.
          CLEAR: TBX_PROCESS,
                 LBL_PROC_STXT.
          MESSAGE E008(ZSH_MSGC).
       ELSE.
          LBL_PROC_STXT = PROC_INFO-PDESC.
       ENDIF.
    ENDMODULE.
    MODULE USER_COMMAND_9500 INPUT.
       OK_CODE = SY-UCOMM.
       CASE OK_CODE.
          WHEN 'EXECUTE'.
             CALL TRANSACTION PROC_INFO-TCODE.
       ENDCASE.
    Screen flow logic:
    PROCESS BEFORE OUTPUT.
       MODULE INIT_9500.
    PROCESS AFTER INPUT.
       MODULE EXIT_9500 AT EXIT-COMMAND.
       CHAIN.
          FIELD: TBX_PROCESS,
                 LBL_PROC_STXT.
          MODULE PROC_CHECK_9500.
       ENDCHAIN.
       MODULE USER_COMMAND_9500.
    Tha above code is for the first program (screen). Help is greatly appreciated. Thanks.
    Regards
    Edited by: Khan Awkhan on Jul 22, 2008 6:34 AM

    Hi,
    Clearing the ok_code should solve your problem.
    Try this:
    MODULE INIT_9500 OUTPUT.
    SET PF-STATUS 'ZSH_GUIS_MAIN'.
    SET TITLEBAR 'ZSH_TITL_MAIN'.
    " Clearing the ok code
    CLEAR OK_CODE. 
    ENDMODULE.
    Regards,
    Wajid Husssain P.

  • Pressing enter query function key more than once displays past search key

    At present, in Oracle Forms this is what's happening:
    1. User presses entery-query (F7)
    2. User searches for employee name smith. Plases %Smith% in the employee name field.
    3. User presses execute-query (F8)
    4. All employee names with "Smith" is displayed.
    5. User presses enter-query again (F7). Screen is cleared.
    6. User presses enter-query for the 2nd time (F7). %Smith% appears on the employee name field.
    The problem is the user do not want %Smith% to appear the second time they press enter-query. If you guys have any idea or have experienced this, please let me know.
    Thanks.

    You are experiencing the default query last criteria functionality. When you execute the ENTER_QUERY built-in while in enter query mode, it will show the last query criteria. To override this, you could create a KEY-ENTQRY trigger on your block and give it code similar to:
    IF :SYSTEM.MODE != 'ENTER-QUERY' THEN
      ENTER_QUERY;
    END IF;

  • Can I execute a code on pressing Enter key?

    Hi
    I want to execute a piece of code on pressing Enter key, while in a datablock in Query mode
    I tried KEY-ENTER trigger but nothing happens.
    Is that possible?
    Am I asking a nonsense thing?
    Thanks in advance
    Oscar

    no meaning to press enter in query mode. u can use buttons for directly running some other codes instead
    Thanks & Best Regards
    HuaMin
    Please remember to always mark the reply if it's helpful or related to your issue!

  • Trigg the 'Query' button when pressing 'Enter' on the keyboard

    I have a form with 2 buttons, 'query' and 'reset'.
    I would like that the 'query' button is triggerd (pressed) when the user presses 'Enter' on the keyboard. In regular html I think this is accomplished if the button is a 'submit' rather than a 'button' type, but I haven`t found a way to edit the
    type of button in Portal.
    Users belive it`s very annoying to have to move the mouse over the 'query' button to execute the query, and would rather like to just press 'Enter'.
    I`ve tried to use a javascript (onKeyPress), but if you make a javascript in Portal, you`re not allowed to add this to your button, only as an 'form-' or 'field validation' in a textbox.
    Is there anyone who knows a way to get this functionality?
    Regards,
    Orjan

    One of the AVG add-ons for Firefox has been reported to cause that to happen. Disable that add-on until AVG fixes it.

  • Enter and execute query in ADF

    Hi Experts,
    I am trying to implement Enter-Query/Execute-Query in adf and using Jdev 11.1.2.2.0. I put Find and execute operation on the form. When i press execute button i says me to enter value for mandatory fields. But i am try to execute query not trying to create or update records. In forms we can query on any attribute.
    Please guide
    Thanks

    Enter and execute query in Oracle Forms starts with a simple row by row form for updating a table. When you press the "Enter Query" button, the form clears and the user can enter query by example criteria for any of the fields on the form. Then the user presses the "Execute Query" button, and is back in the update form, but with the data for the first matching row shown.
    Here is a page with some links to articles by Steve Muench that explains some ways to implement this in ADF 10.1.3 - I think these techniques should still work in ADF 11g:
    http://radio-weblogs.com/0118231/2006/02/13.html#a658
    Another way with ADF 11g might be to put an af:query component in one facet of an af:switcher and the update form in the other facet. The Enter Query button on the update form tells the switcher to switch to the query facet, and executing the query also tells the switcher to switch back to the update form.

  • Clearing Form when changing from Insert Mode to Enter/Execute Query

    Morning folks,
    I need some help or pointers with a form I am working on. At startup, the form is in Insert mode. I am using Oracle Forms 9i.
    Goal: Clear the form with NO_VALIDATE when User enters an ID in Insert mode and clicks on the Execute Query button(DEFAULT&SMARTBAR Inbuilt Menu)
    The user can do two things when they first open the screen.
    Option 1: Enter the STUDENT_ID and press Tab
    Option 2: Enter the STUDENT_ID and press the Execute Query button (Part of the DEFAULT&SMARTBAR Inbuilt Menu)
    There is a When-Validate-Item trigger on STUDENT_ID to check if the Student ID already exists in the database. If it does, it gives an Error message saying "Student ID found. Please Query the record or enter a new Student ID". This is fine with Option 1.
    The problem arises with Option 2. When I Enter a Student ID in Insert Mode and (thinking I am in Enter Query mode) and press the Execute Query button, I get two messages:
    Message 1: "Student ID found. Please Query the record or enter a new Student ID"
    Message 2: Oracle message "Do you want to save the changes? Yes/No/Cancel.
    Is there a way to stop this *Message 2?*
    Here is what I have done to try and mitigate this situation. I have created a non database field and have called it clear_form.
    In When-Validate-Item I set the field clear_form = 1 when I encounter *Message 1*
    {code}
    if t_record_exists > 0 then
    set_alert_property('ALERT_ERROR',ALERT_MESSAGE_TEXT,'Student ID found. Please Query the record or enter a new Student ID');
    alert_button := show_alert('ALERT_ERROR');
    :clear_form := 1;
    end if;
    {code}
    By creating *Key-EXEQRY* Trigger at Form Level, I was hoping that it would just clear the form. I put some messages and its seems to me that *KEY-EXEQRY* is firing first and then the *WHEN-VALIDATE-ITEM*. Is there a way to have the *WHEN-VALIDATE-ITEM* trigger fire first?
    {code}
    if :clear_form is null then
    execute_query;
    else
    clear_form(no_validate);
    end if;
    {code}
    Thanks!
    Edited by: Roxyrollers on Sep 28, 2012 8:50 AM
    Edited by: Roxyrollers on Sep 28, 2012 9:45 AM

    Having the actual Student_ID column from the table is dangerous, since it is also the key to the student's data. What if the user properly executes a query, showing a student's data, and then wants to look up another student, so keys in the new ID. If he then presses Execute Query, the Form asks "Do you want to save your changes?"
    If the user presses Yes, the new ID becomes the previous student's key.
    It would be better if you put the student_ID field in a control block. Then, the user enters a Student_ID, and presses Execute Query, the query then populates the student's data in the Base Table block. In the B_T block, the actual Student_ID column should be hidden.

  • How to implement enter and execute query in ADF

    I am new to ADF and I am trying to create a simple data entry screen in ADF 11g based on a database table. I am looking to implement the equivalent of the Enter Query and Execute Query feature in Oracle Forms. I tried the default operations that are available with the data controls. But they don't seem to have this feature. Can someone help me / point me to how this can be implemented.
    Thanks,
    Srini.

    Thanks Shay. As per your suggestion I have included the Find and Execute buttons for the VO Object and ran the page. I first clicked the Find button and entered by query condition and then clicked the Execute button. At this point I get an error popup asking me to enter values for all the mandatory fields. Am I missing something?
    Regards,
    Srini.

  • How to implement enter-query , execute-query in Apex Forms

    Hi,
    I am new to Oracle Application Express. I want to know what is the equivalent of ENTER-QUERY and EXECUTE-QUERY features of Oracle Forms in Oracle APEX? I saw a lot of documentation, but everywhere I found that APEX forms only have 3 database actions, (1) INSERT (2) UPDATE & (3) DELETE.
    Does anybody know how we can do QUERY in APEX Forms? (like we do in Oracle Developer Forms).
    Thanks in advance.

    Oracle APEX is a web/ stateless environment. So you do not have the same functionality/ features as in a Oracle Forms environment which is session/state oriented.
    You can however achieve functionality similar to Enter Query / Execute Query through other means.
    The easiest is to use the Forms with Report wizard. It creates 2 pages, the first one is a report and the other a Form. Clicking on the Report rows takes you to the Form page in Edit mode where as the the Create button takes you to the Form in Insert mode.
    If you want to have the enter-query / execute query on a single page it will require significant effort and skills. Try it when you have acquired some more skills in Apex.
    In APEX , like any other web application, you have to think in the web paradigm and not client-server. Even Forms 11g is essentially client-server like and is session oriented through the forms applet.
    Regards,

  • How to execute code when press the ENTER key

    Hello,
    I've write the code in Key-ENTER trigger, but it doesn't work when I press ENTER key.
    Best Regards
    Joe

    Matth M
    Thank you.
    The following msg. from help system shows that key-enter trigger will execute when the ENTER pressing event occurs. Need your more help.
    Regards
    Joe
    >
    (index: "DO_KEY" )
    Executes the key trigger that corresponds to the specified built-in subprogram. If no such key trigger exists, then the specified subprogram executes. This behavior is analogous to pressing the corresponding function key.
    Built-in............Key Trigger............Associated Function Key
    ENTER............Key-ENTER............[Enter]

  • Can I execute a Button when pressing "Enter" in an InputField?

    Hi All,
    I have an InputField and next to the InputField, there is a Button.
    Ii would like to have my application executing the Button when the User presses the "Enter/ Return" Button on his keyboard.
    Is that possible? If yes, how??
    Thanks, Johannes

    Hi,
    You can try using OnEnter property of the Input field for your requirement. Assign a method to the onEnter property of the input field and now when the user fills data in the field and press enter the method assigned will be executed.
    Thanks,
    Abhishek

  • Enter / Execute Query

    I have a form where a patient ID is entered in the master block. This block is related to two other detail blocks in the same form.
    The user enter's a patiend ID. This ID is to be checked for validity against a ID table. Then the ID is checked against the master table to ensure a record for the patient has not already been entered. If the ID is valid and had not already been entered, the user continues in insert mode and fills in the rest of the details. If the ID record already exists, then the details of the record need to be loaded.
    I have got everything working except the last part. How do I automatically switch from insert mode to execute query mode with the ID entered if it already exists in the table ?

    I think it would be best to enter the ID in a control block. Master default where would be ID = :control.ID Then you can have a when-new-block-instance trigger on master:
    :system.message_level := '5'; -- hides 'query caused no records'
    execute_query;
    :system.message_level := '0';
    if :master.id is null then
    :master.id := :control.id;
    end if;

  • Fields disappear/hide after pressing execute query

    Hello,
    Something strange happens when i give execute query. When i give execute query , one field seems to be disappeard but when i click on the field it appears again. I am not sure if this has something to do with visual attributes/display properties...
    This happens only after migration to 10g. Can anyone help me on this please.

    Hi,
    I increased the size of the window and decreased the size of the field. When I pressed execute query then, the column appeared but when I clicked inside the report, different areas disappeared and appeared..
    Can you pls help me with this issue.
    Thanks

Maybe you are looking for