Assigning value to an item

Is there a way to assign value to variable
of data type ITEM? In other words, I need to
assign value to an item, where I just know the
it_id.
In the following procedure p_item is unknown until runtime;
and if it_id is not null then assign some value to the item.
procedure update_item(p_item)
is
it_id item := find_item('block1.'||p_item);
if not id_null(it_id) then
   it_id := 'some_value';  --doesn't work.
end if;
end;

Do you mean you know the name of the item and you want to then assign a value?
If so then use the COPY command which allows you to assign a value to a named variable
e.g.
COPY (12345, 'blocka.number_item1');
To read the value in the same way use the NAME_IN function.
There is plenty in the forms helps about this.
Mark

Similar Messages

  • Before Header pl/sql process to assign values to page items

    How can i assign values to items on a page based on the data structure returned from a pl/sql procedure within the before header process? I am thinking of executing a pl/sql procedure based on a URL parameter value and then assign values to page items. Is this really possible using Apex 4.0.2? If yes, how can it be done?
    thanks
    Seetharaman

    The question isn't really clear. What kind of "data structure returned from a pl/sql procedure"? Please be much more specific.
    For a PL/SQL data structure such as record containing 2 elements (<tt>x</tt> and <tt>y</tt>) returned as an out parameter from a procedure to be assigned to 2 page items <tt>p1_x</tt> and <tt>p1_y</tt>, all that's required in the Before Header process is something like
    declare
      l_rec rec_type;
    begin
      the_proc(..., p_out => l_rec, ...);
      :p1_x := l_rec.x;
      :p1_y := l_rec.y;
    end;

  • Assign values for Application items

    Hi,
    I have some application items to which I want to assign values querying from a database table based on the user logged in. I have created an application process which does that. What process point I need to select so that the values in application items are available through out the session?
    Thanks,
    Asha

    Asha:
    I have been able to reproduce this issue. The application process appears to fire for every 'new' session-id. This explains the 'no data found' when you navigate to the application's login page. What is weirder is that APEX re-uses the session-id created when presenting the login page and therefore the application process no longer fires ! This needs more research. Clearly, my understanding of the the 'On New Session - After Authentication' is inadequate.
    In the meanwhile you can move the code you have for the application process and and use it as a 'Post-Authentication Process' for the application's authentication scheme.
    Varad

  • Error assigning value to page item

    I create a "SQL Query (Pl/Sql Function Body Returning
    Sql Query)" region, and also an item on the page called
    :P1_TEST.
    In the Region Source for the region, I have the following
    codes:
    declare l_sql varchar2(32676);
    BEGIN
    :P1_TEST := 0;
    l_sql := 'select emp_id from emp';
    return l_sql;
    END;
    When I click on "Apply Change" button, I got the
    following error:
    ERR-1002 Unable to find item ID for item "P1_TEST" in application "4000".
    Any reason why I got the error?

    Re: how to get the parsed  last query (report)

  • Assign value to page item on log-in

    For some reason I cannot seem to solve this simple issue. I have a SQL report on a page with several text boxes that are used for selection criteria.
    So, for instance -- I have a text box (P1_TEXT) and my SQL for the report is:
    select * FROM table
    where table.field LIKE :P1_TEXT
    I want to set the default value (hidden) of that text box to '%', so they see all records when they log-in.
    I have tried PL/SQL processes (On New Instance) with
    :P1_TEXT = '%';
    but that doesn't seem to work. I have also set the default value on the text box itself, but that doesn't seem to work as well.
    Please help.

    What if you changed your query to something like:
    select * FROM table
    where table.field LIKE :P1_TEXT || '%'Or you could use NVL(:P1_TEXT, '%'), though you're probably going to want to append '%' in any case, so the first example is probably best for all-around use.
    Good luck,
    Stew
    My Oracle Community blog:
    http://www.oraclecommunity.net/profiles/blog/list?user=stewstryker

  • Assigning values to 2 fields using sql statement

    db11g , apex 4.0 and firefox 24 ,
    hi all ,
    i am trying to follow this tutorial to assign values to 2 items on a page using sql statement ,
    and i am using the same sql statement the tutorial uses
    select d.loc location, count(e.empno) num_employees from dept d, emp e where d.deptno = e.deptno(+) and d.deptno = :P3_DEPTNO group by d.loc -- btw , what does the "+" sign mean?
    after the e.deptno in the where condition .
    but i am facing this error
    1 error has occurred
    Wrong number of columns selected in the SQL query. See Help of attribute for details.
    and it does not work with two columns in the select statement under any conditions , i tried to remove the group function and the group clause ,
    it does not work unless i use only one column in the select statement ??
    thanks

    Pars
    And how exactly is this rewrite of the sql statement resolving the OP's issue.
    You are still using more than 1 column which will still result in the error message:
    Wrong number of columns selected in the SQL query.
    As mentioned in my earlier post APEX 4.0 (the version the OP is using) does not handle a sql statement with multiple columns for the dynamic action Set Value.
    Which means the fastest  and simplest solution is splitting up the dynamic action in multiple Set Value actions.
    Using this plugin or upgrade to a newer apex version would also be a possibility.
    Nicolette

  • Javascript: set value of hidden item

    Hi,
    I have a select list and a hidden item on my page, after select a value, I want to write this value (and a little bit more) to the hidden item.
    So I have done the following...
    applied to page html header:
    <script language="JavaScript" type="text/javascript">
    function setExpress(item_id)
    html_GetElement('P230_HIDDEN').value = 'Test ' + html_GetElement(item_id).value;
    </script>
    and in selection list I set the HTML Form Element Attributes to onChange="setExpress(this.id); .
    But nothing is written to the hidden item. When I make it a text field it works correct.
    Isn't it possible to set a value of hidden item by javascript? Is there another way to do this (without computation)?
    Thanks for help
    chrissy

    Hello chrissy,
    I don't see the connection between the item being Hidden or Text. The item id stays the same, and so the JavaScript reference to it.
    It is possible to assign values to hidden items using JavaScript, just as you did. In the following page - http://htmldb.oracle.com/pls/otn/f?p=22814:8
    -you can see a working example of your situation – select list populate a hidden item, then display by using alert.
    After selecting from the list you should TAB out, so it will fire the JavaScript event. In your example, you were using onChange. I think that could be problematic in cases were the default value (first value) of the select list is the one chosen – no change there. In my example, I'm using onBlur.
    You can see the JavaScript on the source page.
    Hope this help,
    Arie.

  • How to get Characteristic Values assigned to the line item of Sales Order?

    Hi,
    I want to get the Characteristic Values( Variant Configuration )assigned to First Line Item of Sales Order.
    I was using the Fn. Mod.: VC_I_GET_CONFIGURATION_IBASE,
    this fn. mod. giving all the Characters but not the assigned characteristic values.
    Is there any other way to find characteristic values of sales order.
    Thanks,
    vinayak.
    Message was edited by: vinayaga sundaram

    For example, please see this example program.
    It lists the characteristic names, the values, and the description of the values which are tied to a sales document.
    report zrich_0001.
    * Internal Table for Characteristic Data
    data: begin of i_char occurs 0.
            include structure comw.
    data: end of i_char.
    data: xcabn type cabn.
    data: begin of xcawn,
          atwtb type cawnt-atwtb,
          end of xcawn.
    data: xvbap type vbap.
    parameters: p_vbeln type vbap-vbeln,
                p_posnr type vbap-posnr.
    start-of-selection.
      select single * from vbap into xvbap
                 where vbeln = p_vbeln
                   and posnr = p_posnr.
      clear i_char.  refresh i_char.
    * Retrieve Characteristics.
      call function 'CUD0_GET_VAL_FROM_INSTANCE'
           exporting
                instance           = xvbap-cuobj
           tables
                attributes         = i_char
           exceptions
                instance_not_found = 1.
      loop at i_char.
        clear xcabn.
        select single * from cabn into xcabn
                 where atinn = i_char-atinn.
        clear xcawn.
        select single cawnt~atwtb into xcawn
                   from cawn
                     inner join cawnt
                       on cawn~atinn = cawnt~atinn
                      and cawn~atzhl = cawnt~atzhl
                          where cawn~atinn = i_char-atinn
                            and cawn~atwrt = i_char-atwrt.
        write:/ xcabn-atnam, i_char-atwrt, xcawn-atwtb.
      endloop.
    Regards,
    RIch Heilman

  • Assigning a value to an item

    Hi,
    I'm using forms6i.
    I have an item in my form , say, Invoicebase, whose default value to be fetched from another table and to be shown in the form while loading.
    The query to fetch the default value involves a where condition, like where company = :Global.company
    But I'm assigining value to this global variable in when-new-form-instance.
    So where(which trigger) should i write the query to fetch the default value?
    I cannot assign value in when-new-record-instance trigger because , it wil change the form status, and if without entering any value i try to quit it wil ask for Close Form?
    I can only do that in when-create-record trigger, but at that time the global variable wil not be initialized and the query would not have worked!
    Please help me handle this
    Thanks
    Edited by: Divya on Jan 30, 2011 4:32 AM

    Stay with the WHEn-CREATE-RECORD-trigger and put the code to initialize teh global into the PRE-FORM-trigger.

  • Assigning Value To An Application Item via JS

    Hi guys,
    I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
    else if(action=="ASSIGN")
    var moname = $(el).children("td[headers='SOURCE']").text();
    $s('F10_SELECTED_OBJ',moname);
    alert($v('F10_SELECTED_OBJ'));
    Thanks

    Hi
    >
    I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
    >
    Scope of JavaScript is the HTML DOM in the browser. The Application Items do not exist in the HTML DOM, only in the session state.
    This explains what you observer. To set the App Items using JS you have to use an AJAX call to an OnDemand Application Process that sets the Application Item using PL/SQL. Or, call a procedure over http and set the App Item in that procedure after setting the Workspace / Security Group Id.
    Regards,

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • Very slow performance when assigning value to a form item

    Dear all,
    I have an add-on form that contains 30 text edits. I did not creat the from with screen painter but positioned them by marking each item's top and left position in the new sub.
    I have named them as 'edBox1', 'edBox2'......, 'edBox30'
    At a point I need to assign value to each edit text, I have queried the content from DB into one recordset. However, when I start to assign values to each edit text, the performance became very slow.
    my code is as follow
    me.form.items.item("edBox1").Specific.String = recordset.field.item(0).value.tostring
    me.form.items.item("edBox30").Specific.String = recordset.field.item(29).value.tostring
    I found that B1 seem to iterate each item on the form in order to find the item I specified.
    so I think I should specificy items earler.
    Now for each item I dim an object for it at new sub
    Dim oedBox1 As SAPbouiCOM.EditText
    Dim oedBox30 As SAPbouiCOM.EditText
    and while creating forms, I specificy each item to the matched object
    Then I assign values to items by
    oedBox1.String = recRetrive.Fields.Item(0).Value.ToString
    oedBox30.String = recRetrive.Fields.Item(29).Value.ToString
    However, B1 still iterates to find the item and the performance is still slow, does anyone has a better solution to this issue? please kindly advise.
    Thank you
    Alan
    Edited by: Chih-Peng Chen on Dec 17, 2007 8:42 AM

    Hi Chen,
    you can find one example under SDK samples which will guide on using datasources
    Bind the controls to dbdataource and then query the datasource.
    then update form using oForm.Update(),this will automatically fill the values in all edit boxes and it will be very fast as well
    Hope it helps you
    Regards
    Vishnu

  • KO23 Object currency assigned  value not equal Line item assigned value

    Dear all:
                    I have one problem.  Some Internal Order budget  use KO23  view about Object currency assigned value not equal Standard Reprt
    S_ALR_87013019 - List: Budget/Actual/Commitments  assign value.
    I don't knew what happen ?
    So I wish someone can give me a hand. Tel me how to fix this problem.
    thank you !

    Hi Jason,
    First of all:
    The displayed account code must be translated into the internally used code ("_SYS...") when using segmentation - when not using segemntation it is just internal code = displayed code.
    The code displayed is just a sample to give you a hint in case you are already familiar with the SAP Business One application.
    Therefore the sample code does not talk about where you got e.g. the value for FormatCode from ("FormatCode" is e.g. a field in table OACT where the account name with segments is (redundantly) stored without separators).
    The user should know on which account he/she wants to book a line on; maybe you might want to give some help to the user by displaying a dialog with suitable - or preselected accounts?
    In addition I am sure you know how to assign a string value to a string property - without explicitly writing it, right?
    HTH,
    Frank

  • Bring 2 datas at the same time and assign that value to my item

    Hi everybody, I have a trigger called WHEN-NEW-FORM-INSTANCE where I have the following select: Select to_char(sysdate,'yy') into :mat from dual.
    This select brings me the year from the system, but I would like to put together the year and the consecutive number of another table to have something like this: 09-0001 and add this value to the item called :mat.
    Is this possible?

    You can try what Brown has suggested.
    But in case you want a running number , then sequence might not help.
    What we used to do in this case is, we used to store a number in one seperate table (with other parameters like year, item code and so on), and select the max of this number +1 concatinated with year or whatever format you require.
    And at the end update that number with number+1.
    Say table series has columns
    year month series
    09 01 22
    Now when you select this number series+1 and update in you empid prefixed/suficed with some other field, then do remember to update this field. That means at the end of the transaction the record in this table would be
    09 01 23.
    This is a unique idea and can be utilized for generating ID based on year month series format.
    Just define them in the table and use them accordingly in your code.

  • Assigning value to a UDF

    Hi,
    I created 2 UDF's in PO header. When I assign values to the UDF's only one UDF gets the value.
    Below is my code:
    Dim UDF1 As SAPbouiCOM.EditText = frmUDF.Items.Item("U_UDF1 ").Specific
    Dim UDF2 As SAPbouiCOM.EditText = frmUDF.Items.Item("U_UDF2").Specific
    UDF1.Value = "100"
    UDF2.Value = "101"
    Is there something worng with my code?
    Regards,
    Xcube

    Hi,
    Instead use the code below to set the value
    SAPbouiCOM.DBDataSource oDBs_Head;
    oDBs_Head = oForm.DataSources.DBDataSources.Item("@TableName");
    oDBs_Head.SetValue("U_DF1", 0, "100" );
    oDBs_Head.SetValue("U_DF2", 0, "200" );
    regards:
    Sandy
    Edited by: Sandeep Saini | Roorkee | India on Feb 5, 2010 2:01 PM

Maybe you are looking for

  • IDoc extension for HRMD_A07 - Error message B1-070

    I am trying to create a custom extension to HRMD_A07 to capture some additional data added to infotype 0001.  I have gone through the WE31, WE30, WE82, SM30 transactions to create the extension but when I try to test with PFAL I am getting the messag

  • HT1229 how do i save all my photos in iPhoto to a USB?

    How do I save and transfer all my photos in iPhoto to a USB?

  • CVP 9.0 Web Service: URL won't load

    Hello, I am trying to create a script on Call Studio 9.0 containing a Web Service element. When I've loaded the URL after choosing URI, I get the following error: A part definition named Body in the WSDL has no type or element attribute, preventing i

  • Can anyone translate this to AS3 from AS2

    var my_btm = new flash.display.BitmapData(215, 110, true, 16777215); gradient_mc.start_offset = []; gradient_mc.finish_offset = []; var c = 0; while (c < 3)     gradient_mc.start_offset[c] = {x: 0, y: 0};     gradient_mc.finish_offset[c] = {x: Math.r

  • Change to how "Open all in tabs" operates?

    There used to be an option for "open all in tabs" to open the first tab in the group into the current (open) tab. Now the current tab stays open and the group I am opening opens in additional tabs. The first tab in the group in question is my home pa