How to populate values in Apex item

Hi,
I am using apex collection item to capture data my requirement is to calculate data using the apex item
This requirement is like this. I am using a SQL query like this
select
wwv_flow_item.TEXT(1,NULL,20,10) "A",
wwv_flow_item.TEXT(2,NULL,20,10) "B",
wwv_flow_item.TEXT(4,NULL,20,10) "C"
from dual
There 3 text boxes are generated in the window when i enter 3 in A and 2 in B it must give me a sum value in C as 5
this has to be done dynamicall as end user key in values this can be done using java script or any other method please suggest
Thanks
Sudhir.

Hello Sudhir,
>> If there are multiple text box …
If there are multiple text boxes, you need to allocate each a unique ID. The easiest is to use the substitution string #ROWNUM#. The code should look similar to the following:
select empno,
apex_item.TEXT(1,null,20,10,'onchange="addItems(this);"','A'||'#ROWNUM#') "A",
apex_item.TEXT(2,null,20,10,'onchange="addItems(this);"','B'||'#ROWNUM#') "B",
apex_item.TEXT(3,null,20,10,'onchange="addItems(this);"','C'||'#ROWNUM#') "C"
from empBecause we are in a multi-row environment, we need to pass the line number we are on, into the JavaScript function, hence the use of ‘this’.
In the JavaScript function, we first need to determine the line number we are on, and then use it to perform the calculation. The code can look similar to the following:
<script type="text/javascript">
function addItems(pThis) {
  /* extract rownum */
  var line_no = pThis.id.substr(1);
  $x('C'+line_no).value = parseInt($v('A'+line_no)) + parseInt($v('B'+line_no));
</script>Regards,
Arie.
Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

Similar Messages

  • How to get Value of a item of first record when current record is second

    How to get Value of a item of first record when current record is second in Form6i ?
    get_item_instance_property dose not allow to get value.

    Gerd,
    You're right, there are several other triggers that must be coded, but I was responding to Steve's statement about Inserting or deleting records from the multi-record block. For the record, I use the following to manage a Record Group:
    * When-New-Block-Instance - Initialize the RG
    * block Post-Query - populate the RG
    * When-Create-Record - add new record to RG
    * When-Remove-Record - remove record from RG
    * block When-New-Item-Instance - capture previous value of the item or row
    * When-Validate-Item - Item specific Insert, Update, Delete of values in the RG
    There are a few other places as well, but these are the minimum. It might seem like a lot of code, but then again, I don't use this solution for every multi-line block. Like all tools, you use the right tool for the job. :-)
    Craig...

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to populate values in List Box in Adobe form

    Hi,
    How to populate values in List box in adobe forms?
    Thanks
    RB

    if you want to display a fixed values in the dropdown you can use list box ui and can specify values there
    or if u want to display values from the context node of the webdynpro
    1. Drag and drop a Value Help Drop-down List element from the Web Dynpro Library tab to the Body Pages pane.
    2. Drag and drop your node from the Data View tab onto it. This action binds the layout element to the corresponding node.
    with regards
    shanto aloor

  • How to populate values for a new field in target infoprovider

    Hi Experts,
    am new to BI. i would like to know on how to populate values for a new field in the target cube with start rotuine.In my case,  i have a source infoprovider, which has 3 fields and a target infoprovider, which has 5 fields. i need to populate the new 2 fields in start routine. i dont want to populate using Field routine and am using 3.5 version. please assist with code on how to solve this issue.
    Thank you,
    Chitra.
    Edited by: Chitra_BI on Jun 13, 2011 10:23 AM

    Debug the standard code and see where the other fields are getting update. you can use the similar approach and area to code for the new field.
    Regards,
    Lalit Mohan Gupta.

  • How to populate values into a Listbox on selection screen

    Hi All,
    Please any one let me know how to populate values (for ex.01,02 and 03) in a list box of selection screen..
    Thanks,
    Vijay

    Try this code ...
    REPORT  ZLISTBOX.
    TYPE-POOLS: VRM.
    TABLES SPFLI.
    TABLES SSCRFIELDS.
    DATA flag.
    DATA: NAME TYPE VRM_ID,
    LIST TYPE VRM_VALUES,
    VALUE LIKE LINE OF LIST.
    PARAMETERS PS_PARM LIKE SPFLI-CARRID AS LISTBOX VISIBLE LENGTH 5
    USER-COMMAND fcodex.
    data: i_spfli type spfli occurs 0 with header line.
    PARAMETERS PQ_PARAM LIKE SPFLI-connid AS LISTBOX VISIBLE LENGTH 15
    USER-COMMAND
    fcodey.
    *DS AS CHECKBOX USER-COMMAND FLAG.
    INITIALIZATION.
    NAME = 'PS_PARM'.
    DATA T TYPE I VALUE 0.
    SELECT DISTINCT carrid into corresponding fields of table i_spfli FROM
    SPFLI.
    loop at i_spfli.
    VALUE-KEY = i_spfli-CARRID.
    VALUE-TEXT = i_spfli-CARRID.
    APPEND VALUE TO LIST.
    endloop.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = NAME
    VALUES = LIST.
    AT SELECTION-SCREEN.
    if sy-ucomm eq 'FCODEX'.
    REFRESH LIST.
    CLEAR LIST.
    PQ_PARAM = ' '.
    NAME = 'PQ_PARAM'.
    SELECT * FROM SPFLI WHERE CARRID = PS_PARM.
    VALUE-KEY = SPFLI-connid.
    VALUE-TEXT = SPFLI-connid.
    APPEND VALUE TO LIST.
    ENDSELECT.
    endif.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SY-UCOMM NE 'FCODEX' OR SY-UCOMM NE 'FCODEY'.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = NAME
    VALUES = LIST.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    START-OF-SELECTION.
    clear i_spfli.
    refresh i_spfli.
    select * into table i_spfli from spfli where carrid = ps_parm and connid
    = pq_param.
    loop at i_spfli.
    WRITE: / 'CITY FROM:', I_SPFLI-CITYFROM, 'CITY TO :',I_SPFLI-CITYTO,
    'DEPARTURE TIME :', I_SPFLI-DEPTIME.
    ENDLOOP.

  • How to retain value in LoV item in Tabular Form, after Page Refresh

    Hi,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, 2nd item(column) in tabular form, that LoV should get populated based on user's selection value in first item LoV.
    1. So how do I refer to the value, that user selected in first item's LoV? I will have to use this value as reference in LoV query of my 2nd item ( on this tabular form)
    2. Everytime I select value in first item LoV, page gets refreshed, as my requirement is to calculate 2nd item's LoV based on selected value in first item. So after this page refresh, first item LoV loses its value that was selected before the page refresh happened. So how do i retain this value in first item LoV? I have an unconditional process, that on every submit(refresh) of page, I set all my items with their corresponding values. But problem is what do i mention there to refer to this first item ( of type LoV) of tabular form?
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Please help.
    Thanks and Regards,
    Ravi.

    Hi Rave,
    You will have to use Javascript and Ajax to change the values as ApEx submissions will lose your results unless they are saved into the database.
    Remember, that as you are using a tabular form there will be lots of items called f01, fo2, fo3 etc on the page (one per row).
    Regards
    Michael
    Edited by: MKii on Jun 4, 2009 10:13 AM

  • How to set value of application item using Java script.

    I have created a textbox on page 0, on chnage of textbox i want to set the value of application item.
    How to write the code to set & get value of application item.
    Thanks,
    -Amit

    Hello Amit
    This would be a great place to start...
    JavaScript
    Alternatively, APEX 4.0 will make this sort of task declarative.
    Kind regards
    Simon Gadd

  • How to create read only Apex items

    Hi,
    I'm creating a report using Apex items to display the result values inside editable text boxes. They are then referred by using APEX_APPLICATION.G_F02 etc.
    My requirement is to make the last row of this report (the values for "Total") as non editable or read only. Can anybody help me with the code that i would need to add in the query? The query goes something like this:
    apex_item.text(7, TO_CHAR(nvl(year_4,0),'999,999,999'), 12, 12, 'style="text-align:right;font-weight:bold"',ROWNUM) "YEAR_4", ..

    Surprising. I would have expected there to be a CSS style to disable a form item.
    Depending on your reasons for wanting to use APEX_ITEM, you could:
    Select your required value as part of the query (without using apex_item.)
    Visit your report attributes, then the attributes for your specific column.
    Change the column type to text field.
    Add readonly=true into the item attributes.
    Rgds
    Ben

  • How to Populate Values in Report for Fields

    Hi Experts,
    I have a Report requirement where in I need to Populate values for FROM Period & TO Period based on the user i/p for Quarter variable.
    For Eg;
    Fiscal year : 2009
    Quarter : 3
    Mat     Year         From period    ToPeriod          QTY
      A      2009            07                  09                1
      B      2009            07                  09                22
      C      2009            07                  09                44
    There are no fields FROM Period or TO Period in Cube.I need to populate them in the report directly.
    Please give some inputs to goahead.
    Thanks
    Ravve
    Edited by: ravve king on Jun 4, 2009 4:38 PM
    Edited by: ravve king on Jun 4, 2009 4:39 PM

    You're going to need to create a User Exit in your query. Here's a link to a helpful document on how to do that:
    [Using Customer Exit Variables in BW/BI Reports Part - 1|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90]

  • How to populate value node with values?

    Hi Experts,
    I have created a new view with a vlaue node of table type.
    How can I populate values into the value node?
    Which method will be useful?
    Is there any material for Web UI Programing?
    Please help me in this.
    Thanks,
    Adi.

    Hi Adi
    If ZVal is your value node then,
      DATA: lref_entity    TYPE REF TO cl_bsp_wd_value_node,
            lref_bo_coll   TYPE REF TO if_bol_bo_col,
            lref_data TYPE REF TO <<your ZStructure>>,
             ls_data type <<your ZStructure>>.
    ls_data-<<field1>> = 'XYZ'
    ls_data-<<field2>> = 'XYZ'
         CREATE OBJECT lref_bo_coll TYPE cl_crm_bol_bo_col.
          CREATE DATA lref_data.
          CREATE OBJECT lref_entity
            EXPORTING
              iv_data_ref = lref_data.
          lref_entity->set_properties( ls_data ).
          lref_bo_coll->add( lref_entity ).
          typed_context->ZVal->set_collection( lref_bo_coll ).
    Hope this was helpful.
    Best Regards,
    Lakshminarayana

  • How to keep values in text items.

    Hi,
    I have created a tabular form with report.out of this form Two items are converted to LOV'S(TEAM_LOV,TYPE_LOV) i.e TEAM_LOV for P4_TEAM item and TYPE_LOV for P4_TYPE item.
    TEAM_LOV := select team d, team_id r from teams;
    TYPE_LOV := select type d , type_id r from types where team_id=:P4_TEAM;
    1. For P4_TEAM item is select list with redirect .
    2. For P4_TYPE item is select list.
    Problem:=
    When i create a new record and enter new values in the text items above the P4_TEAM item and then selects the list of values from P4_TEAM then the values from the above text items gets clears . How to prevent the clearing the item values.
    If i use select list with submit. then i have validation on two items so i gives validation errors.
    Help !
    Thanks,
    Ramesh

    Hi Ramesh,
    I had the same problems and solved it with AJAX. then only the second list is updated and no submit or redirect is needed.
    Otherwise you could set a condition for your validation, i.e. only if item is not null.
    chrissy

  • Passing values to APEX items from external site

    All,
    Is it possible to pass values to APEX page items from an external web site?
    For example, I have an external web site where users type in a username and password into fields. When they click the 'log-in' button in the external site, I would like to have those values passed to the APEX log-in page. If possible, I would like to have the APEX log-in occur 'invisibly' and the user taken directly to the home page of the app. If that's not possible, it would be nice to simply have the 'user name' and 'password' fields filled in on the APEX side.
    I'm using APEX 3.0.
    Thanks in advance for any help!
    Alex

    Hello Alex,
    >> Is it possible to pass values to APEX page items from an external web site?
    The general answer is yes. You can use the f?p syntax to set the value of any APEX item - http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#sthref185 .
    In your specific example, the main question should be is it wise? The mere fact that you are using a login process suggests you have something to protect in your application. The f?p syntax uses a plain text for the items’ value, which means that the user name and password will be completely exposed.
    Regards,
    Arie.

  • How to populate values in to dropdown in table ui element

    Hi,
    according to my scenario  i have atable with five records ...andi have acolumn name DATE and  it contains 5 dropdowns with some values i.e dates from jan 1 2008-dec 31 2008.user needs to select only those values which are in dropdown. can u tell me the code to populate values in to dropdown in table UI element.
    Thanks
    Raju

    Hi,
    you can go for two drop downs like DropDown by Key or Drop Down by Index as per requirment.
    Create context Node for the table UI, in that one will be for ur drop down. Create element for the Context node and add thses to the conetxt.
    Code example for DropDownBy Key:-
    ISimpleType simpleType =               wdContext     .nodeProjEstiTable().getNodeInfo()
         .getAttribute("projphasname")               .getModifiableSimpleType();
    IModifiableSimpleValueSet svs1 =
    simpleType.getSVServices().getModifiableSimpleValueSet();
    svs1.clear();
    for (int j = 0; j < projphasname.length; j++) {
         svs1.put(projphasname[j][1], projphasname[j][1]);
    for DropDownBy Index you can work in normal way means try to create element for the respective context attribute.
    Hope this may help you...
    Deepak

  • How to  Populate Values from ECC  to SAP SRM

    Hi Freinds,
    we have  two custom fields in Purchase Requisation  ( ECC ), my requirement is to  same fields i want to create in SC Item Tab, i have included in tem Tab, but now i want to populate the values from ECC  to SRM, can any give me idea how to do this
    Thanks
    Kumar Srini

    Hi,
    You need to create two custom fields in the shopping cart corresponding to the two fields in purchase requisition.
    After that, you need to map the two fields in ECC to SAP SRM. In srm spro settings, you can find the mapping options.
    regards,
    Ranjan

Maybe you are looking for

  • HP cpu Wont connect to my monitor.

    Alrighty so for awhile now My Hp cpu wont connect to any monitor, I've used HDMI,VGA,DVI and the monitor only says "Monitor Going to Sleep" Ive tried to restart it by unplugging and holding down the power button, getting a new cable,I listen in for a

  • Problem connect to Portal with SLD

    Hi , i have problem connect the portal (7.0) whit SLD server The SLD server is configured in the Solution Manager. SLD: ctsi386nt02.ctsnx.com:sapgw00 the check connect SLD failure. show messages. [Thr 4724] *  ERROR       partner 'ctsi386nt02.ctsnx.c

  • Sleep to freeze (with OS X on 2nd HDD)

    After initial quality screening, I replaced useless ODD with Intel SSD(X25-M) and installed OS X on it. Everything is extremely fine except sleep function. Command sleep or close the display makes main display OFF and power LED ON but not blinking. A

  • Centering layer

    How to center a layer for browser window, horizontally and vertically?

  • Using pdfs in Frame12...need some spooky music

    1a. The original pdf is an outline drawing from google maps done in Generic CAD. As part of that process, the original pdf also had a title, a ruler to measure the map, and some notes at the bottom. 1b. This drawing was cropped using Adobe Acrobat XI