Populate data in text field

Hi all,
I am a bit confused here. In my page I have three text boxes, they are - P10_YEAR, P10_MONTH, P10_TOTAL. I am using LOV for year and months field. LOV is like for year 2000;2000, 2001;2001 and for month June;June,July;July and so on. Month field is set to textbox with submit.
So I want to retrieve the data in the P10_TOTAL when user select the month. Interestingly it always return 0 but it should be more than that. I have set the Source for P10_TOTAL as PL/SQL Expression *0=( SELECT count(*) from rtv_metro_count where record_month=:P10_month);* but it does not work. However it does work in toad and sql query. I have tried to change the expression to SQL query but did not work either.
Is there any other way, I can do this task, retrieve data from table in a specific text field? Please provide your suggestions.
Thanks in advanced.
Tajuddin

Create a page process - on Submit using the following code:
DECLARE
v_count NUMBER;
BEGIN
SELECT COUNT (*)
INTO v_count
FROM rtv_metro_count
WHERE record_month = :p10_month;
:p10_total := v_count;
END;
and remove the pages source by setting it to static assignement - only when current value in session state is null.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • Problem with Refreshing the data bound text fields

    Folks,
    First of all, this a GREAT product and I am moving my apps from Eclipse to Studio Creator. I am very impessed with it so far.
    I am gone through most tutorials, but can't help resolve the problem that I am having. I have a page, that lists all the users in a table. When you click on any user, it opens up another page that lists the detail of the specific user you have clicked on. This a typical use in most web applications, right?
    In the user detail page, I open it in "Read" only mode, by setting the "setReadOnly" to true for all text field components. Then users can edit it by clicking "Edit" button. Edit button just changes the "setReadOnly" to false, to allow editing. After editing, they can hit the "Save" button to save the changes. In the save button, I call this code:
    public void prerender() {
            try {
                userID=getSessionBean1().getUserID();
                getSessionBean1().getWeb_userRowSetUserDetail().setObject(1,userID);
                getWeb_userDataProviderUserDetail().refresh();
                info("prerender: Refresh called");
            } catch (Exception ex) {
                error("Error in userForm.prerender():"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.prerender():", ex);
            setReadWrite();
    public String btnSave_action() {
            try {
                getWeb_userDataProviderUserDetail().commitChanges();
                getWeb_userDataProviderUserDetail().refresh();
                info("Data Provider Refreshed in SAVE");
                _readOnly=true;
                form1.discardSubmittedValues("saveVForm");
                info("User Updated New:"+userID);
            } catch (Exception ex) {
                log("Error Description", ex);
            return null;
        public String btnEdit_action() {
            try {
                _readOnly=false;
                //info("User ID Edt="+getSessionBean1().getUserID());
            } catch (Exception ex) {
                error("Error in userForm.btnEdit_action:"+ex.getMessage()+ex.getStackTrace());
                log("Error in userForm.btnEdit_action():", ex);
            return null;
        private void setReadWrite(){
            // Set read-only to true or false for all text fiels
            this.btnEdit.setVisible(_readOnly);
            this.btnSave.setVisible(!_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_email_client.setReadOnly(_readOnly);
            this.user_email_office.setReadOnly(_readOnly);
            this.user_fname.setReadOnly(_readOnly);
            this.user_lname.setReadOnly(_readOnly);
            this.user_id.setReadOnly(_readOnly);
            this.user_password.setReadOnly(_readOnly);
            this.user_password_conf.setReadOnly(_readOnly);
            this.user_phone_cell.setReadOnly(_readOnly);
            this.user_phone_cell_aac.setReadOnly(_readOnly);
            this.user_phone_client.setReadOnly(_readOnly);
            this.user_phone_home.setReadOnly(_readOnly);
            this.user_phone_office.setReadOnly(_readOnly);
        }When the save button is clicked, the database is updated (as I can verify by looking directly into the database), but the data-bound text fields do not display the new value. YES, I am calling refresh() on data provider? I tried to call refresh in both "preRender()" and "Save" button action event, but that did not help either.
    Please note that the save button also changes the "setReadOnly" back to TRUE for all text fields. That means, users view the page in Read-Only mode after saving. (They have to click on "Edit" button again to edit it). I discovered that if I do not set the text field components in "ReadOnly" mode, then they display the updated value of the fields. But if I change setReadOnly to TRUE, then they display the old values (before the save).
    Any idea what I am doing wrong here?
    Thanks

    Here is my experience with it. I have three text
    boxes to be filled out. They are part of a virtual
    form with an add button as the submit. You can fill
    out the 3 and add them and a node is added to a tree
    component. When you click on a node in the tree
    component (the submit to another virtual form that
    the 3 buttons participate in) the text fields should
    be loaded with the values that they where added with.Hard to tell from this explanation, but if the text fields do not participate in a virtual form, then they are not going to get updated when an action in the virtual form happens. Not sure this is your problem. Like I say, hard to tell from this explanation.
    They will not display the values though...having
    nothing to do with read only. If I disable them
    before hand...they display the updated values. If I
    set their value at the top or bottom of prerender,
    they display the change...if I set the value in an if
    conditional that is hit (I have checked many times)
    in prerender, they will not display the values. If I
    set them in the tree handler anywhere, they will not
    display the values. This is very frustrating and is
    wasting tons of my time...I simply want to load the
    text fields based on the tree node that was
    clicked...I have messed with this for hours and it
    certainly does not work.Well, setting them in the tree handler won't work because the tree handler gets called in the page instance that handles the submit and not the page instance that renders the response.
    Posting your prerender code might help. Also, your action handler.
    >
    >
    - Mark

  • Insert Date Using Text Field

    Hi,
    i have date item ,Can i insert date from text field in dd/mm/yy format.
    My Column for date is DATE type in table.
    How can i ido this with Text field .
    Thanks

    I think you want to have text field for user to input the date? (instead of date picker item type)
    If you are using custom PL/SQL code, it is fine, because you just use to_date(:Px_DATE_ITEM, 'dd/mm/yyyy'); or whatever format you are expecting, in your insert statement.
    If it is a DML process type, I don't think it's possible - apex probably converts the text from the data picker into a date datatype at run time, but not sure it'd do it when its just a text box.
    Ta,
    Trent
    Edited by: trent on Jan 28, 2011 10:57 PM
    I take that back. So long as you have specified the application date format in the globalization attributes, and the format in the text box is the same/valid (otherwise it must be in the format as specified in NLS_DATE_FORMAT), it will insert no trouble in a DML process. http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/bldr.htm#CHDBHCBB

  • How do I auto populate the date into text fields when form is first opened?

    Hello,
    I read all about the changing the scripts but its not really working for me. I was hoping someone could help me with directions on how to auto populate the date into designated text fields when my adobe document is first opened?
    I am working in Adobe Acrobat 9.
    Thank you,
    Sheri

    When you add a new document JavaScript (Advanced > Document Processing > Document JavaScripts > Script Name (enter something) > Add), you will be given a function skeleton by default. Just delete it and enter the line of code I showed above. Now, whenever the document is opened, the code will get triggered and the field will be updated with the current date. There is no "Document Open" action (at least that's accessible via Acrobat's UI), but this is effectively the same thing since any document-level JavaScripts are executed when the document is opened.

  • XML Data in Text Field Issue

    LC ES 8.2.1.3
    I have a web service that outputs XML data and Designer calls the webservice and the XML data populates a text field.  This works fine.
    My problem is getting the data out of the text field to populate different fields in my form.  I have done many searches and have tried many different things but still can't get the data out.  I have made sure my form is dynamic xml.
    Here is the last thing I have tried:
    -------Begin Code -----------
    Placed in testData:Intialize and the connectionSet is placed in Page1:Initialize.
    var myXML = XMLData.parse(xmlData.rawValue, false);
    var subNames = XMLData.applyXPath(myXML, "//Subordinates/Subordinate/full_name");
    if (subNames == null) {
    //no data
    } else if (subNames.length == null) {
      //not array, just a single value
      topmostSubform.Page2.testData.addItem(subName.value);
      } else {
       for (var i = 0; i < subNames.length; i++) {
        topmostSubform.Page2.testData.addItem(subName.item(i).value);
    -------End Code -----------
    I have been working on this for 3 days and still can't get it to work.  The closest I have come is output in my testData text field that said "Object23485968".
    Thank you in advance for your help
    John

    I must be missing something somewhere becuause I couldn't get it to work.  Here is the xml that I am getting back when I invoke the CFC from within Workbench.  This data is assigned to an XML type varialbe called 'xmlOutput'.  I then create a data connection in my form to the service I created in Workbench and bind the return data to a text field (with multiple lines).  When I bind the data I have the option to choose "document" or "element".  Element doesn't return anything, unless I am doing something wrong, so I have to choose Document. 
    With the xmlOutput below I do get more than one subordinate returned.  I only showed one for simplicity.
    ------------Begin xmlOutput --------------  (Yes, I am getting all of these empty lines in my output)
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://livecycle" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <ns1:getSubordinatesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <getSubordinatesReturn xsi:type="xsd:string"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
    <subordinates>
        <subordinate>
            <cost_center_code>123456</cost_center_code>
            <cost_center_description>Business</cost_center_description>
            <department_code>99</department_code>
            <department_description>Information Technology</department_description>
            <department_head_emp_id>987654</department_head_emp_id>
            <employee_id>456789</employee_id>
            <first_name>John</first_name>
            <full_name>Public, John</full_name>
            <hourly_rate>5.350</hourly_rate>
            <job_code>PMBAPP</job_code>
            <job_title>Business</job_title>
            <last_name>Public</last_name>
            <lives_in_state>AK</lives_in_state>
            <location_code>ANCH</location_code>
            <location_description>Anchorage</location_description>
            <network_user_id>JPublic</network_user_id>
            <pay_group_code>KMH</pay_group_code>
            <rate_type_code>S</rate_type_code>
            <reports_to>789123</reports_to>
            <territory_code/>
            <tier>1</tier>
        </subordinate>
    </subordinates
    ------------End xmlOutput --------------  (Yes, I am getting all of these empty lines in my output)
    I am really at a loss on how to get this data into my form.
    Thanks,
    John

  • Import Text Data to text fields with folder level script

    I am using Adobe 9 professional and have a folder level javascript to import text into existing fields of a pdf.
    There are multiple fields with multiple rows of data to be imported.
    The folder level script is not working (but there are no errors in the console showing when run)
    I have manually tested opening the text file with the following code in the console and the text file opens and populates the text fields, so the text file must be correct:
    this.importTextData();
    The following code is the folder level script which is not working:
    function mailmergeFunction()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Jo Smith's Things/Mailmerge.txt", cnt++ % 4)
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    If anyone can please provide some assistance, it will be most appreciated thanks.

    Working fine now, changed the location of the file path - could have been something to do with having an apostrophe.
    function mailmergeFunction()
    app.beginPriv()
    // Import the first row of data from "Mailmerge.txt"
    this.importTextData("/h/mail merge/Mailmerge.txt", 0)
    if (typeof cnt == "undefined") cnt = 0;
    this.importTextData("/h/mail merge/Mailmerge.txt", cnt++ % 4)
    app.endPriv()
    app.trustedFunction(mailmergeFunction);
    app.addToolButton({cName: "Mail merge",cExec: "mailmergeFunction()",cTooltext: "Mail Merge",cEnable: true,nPos: 14});
    Thank you for your assistance George, much appreciate your help.

  • Adding current date to text field w/ Javascript in Acrobat 8

    I am trying to add the current date to a text field using javascript in Acrobat 8 Professional. I am using the util.printd function in a javascript function but the date of creation shows in the text field, NOT today's date. Any clues??
    var f = this.getField("myField");
    if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());

    Thanks. I've used it also without the empty value check and had the same result of showing the creation date and not the current date.

  • How to populate image and text field in SQL Server

    I want to populate a table, i.e insert images in a table in SQL Server. I am using Java(JSP/Servlet). Can any one suggest me how to populate the image and text fields in SQL Server...of course, using Java. If possible, could you please give me a piece of code?
    Regards -
    Samit

    Hi,
    Please check the following link for information on inserting images in to sql server database.
    http://www.databasejournal.com/features/mssql/article.php/1475641
    Cheers,
    vidyut

  • Populate values in text field of accounting document

    Hi All,
    My client wants the description of the material entered in sales order to be displayed in TEXT field of an accounting document.
    I couldn't find any config settings thru which we can populate the material description in TEXT field of an accounting document.
    Is there any settings/user exits thru which we can fulfill the above requirement.
    Thank in advance....
    Kumar

    Hi,
    Please try SAP enhancement SDVFX002  in SMOD transaction.
    Regards,

  • Date  in text field

    Hi,
    I have a text field :P1_DATE . I want to enter date into it and date can be in any format like 01102012 means 01/10/2012 .if i enter date like 01102012 this should be enter like a date in table as date column accept.when i edit to the record date should be display like 01102012.
    Thanks & Regards
    Vedant

    Dear Friend,
    i have created two region.1st region have some item .using these item i have created invoice header.after creaing invoice header i have added no of line w.r.t invoice header.
    in 1st region i have take text item to enter invoice date it's data type is date type.
    in 2nd region which has created using tabular form here is i ma using one column invoice date.
    i want to display 1st region invoice date into tabular form invoice date column.so i have use item (application or page item) and pass :p1_invoice_date.
    i have use :p1_invoice_date as a text field but data type is date type date format is 'DDMMYY' and i am try to display it into tabular form invoice date column. it's also date type but i have display it as a text field and os i have put :p1_invoice_date into Tabular Form Element item default type (application or page item) .
    But it display me error
    report error:
    ORA-01790: expression must have same datatype as corresponding expressionHow to display 1st region invoice date into tabular form invoice date column.
    How can i do this.
    Thanks
    Edited by: Vedant on Oct 25, 2012 3:16 AM

  • How to populate data for a field in data source

    Hi
      I have a field(VGBEL) in the data source 2LIS_11_VAITM, but i do not have data in it. I will have to populate data into it for that, I guess i need to write some  ABAP code .My question is where should i write the code.
    P.S If I have to write in the functional module or user exit how do i know the relavent functional module or user exit for the particular data source
    Thanks
    Sheetal

    HI sheetal,
    there will not be different user exit for each datsource. check this thread for the steps, which are general for any datsource.
    How to enhance datasources
    How to Data source enhancement i.e Transactional data
    you need to write your code in function module EXIT_SAPLRSAP_001 .
    hope it helps
    Regards
    Kiran
    *do assign points for helpfull answers.
    Message was edited by:
            ravi kiran naalla

  • Insert Current Date into text Field

    Hi I was wondering if anyone knows how to insert the current
    date into a text field using ASP.NET C# page. When the page loads.
    Or better still insert current date into my database when the
    page is updated. using the insert Server behavier.
    I would be very greatfull for any help.

    To assign it to a text box you couls use the following in the
    onload
    function
    textbox.Text = DateTime.Now.toString;
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "cantmakeitwork" <[email protected]> wrote
    in message
    news:e9qhrv$crd$[email protected]..
    > Hi I was wondering if anyone knows how to insert the
    current date into a
    > text
    > field using ASP.NET C# page. When the page loads.
    >
    > Or better still insert current date into my database
    when the page is
    > updated.
    > using the insert Server behavier.
    >
    > I would be very greatfull for any help.
    >

  • Need help displaying data in text field... Help?

    i have this code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import com.adobe.serialization.json.JSON;
    var loader:URLLoader = new URLLoader(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ScottMitchell"));
    loader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void {
        processData(e.target.data);
    function processData(data:String):void {
        var tweets:Array = JSON.decode(data) as Array;
        trace(tweets[0].text);
    It works, in the output it tells me the tweets.
    but i need it to be displyed on the app, i need to no how to do this, someone pointed me in the direction of using a item renderer extended from sprite?
    But really all i need to do is display it in a text field, all i want to do is display the data.
    Can anyone help???
    I know this is probably simple and i did try to figure this out on my own, but had no luck.
    All help is appreciated.
    Many thanks in advance.

    you can always use an array if there's no pattern to your positions:
    var positionA:Array=[ [100,20], [2,222], [55,2], [201,111], [78,23] ];
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import com.adobe.serialization.json.JSON;
    var loader:URLLoader = new URLLoader(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ScottMitchell"));
    loader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void {
        processData(e.target.data);
    function processData(data:String):void {
        var tweets:Array = JSON.decode(data) as Array;
    for(var i:int=0;i<5;i++){
    var tf:TextField=new TextField();
    addChild(tf);
    tf.multiline=true;
    tf.width=300;
    tf.text =   tweets[i].text;
    tf.autoSize="left";
    tf.x=positionA[i][0];
    tf.y=positionA[i][1];
    nextY+=tf.height;

  • ABAP code needed to populate data in the fields............

    Hi,
    I have added 3 new fields to the datasource 0PROJETC_ATTR
    fields names are : ZZPROFL , ZZPLFAZ and ZZPLSEZ
    Can some body tell me the ABAP code to fill data in these 3 fields.
    Thanks,
    Jeetu

    hi Jeetu,
    we need the logic,
    but the code will something like following sample ...
    Declaration for datasource 0MATERIAL_ATTR
    DATA : BEGIN OF S_BIW_MARA_S.
    INCLUDE STRUCTURE BIW_MARA_S.
    DATA : END OF S_BIW_MARA_S.
    *Here BIW_MARA_S corresponds to the structure of your datasource *0MATERIAL_ATTR
    *then you have to declare a when with the datasource on which you want to *populate the appended new fields.
    *for example :
    WHEN '0MATERIAL_ATTR'.
    *then do a loop across your strcuture
    LOOP AT C_T_DATA INTO S_BIW_MARA_S.
    *a select from the table
    SELECT SINGLE * FROM MARA
    WHERE MATNR = S_BIW_MARA_S-MATNR.
    *a check to see if your select is ok
    IF SY-SUBRC = 0.
    *if it is ok then your field in your structure is corresponding to a field in the table
    S_BIW_MARA_S-Z1 = MARA-Z1.
    S_BIW_MARA_S-Z2 = MARA-Z2.
    *the c_t_data will be updated from what you get in your structure.
    MODIFY C_T_DATA FROM S_BIW_MARA_S.
    ENDIF.
    ENDLOOP.
    hope this helps.

  • How to retrieve the data in texts field for ME23N

    hai all,
    i need to do some coding for the item texts field for PO, which can be saw under ME23N. i need to retrieve the details in the text. but i have no idea how am i going to get the data from that field, which table is it under for PO?
    please advice. thanks

    Hi,
    the texts will be stored in STXH table..u need to pass the four values TDOBJECT
    TDNAME
    TDID
    TDSPRAS...U will get the text details
    Or
    use the FM 'READ_TEXT'.
    cehck the below links
    http://www.sap-basis-abap.com/sapac002.htm
    FM READ_TEXT
    reward if helpful.
    Regards,
    Nagaraj

Maybe you are looking for

  • Portal on Unix cannot mount Windows File server

    Hi Experts, We had installed a NW 7.0 portal onto HP-UNIX server and integrated it with MS AD server. Now, we are facing an issue that we cannot mount windows files server when we tried to configured it with TREX. Had anyone tried this function or it

  • Amber updata

    i have  updata to amber lumia 820 but i cannot find call+sms filter 

  • AS2 after change of certificate no inbound communication

    Dear all, the AS2 certifcate nearly ended, so we installed a new one. We send the public certificate to our customer. He installed the certificate, but the inbound communication is not working yet. The outbound communication is working. The error mes

  • Vista and flex

    i've experienced several problems with flex since buying a new computer preinstalled with vista, solved one, and several remain unsolved and frustrating! i understand flex isn't officially supported under vista yet, but if anyone else has had similar

  • Database schema synchronization

    Hello, i am going to maintain any machines with maxdb and synchronization in production, but i am still changing applicacion schema because i am still in development so i will need to be able to change the database schema to the machines in productio