Looping through a table Help needed ....Forms 10g..... When Button Pressed

Hye craig, hamid, christian and all ...........
i have a user access interface which i create where there are two fields username and password and a button,
i have also created a table USERS for users which have username and password fields ..... On useraccess interface i coded on WHEN BUTTON PRESSED like this
declare
go_block('users');
execute_query;
declare
begin
     if :useraccess.username=:users.username and
          :useraccess.password=:users.password then
          go_block('MAINPAGE');
          else
          go_block('USERACCESS');
          MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
          MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
          end if;
end;
This code works for a single user in USERS table but for multiple users there has to be some looping system
which matches the USERACCESS and USERS tables fields thoroughly ....

Hi Majid,
I can suggest you a workaround for this. raise a ON-LOGON trigger and you can use the LOGON_SCREEN builtin to flash the logon screen at runtime. And then try capturing the username and password.
DECLARE
  connected BOOLEAN := FALSE;
  tries     NUMBER  := 3;
  un        VARCHAR2(30);
  pw        VARCHAR2(30);
  cs        VARCHAR2(30);
BEGIN
  SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
  WHILE connected = FALSE and tries > 0
  LOOP
    LOGON_SCREEN;
    un := GET_APPLICATION_PROPERTY( USERNAME );
    pw := GET_APPLICATION_PROPERTY( PASSWORD );
    cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );
    LOGON( un, pw || '@' || cs, FALSE );
    IF FORM_SUCCESS
    THEN
      connected := TRUE ;
    END IF;
    tries := tries - 1;
  END LOOP;
  IF NOT CONNECTED THEN
    MESSAGE('Too many tries!');
    RAISE FORM_TRIGGER_FAILURE ;
  END IF;
END ;   a sample piece of coding to help you out.
Regards,
Manoj Chakravarthy

Similar Messages

  • FORM 9i when-button-pressed trigger

    I am working on a form that has "Enter Query" and "Exe Query" buttons. In the when-button-pressed trigger associated with "Enter Query" button, I put:
    enter_query;
    In the when-button-pressed trigger associated with "Exe Query" button, I put:
    execute_query;
    (If I put "execute_query;" in when-mouse-clicked trigger it works, but I am kind of certain that there got to be a way to do it with when-button-pressed trigger.)
    The "Enter Query" button works as desired. However, the "Exe Query" button does not work. In fact, all the other buttons do not work unless, I press F8 to execute the query.
    I noticed the problem is the system.mode is changed to enter_query.
    Please give me some clues how to deal with it.
    Thank you.

    Thank you Frank and Dennis.
    I realized the problem is that when system.mode in enter_query. The navigation is restricted to the data block. I then moved all the relevant button into the data block. I have not yet tried what Dennis suggested: set mouse navigation to NO.
    Thank you.
    Jimmy

  • Loop through a table

    Is it feasible to write code that loops through a table in a form? I'm currently writing separate sections of code for each row of a five-row table to validate data entries.

    Hi,
    It would be easier if your table contained one row that repeated with an initial count of five (this is set in the binding tab of the Object palette).  This will change the XML generated but assuming that is not a problem your could loop though your table with the code;
        var rows = this.resolveNodes("Table1.Row1[*]");
        for (var i=0; i<rows.length; i++)
            var currentRow = rows.item(i);
    If you do need the rows uniquely named then you could pass i and the result of "this.resolveNodes("Table1.Row"+i)" into a function.
    This is you form back ... with only the first validation converted to the new approach.
    https://acrobat.com/#d=akb0*Ptvdr3KSYN0VP*7zA
    Hope this gets you started.
    Regards
    Bruce

  • BRF : Looping through a table (e.g. Do Until or While, etc..)

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

  • Calling a report from forms - FRM-40735 when-button-pressed raised unhandle

    Hi,
    I created a form to generate a pdf report.
    its not going too well, so i need some help.
    my form only has one button , when pressed I want it to generate a report in pdf format.
    i created a when-button-pressed trigger and the following code is below:
    I also create a web service proxy jar file,
    the jar file is in the FORMS_BUILDER_CLASSPATH, and the jar file is imported from forms builder without any issues.
    As of now I am hard coding everything in the code below to see if it works.
    The error I am getting  FRM-40735 when-button-pressed raised unhandled exception ORA-105100 i dont know why ?
    This error is occurring at this line of code, please help, this is my first time doing something like this.
    obj := publicreportserviceclient.new(); DECLARE
    param_name varchar2(200);
    un varchar2(200);
    pw varchar2(200);
    out_file varchar2(200);
    obj ORA_JAVA.JOBJECT;
    BEGIN
    obj := publicreportserviceclient.new();
    param_name := 'EMP';
    un := 'Administrator';
    pw := 'Oracle123';
    out_file := 'D:\DevSuiteHome_1\j2ee\home\default-web-app'||'output';
    publicreportserviceclient.callRunReport(obj,'/~administrator/Learn/Test1/Test1.xdo','EMP','141414',un,
    pw,'pdf','New_Template',out_file);
    web.show_document('http://jmenge-de.de.oracle.com:8889/j2ee/' || 'output');
    exception
      --check for ORA-105101
      when ORA_JAVA.EXCEPTION_THROWN then
         message('Java Exception : '
          || Exception_.toString(ORA_JAVA.LAST_EXCEPTION));
          ORA_JAVA.CLEAR_EXCEPTION;
          return;
      --check for ORA-105100
      when ORA_JAVA.JAVA_ERROR then
                   message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
              return;
    END;This is my java function
        public void callRunReport (String reportPath, String paramName, String  paramValue, String
        username, String password, String format, String template, String outFile) {
        try {
                bip_webservice.proxy.PublicReportServiceClient myPort = new bip_webservice.proxy.PublicReportServiceClient();
                // Calling runReport
                ReportRequest repRequest = new ReportRequest();
                repRequest.setReportAbsolutePath(reportPath);
                repRequest.setAttributeTemplate(template);
                repRequest.setAttributeFormat(format);
                repRequest.setAttributeLocale("en-US");
                repRequest.setSizeOfDataChunkDownload(-1);
               ParamNameValue[] paramNameValue = new ParamNameValue[1];
                paramNameValue[0] = new ParamNameValue();
                paramNameValue[0].setName(paramName);
                String[] values = new String[1];
                values[0] = paramValue;
                paramNameValue[0].setValues(values);
                repRequest.setParameterNameValues(paramNameValue);
                ReportResponse repResponse = new ReportResponse();
                repResponse = myPort.runReport(repRequest,username,password);
                byte[] baReport = repResponse.getReportBytes();
                FileOutputStream fio = new FileOutputStream(outFile);
                fio.write(baReport);
                fio.close();
            } catch (Exception ex) {
                        ex.printStackTrace();
        }Thanks - please help

    If there is a way to make it work with Bi publisher, Please let me know.
    I need to something to make it work with BI publisher.
    thanks,
    Edited by: Rooney on May 27, 2010 1:27 PM

  • How can print a report from form 6i,  when I press a button?

    hi Friends,
    How can print a report from form 6i, when I press a button?
    When i press a button from Form 6i, the report should print through printer.
    I have done it by using report parameter DESTYPE Printer but problem is that when I press a button printer dialogue box appear and then I give command Print to printer, I don’t want to show Printer dialogue box.
    I want when I press a button form Forms 6i , printer will print my report directly.
    Please send me the solution of this problem.
    Best regards,
    Shahzad

    Hi
    If You are using Client server application then to passing to Add all Print Parameter in the Host Command.
    Means Print command in unix to Host(lp.............) and Other Parameter to file name of the report to print.
    If You not Use Client Server Application the Also Passing a Host Command in Button-Pressed Event and Run.

  • Why cant I create a form? When I press the + tab it instantly creates a new sheet

    Why can't I create a form? When I press the + tab it instantly creates a new sheet

    you must have a table with a header row for it to know what to make a form from. Thats the key, with a header row.
    Jason

  • I need to loop through 1 table and read another until a value changes

    i need to read a table and sum the quantity field until a reason code changes.  how do I go about doing this?

    sort itab by reasoncode.
    Loop at itab.
    quantiy = quanity  + itab-quantity.
    at end of reasoncode.
    jtab-reasoncode = itab-reasoncodee.
    jtab-sum = quantity.
    append jtab.
    clear quantity.
    endat
    endloop.
    or
    sort itab  by reasoncode.
    loop at itab.
    at end of reasoncode.
    sum.
    jtab = itab.
    append jtab.
    endat.
    endloop.
    or
    let us say itab and jtab are two tables and you want to loop through itab and read jtab for reasoncodes.
    if jtab has only one entry for each entry in itab then use read else use loop.
    loop at itab.
    loop at jtab where reasoncode = itab-reasoncode.
    quantiy = quantiy + jtab-quanity.
    endloop.
    endloop.
    or
    loop at itab.
    read table jtab with key reasoncode = itab-reasoncode.
    if sy-subrc eq 0.
    endif
    endloop.

  • Looping through a table

    how do I loop through the following table and get it to insert records into another depending on the number that it finds in the value column. eg if there is 8 in the value column, 8 records should be inserted into another table with the same ID
    i forgot to paste an example table
    ID
    Name
    Value
    1
    john
    12
    2
    sarah
    20
    3
    Tom
    5
    I want it to look at the value column and if it is 12 it should add 12 rows with the same ID into another table. eg in the new table there will be 12 rows for John with an ID of 1. For Sarah there will be 20 rows with an ID of 2.
    sukai

    Sure!
    DECLARE @sourceTable TABLE (ID INT, Name VARCHAR(20), Value INT)
    INSERT INTO @sourceTable (ID, Name, Value) VALUES (1, 'john', 12),(2, 'sarah', 20),(3, 'Tom', 5)
    This mocks up your source table (where your data is coming from). We're simply creating a table variable, and populating it with your example data.
    DECLARE @numbers TABLE (value INT)
    WHILE (SELECT COUNT(*) FROM @numbers) < (SELECT MAX(Value) FROM @sourceTable)
    BEGIN
    INSERT INTO @numbers (value) VALUES ((SELECT COUNT(*) FROM @numbers)+1)
    END
    This creates an example numbers table. The while causes the code to loop until there are as many rows as the maximum value for the Value column in your example data. Each time the loop iterates it inserts a row, causing the COUNT(*) to be one more each time,
    we add one to that, and insert it into the numbers table.
    INSERT INTO destinationTable
    SELECT s.ID, s.Name, s.Value
    FROM @sourceTable s
    INNER JOIN @numbers n
    ON s.Value >= n.value
    ORDER BY s.ID
    This performs an insert select to a made up table. We join the rows from @sourceTable (your example data) to the @numbers table where the Value column from @sourceTable is less than or equal to the value column in the numbers table. If s.Value is 1
    we'll perform this join once. If it's 2, twice and so on. This works because of the way we set up the numbers table. If we had insert multiple 1's it would cause additional joins.
    A numbers table is a handy tool to have for things like this were you need iterations. Create a database (or schema) on your database and call it something like 'Toolbox'. In that database/schema you can put things like this that have little to do with your
    actual data, but come in handy. You can make your numbers table as long as you need. It totally wouldn't hurt at all to have a numbers table with hundreds of thousands of rows. They're just int's, they don't eat much :).
    Let me know if you'd like anything clarified more.

  • How to format table columns in Forms 10g

    Hi Friends,
    I have payment table in the format
    col1 col2
    1 dell
    2 HP
    3 Compaq
    4 Acer
    i want to show this info in forms 10g
    Payment has to be made tomorrow- DELL,HP,Compaq,ACER

    Hi Francois,
    I have create the from based on that data block only but it is coming sequentially, for example
    Label - Payment for items tomorrow-Dell
    HP
    Acer
    Compaq
    But i need the same thing in
    Payment for items tomorrow- Dell,HP,Acer,Compaq
    please advice how i can make this, contect of the column should come with comma

  • Error "Screen output are too small" when looping through internal table!

    Hello All:
         I have a huge internal table with some 79000 records and while looping through them and doing some other processing inside the loop, I am getting an error "Screen output are too small"! Could someone please help mw how to fix this issue? I can send the all the code if anyone wants to look at the code. Thanks in advance and rewards are assured.
    Mithun

    Hi,
    Check this
    new-page print off.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    destination = v_dest
    IMPORTING
    out_parameters = params
    valid = valid.
    * params-linct = '58'.
    * params-linsz = '170'.
    * params-paart = 'X_58_170'.
    * params-prtxt = v_spool_text.
    * params-primm = 'X'.
    * params-prrel = 'X'.
    NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
    After the call fm GET_PRINT_PARAMETERS params internal table contains all the values for generating spool.
    aRs

  • HELP! Forms 10g Windows Runtime Problem!!!

    After I installed Forms 10g windows, I modified the configuration according to my Forms 9i configuration.
    But when I open a form and run it, the runtime URL only refer to a temporary htm file which jumps to:
    http://localhost:8890/forms90/f90servlet
    I have to enter the query strings to run the form, like
    http://localhost:8890/forms90/f90servlet?form=C:\webutil\forms\CIMS10g.fmx&userid=OSSCHINA/OSSCHINA@orcl&buffer_records=NO&debug_messages=NO&array=YES&query_only=NO&quiet=NO&RENDER=YES
    So how can I make the proper configuration to auto-generate the correct query strings when running the form, just like what it is in Forms 9i?

    Suicheng,
    which configuration did you change and what do you mean by "when I open a form and run it".
    Do you mean the preferences settings in the Forms builder ? There is a button to reset the URL used by the Forms builder to bring it back to the deault setting
    Frank

  • Forms 10g - view button

    Hi all
    I'm doing some work on some standard eBS 12.1. forms, specifically GLXIQACC. There is some code that enables and disables the button.
    I've not worked with forms 10g before, and I can't even find where the button is created, never mind what updates it.
    Can anyone tell me how to find all the buttons created in a form?
    Thanks

    You will need to modify the following files: default.env and formsweb.cfg to enable the Forms Runtime Diagnostics (FRD).
    formsweb.cfg
    Create a new section at the bottom of the file.
    [my_frd] -- or title it what ever you want
    otherparams=record=collect log=my_frd.txt -- you can name the log file anything you want
    envFile=my_frd.env -- again, you can name this file whatever you want
    Next, create the my_frd.env file based on the original default.env and make the following changes:
    FORMS_TRACE_DIR=C:\DevSuiteHome10g\NETWORK\log
    -You can use a directory of your choice ...
    Once you have done this, you will need to restart the Forms Services in your application server. Then open a browser and type the URL to your application and add the following to the end of the URL: ?config=my_frd
    This will instruct the Forms Services to log all actions in your Forms Session. I prefer to use the separate config for this activity because I don't want it turned on all the time this this allows me to turn it on when ever I need it.
    There might be additional steps to enable FRD in the EBS, but this is how you do it in a non-EBS application.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Jun 9, 2011 9:02 AM

  • Forms 10g Alert button navigation/focus

    Hi,
    I have an alert that pops up on a certain condition that has 3 buttons to choose from. Navigating between buttons using the left and right arrow keys on works between the first 2 buttons only. Focus does not navigate to the 3rd button.
    This did not happen on Forms 6i. Is this normal behavior? Is this a bug in forms 10g? Is there a work around this? Any help will be appreciated.
    Thanks

    Hi,
    Im reactivating this thread because I just discovered this problem.
    You are rigth when you say that keyboard navigation works in lookAndFeel=Generic but not lookAndFeel=Oracle.
    But this not the only problem encountered.
    There is also the default button set in the alert that doesn't work and either in lookAndFeel=Generic and lookAndFeel=Oracle.!
    The focus is always on button one, and that is for me a big problem because it usualy the one we use for 'OK' and others for 'CANCEL'.
    I let you imagine what problems we can have if the user press return and send ok to the application .......
    Is there any patch that correct this behaviour (we are in 9.0.4 patchset 1 at the moment) ?
    Thanks
    Jean-Yves

  • Play a movie @ when button pressed through mediaplayer in oracle forms

    how can i play a sound when form start in oracle forms 6i .can any body provide me a link of sample form for playing media in oracle forms
    Message was edited by:
    Fiz Dosani

    hi Anuj Thnx for your reply As i already done that
    i am using Forms 6i and use paly_wav () available in d2kutill utility however i am also using it on Forms 10g through a PJC but i love to see how u manage that please send me sample form @ [email protected]
    Thnx in Advance
    Take Care

Maybe you are looking for

  • The Web Dynpro application was called up with the wrong URL parameters

    Hi all, I am using the systems below: ERP STACK :16 EHP : 4 EHP SP Stack :4 EA-HR * : 604(SP12) SAP-HR * :604(SP12) XSS JAVA components : SAP ESS 603 SP05 SAP MSS 600 SP16 PCUI_GP 603 SP05 Business Package : BP ERP05 ESS 1.41 SP04 BP ERP05 MSS 1.41 S

  • How do I delete podcasts I have listened to from latest version of iTunes?

    I am not able to keep up with the new versions of iTunes and IPod (now on iOS 6.0.1). It seems you have to completely re-learn things almost every month! I download podcasts from a lot of sources, but virually never direct from iTunes (I find the sea

  • System doesnt calculate avg as per the period

    i have one query, this is the most crucial issue going on at my firm Please advice Suppose there is an item.its purchased all round the year from jan to dec ORG in which its being purchased and transacted, issued, received is using avg costing method

  • Why can't I make a Youtube Account??

    I'm trying to make a Youtube account. But every time when i have to verify my Email account it keeps on saying " Microsoft account is unavailable from this site, so you can't sign in or sign up. The site may be experiencing a problem. You can sign in

  • 785GM-E65, 4 DIMM's

    Just read the stickies concerning memory.  A little background 1st. Got this mobo with a used system, came with PSD34G1333K, 2 x 2gb Patriot pc1333.  Worked fine.  Went to Fry's and got 2 x 2gb of TW3X4G1333C9A, Corsair pc1333.  Staff said it should