Populate the values  to  list item based on a check box

Hi,
How can i populate the values from a field on the form to one list item based on a check box,
the pseudo code is like,
if checkbox = checked then
populate the particular field value to the list item;
checkbox = unchecked;
next_record;
end if;
Thanks
Bcj

To populate a Tlist item, do the following:
1. Create a TLIST item in the EMP block. and give it a height to accommodate several names.
2. Using the TLIST property pallete:
a. Set the Column Name property to EMPNO
b. Click on the Elements in List property. Delete each List Element and delete each List Item Value. If you don't do this you will get an error when you compile.
3. Create a record group using this query:
select ename, to_char(empno) from emp
4. Create a WHEN-NEW-FORM-INSTANCE trigger, and place this code inside the trigger:
Declare
err_num number;
Begin
clear_list('YOUR_TLIST');
err_num := populate_group('YOUR_RECORD_GROUP');
If err_num = 0 Then
populate_list('YOUR_TLIST', 'YOUR_RECORD_GROUP');
Else
message('Error populating Tlist');
message('Error populating Tlist');
End If;
End;
5. Compile and run the form. The ENAMEs will appear in the TList, and each ENAME will have a value equal to its EMPNO.

Similar Messages

  • The values for list items of other data blocks are not getting displayed when executed.

    Hi,
        I have a new problem again.
        I am doing a new form in which there are around 8 blocks. All the blocks have their tables in the oracle database.
        Each block has 18 columns with the same column & column names. But the values in those columns are different & the values do not match.
        The problem lies while i execute the form, it populates only the first block data. Other blocks do not display or populate the values.
        I cannot create a master relationship because all the column values are different.
        How do i display or populate the values of all the tables?
       Please help me. Thank You.

    hi
    if your form has truly disassociated tables, then you could simply use a key-exeqry trigger at forms level to travel to each block in turn and perform an execute-query built-in, eventually returning to the starting block.
    ie
    go_block('..');
    execute_query;
    go_block('..');
    execute_query;
    etc
    go_item(......);
    In this case you would use the block where clause to constrain each table to the appropriate set.
    If however, the database has no relationships between the tables but the data content has some corelation, then you could craft a forms relation manually.
    cheers
    Rod

  • How to populate the value of SHUTTLE item from MULTISELECT item

    Hi,
    I am have following 2 items
    P1_TEXT1 - multiselect
    P1_TEXT2 - shuttle
    I have populated the value of P1_TEXT1(multiselect) and then want to assign the same value to P1_TEXT12 (shuttle)
    I am using following Javascript function to assign the value of P1_TEXT1 to P1_TEXT2 but it's not working??
    $x('P1_TEXT2').value = $x('P1_TEXT1').valuethanks,
    Deepak
    Edited by: Deepak_J on Dec 4, 2009 3:28 PM

    Hi Jari,
    I modified the earlier script as shown below. It's working perfectly fine as per my requirement.
    Pl let me know if these changes are fine OR is there is any modification we need.
    <script>
          var ob  = $x('P1_TEXT1');
          var ob2 = $x('P1_TEXT2_LEFT');
          var ob3 = $x('P1_TEXT2_RIGHT');
          // added this piece as per your suggestion..
          var g_myShuttle = null;
          if(!flowSelectArray){
            var flowSelectArray = [];
          flowSelectArray[flowSelectArray.length] = "P1_TEXT2_RIGHT";
          g_myShuttle = new dhtml_ShuttleObject 
          ("P132_HDWR_DEVCE_ID_LEFT","P1_TEXT2_RIGHT");
          // Remove all values
          g_myShuttle.remove_all();   
          // added this FOR LOOP, which will make every thing on the LEFT side unselected initially
          for (var j = 0; j < ob2.options.length; j++)
              ob2.options[j].selected = false;
          for (var i = 0; i < ob.options.length; i++)
                 for (var j = 0; j < ob2.options.length; j++)
                    if(ob2.options[j].value == ob.options.value)
    ob2.options[j].selected = true;
    var g_myShuttle = null;
    if(!flowSelectArray){
    var flowSelectArray = [];
    flowSelectArray[flowSelectArray.length] = "P1_TEXT2_RIGHT";
    g_myShuttle = new dhtml_ShuttleObject
    ("P1_TEXT2_LEFT","P1_TEXT2_RIGHT");
    g_myShuttle.move();
    </script>
    Thanks,
    Deepak                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Want 2 populate value in 2nd list item based on value selected in 1st list?

    Want 2 populate value in 2nd list item based on value selected in 1st list?

    Gaurav -
    The 3rd list will not populate because nothing has been selected yet in list 2. The value in list 2 is null, so the loop to populate list (3) has nothing to load. Try the following below. This should seed your 2nd list so the 3rd list will populate.
    You will have to declare first_record boolean and first_value to match DESCC.
    first_record := true; -- NEW *****
    Clear_List('BLOCK2.ITEM2');
    FOR CurRec IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.IDD = :BLOCK2.ITEM1)
    LOOP
    if first_record = true then -- NEW SECTION *****
    first_value := CurRec.DESCC;
    first_record := false;
    end if;
    Add_List_Element('BLOCK2.ITEM2',1,CurRec.DESCC,CurRec.DESCC);
    END LOOP;
    :block2.item2 := first_value; -- NEW *****
    Clear_List('BLOCK2.ITEM3');
    FOR CurRec2 IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.DESCC = :BLOCK2.ITEM2)
    LOOP
    Add_List_Element('BLOCK2.ITEM3',2,CurRec2.DESCC,CurRec2.DESCC);
    END LOOP;
    My name is Ken, 1990 is when I started using Oracle Forms 3.0, character based in the Unix environments. And you are very welcome.

  • Dynamically changing the list item based on another list item

    Hi all,
    I have two fields that are list items.
    First list item contain two list values: Regular and One-time
    In second list item if user select the Regular then below values should appear:
    Daily wages
    Activity Linked
    Fixed Contracts.
    Contract Staff
    Outsourced
    if user select the one-time then below values should appear:
    Projects
    Repairs & Maint.
    Please do the needful.

    First list item contain two list values: Regular and One-timeYou simply need to add a conditional check to the When-List-Changed (WLC) trigger to see which value was selected. Then, as Manu suggests, you will populate the Poplist based on the selected value.
    For an example of how to dynamically populate a Poplist item, take a look at: Forms: How to Dynamically Populate a Poplist.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Workflow to grant access to each List item based on a column value

    Hi,
    I have 2 lists Risks and RisksLookup.
    In Risks, I have Title, Description, service impacted and status columns.
    In RisksLookup, I have service impacted, AD1, AD2, AD3, AD4 and AD5.
    I have a requirement where in I have to write a Workflow to provide access to each List item based on the value of service impacted. i.e. If service impacted in Risks List is Client A, I have to lookup what all AD groups are present for Client A in RisksLookup
    List and provide access to only those groups for that item.
    Regards, Shreyas R S

    Hi
    another approach
    create 5 more lists, dedicated to each impacted service. for  Each one these lists apply needeed right ( based onAD groups )Keep you main list where first level will add new items . Attach a workflow to this main list, which will start when an item
    is added and which will add specific item's value to his new list ( based on impacted service value )
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • How to populate the values in the drop down list form the xml file ?

    I want to populate the drop down list values from a seperate xml file called ReferenceData. I created this file, which consists of a mapping entry in the form of ( key,value ) pair. Am mapping this xml file in to form by using rule named as getAppReferenceData.
    But the values are not getting populated in the form. And I have a doubt of, where should we keep that xml file? (under which path / folder ).

    what would help is if you showed what you do in the rule, either the code or a express trace of the rule.
    The other thing you need to know is where you want to get the file from. Yes java can read a file from anywhere on the system but there is a security layer in there which might prevent the file being opened. Have you allowed acces to the file via the security policy settings via java.io.FilePermission?
    WilfredS

  • Setting the value of a field based on a dropdown list

    I am using the latest production release of JHeadstart 10.1.3.0.91. I am trying to set the value of a field based on selecting the value of another field (drop down list). The drop down list field has the following attributes set autoSubmit="true" immediate="true" valueChangeListener="#{jhsPageLifecycle.updateModelValue}".
    The other field has the partialtrigger set to the first field. ie "depends on" selection from JHeadStart file. The value of the second field is set in the setter of the VO RowImpl java file.
    The value of that field is only populated on the screen if it is set to disabled="true". This seems a bit bizzare behaviour. Can you explain why it cannot set the value of the field when it is not disabled.

    Worked out that if i set the "Clear/Refresh value" attribute on the field that i want updated then it will work ok
    Alan

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

  • Display list items based on another list item

    Hi All
                I want to display the list item based on another list item, but its not working.
    This is my code:
    /*WHEN-NEW-FORM-INSTANCE*/---Its working.
    DECLARE
       rg_district   recordgroup;
       rg_name       VARCHAR2 (40) := 'district';
       vtemp         NUMBER;
    BEGIN
       rg_district := FIND_GROUP (rg_name);
       IF ID_NULL (rg_district)
       THEN
          rg_district :=
             CREATE_GROUP_FROM_QUERY (rg_name,
                                      'select dist,dist from district_mas'
          vtemp := POPULATE_GROUP (rg_district);
          POPULATE_LIST ('BLOCK3.DISTRICT', rg_name);
       END IF;
       END;
    */WHEN-LIST-CHANGED*/---Not working. Cannot populate the list based on the List
       DECLARE
       rg_branch   recordgroup;
       rg_name1     VARCHAR2 (1000) := 'branch';
       vtemp       NUMBER;
    BEGIN
       rg_branch := FIND_GROUP (rg_name1);
       IF NOT ID_NULL (rg_branch)
       THEN
          DELETE_GROUP (rg_name1);
          rg_branch :=
             CREATE_GROUP_FROM_QUERY
                ('rg_branch',
                    'SELECT branch FROM dist_branch WHERE district IN (SELECT DIST FROM DISTRICT_MAS WHERE DISTRICT ='
                 || :BLOCK3.DISTRICT
          vtemp := POPULATE_GROUP (rg_branch);
          POPULATE_LIST ('BLOCK3.BRANCH', rg_branch);
       END IF;
       END;
    Table:
    CREATE TABLE DISTRICT_MAS
      DIST  VARCHAR2(100 CHAR)
    CREATE TABLE DIST_BRANCH
      DISTRICT  VARCHAR2(100 CHAR),
      BRANCH    VARCHAR2(100 CHAR)
    Values:
    insert into district_mas values('chennai');
    insert into district_mas values('coimbatore');
    insert into dist_branch values('chennai','chennai_north');
    insert into dist_branch values('coimbatore','Podanur');
    Regards
    Shagar M

    Hmm, not tested.
    try this..
    --*/WHEN-LIST-CHANGED*/
       DECLARE
       rg_branch       recordgroup;
       rg_name1     VARCHAR2 (1000) := 'branch';
       vtemp        NUMBER;
       QT            VARCHAR2(10) :='''';
    BEGIN
       rg_branch := FIND_GROUP (rg_name1);
       IF NOT ID_NULL (rg_branch)
       THEN
          DELETE_GROUP (rg_name1);
          rg_branch :=
             CREATE_GROUP_FROM_QUERY
                ('rg_branch',
                    'SELECT branch FROM dist_branch WHERE district IN (SELECT DIST FROM DISTRICT_MAS WHERE DISTRICT ='
                 || QT||:BLOCK3.DISTRICT||QT||')'
          vtemp := POPULATE_GROUP (rg_branch);
          POPULATE_LIST ('BLOCK3.BRANCH', rg_branch);
       END IF;
    END;
    Hope this works..
    Hamid

  • How to hold the value in List box.

    Hi All,
    On my screen painter Screen I am displaying the Sold to party and ship to party with thier address.
    I am also displaying the Shipping condition based on ship to party. To display the shipping condition i am using list box. Once the user enter the sold to party automatically all the field is going to populate in their respective fields. I am facing the problem that, The list box getting populated with shipping condition but once you choose the shipping condition and hit the enter the list box getting refreshed. I am using this code in PAI event. And I can Only use this in PAI.
    The Function i am using for list box is CALL FUNCTION 'VRM_SET_VALUES'.
    Pls suggest me how to hold the value in List box.
    Thanks,
    Rakesh

    Hi,
    Now i am using in PBO.
    the code below in in PBO.It is still not holding the value.
          if list[] is initial.
          perform SHP_COND.
          endif.
    form SHP_COND .
    *DATA: SHOP(80).
        clear : GT_VSBED, list.
        refresh : GT_VSBED, list.
         select vsbed
           from knvv AS K
           into table GT_VSBED
          where Kvkorg = vbak-vkorg  "Kkunnr = GV_STPH
          and K~vtweg = vbak-vtweg
          and K~spart = vbak-spart.
        select VSBED vtext
          from TVSBT
        into table list
        for all entries in GT_VSBED
        where spras = sy-langu
        and vsbed = GT_VSBED-VSBED.
    *break-point.
    NAME = 'SHP_CON'.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id                    = NAME
        values                = LIST[]
    EXCEPTIONS
       ID_ILLEGAL_NAME       = 1
       OTHERS                = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.                    " SHP_COND
    Thanks,
    Rakesh

  • Problem passing value from List Item to List Item

    OK I will try to explain what I am trying to do. I have a Form that List Item at the top and they cascade from left to right. When I get to the BPOST_TAG I choose the Bpost then move to EPOST_TAG to choose the Epost. The EPOST_TAG should show all the Epost that go with Bpost you already chose, but it only showing 1 or 2. Below is the example of how should work!
    SYSTEM     COUNTY     ROUTE   BPOST_TAG      EBPOST_TAG
    1 77 80 025 030
    ------- The Return Values Should be as below-------------------------------------------------
    Sy Co Route Dir Bpost Epost Miles Descrption
    1 77 80 1 025 026 ? ?
    1 77 80 1 026 027 ? ?
    1 77 80 1 027 028 ? ?
    1 77 80 1 028 029 ? ?
    1 77 80 1 029 030 ? ?
    1 77 80 2 025 026 ? ?
    1 77 80 2 026 027 ? ?
    1 77 80 2 027 028 ? ?
    1 77 80 2 028 029 ? ?
    1 77 80 2 029 030 ? ?
    The top 5 List Items are based on the first Data Block (PMISCURR) and the bottom 8 columns are based on the second Data Block (PMISCURR1).
    I have PRE-QUERY on the first Data Block (PMISCURR), below is code for the PRE-QUERY.
    DECLARE
    Wh_clause VARCHAR2(200);
    BEGIN
    IF :PMISCURR.SYSTEM is not null then
         Wh_clause := 'SYSTEM = '||:PMISCURR.SYSTEM;
    END IF;
    IF :PMISCURR.COUNTY is not null then
         Wh_clause := WH_CLAUSE ||'AND COUNTY = '||:PMISCURR.COUNTY;
    END IF;
    IF :PMISCURR.ROUTE is not null then
         Wh_clause := WH_CLAUSE ||'AND ROUTE = '||:PMISCURR.ROUTE;
    END IF;
    IF :PMISCURR.BPOST_TAG is not null then
         Wh_clause := WH_CLAUSE ||'AND BPOST_TAG = '||:PMISCURR.BPOST_TAG;
    END IF;
    IF :PMISCURR.EPOST_TAG is not null then
         Wh_clause := WH_CLAUSE ||'AND EPOST_TAG = '||:PMISCURR.EPOST_TAG;
    END IF;
    END;
    OK It's just not my day I can't even get this line-up! :)
    Edited by: Monty on May 5, 2011 2:58 PM

    Hello,
    Simply get the current item value in a When-List-Changed trigger:
    current_value := :block.listitem ;Francois

  • How can I delete null values from List Item?

    Hi Friends,
    I used List item for field job_Type, I entered values in List item at design time through property pallet. When I run form I will see null values in this List Item.
    How can I remove these null values from the List?
    Best regards,
    Shahzad

    Dear Shahzad,
    It can be removed by adding the following code in the When-new-Form-Instance.
    Set_item_property('List name', required, property_true);
    :block_name.list_name := <put your default value here>; (If you didn't oput the default value, then you will get some problem and the cursor may not navigate away from the list).
    Senthil Alagu .P.

  • Forming a report query dynamically with the value of an item

    Hi Gurus,
    We wanted to create a report based on the value of an item in the page.
    For example
    There is a text box named p1_table depending on the value of this item the query of the report should change
    1) when p1_table = emp then report query should be select * from emp
    2) when p1_table = dept then report query should be select * from dept
    I tried doing this using
    select * from :p1_table and select * from v('p1_table') , it is not working.
    Kindly help me in achieving the requirement.
    Thanks & Regards,
    Vikas Krishna

    Hi Vikas,
    You have to do this as a report based on a function that returns the query as a string. You build up the string dynamically in the function.
    Regards
    Andre

  • Populate f4 values of a field based on value of other field

    Hi,
    I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
    How will i achceive this requirement.
    I got a link about the same but that is not using WDR_SELECT_OPTIONS
    http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
    I got another link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    which I am going to try
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AM

    Hi,
    Using OVS you can achieve this.,  In OVS Event Handler read the value based on which you  want to display F4 for other field and populate the values based on the first field.
    this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    hope this helps u.,
    Thanks & Regards,
    Kiran

Maybe you are looking for