Save the DropDown Value

Hi All ,
           I am trying to use a Dropdown in my Wd Java project. I have used DD by key and have made simple type. The drop down is showing the values, but I cant save the value that is being selected by the user. Could you please help me, how to save the dropdown value so that it could be used for further processing.
Cheers
Umang

>
pradeep bondla wrote:
> Hi,
> Dont know why you are getting problem. its as simple as getting a current context element.
>
>
wdcontext.yourDDBKnode.getCurrentXXXelement();
>
> If I understood your query wrongly, let me know.
>
> PradeeP
Thanks pradeep for your quick reply.
I am getting null pointer exception in this case.
I would like to bring one thing in to picture that, the context to which the drop down is binded is in component controller and I am accessing it through a view. I believe, this should not be a matter of concern.
Regards
Umang

Similar Messages

  • Save the selected value from listbox with its respective tab control dropdown selcted values in another listbox

    Hi all,
    I am making a vi where I have to save the selected value from listbox with its respective tab control dropdown selcted values in another listbox.Whenever I select Item1 then the heading change and respective tab will open for that item.But Now I just want to save the selection and put it in another ListBox.SO that I can renmove or add according to my wish. Plz help me.
    Solved!
    Go to Solution.
    Attachments:
    my_vi.png ‏83 KB

    Hi, I successfully make the vi to insert itmes from listbox1 to listbox2.Whenever I select itmes 1 in listbox 1 it display same elected item in listbox2 , but it not appending the items in listbox2.Like If 1 is selected in listbox1 then 1 will display , next time after saving when I selct next item like 3 then in listbox 2, 1 is replaced by 3,it dont come in second row of listbox2.Hope I am able to explain.\
    Plz help me to resolve this.
    Attachments:
    listbox_update.vi ‏11 KB

  • How to restrict the dropdown values in Att/abs type in Record Working Time

    Hello experts,
    We are implementing ESS business package.  In the Record Working time, within the Weekly View and Daily View tabs, there is a column Att/abs.type which has several drop down values - like:  floating value, Funeral Leave, Military Reserve, Regular Attendance, etc.   Our requirement is to restrict the dropdown values  by means of showing only one of these values (say:  Regular Attendance) and others should not be shown.   How do we achieve this?
    Thanks
    Vicky R.

    Hi Siddarth,
    Thanks for the info.  By the way, this table info is not mentioned in the Business Package documentation.  Which documentation are you referring to?
    Thanks
    Vicky R.

  • Enabling and disabling input filed based on the Dropdown values selection

    HI,
    I have a requirement with Adobe Interactive forms being called from HCM Forms & Processes. We have a drop-down list and a inputbox.
    based on the values selected from the drop-downlist, the input box should be visible and hidden.
    If the input value is visible, I got to send  some part of the value selected from the drop down to the input field.
    i tried to write the following script in the click event of dropdown  but the input field is not appearing with any value selection.
    if data.Layout.CH1.CHContent.ISR_DDL_1stSelected.rawValue = "00000000" then
    data.Layout.CH1.CHContent.ISR_NEW_COST.presence = 'Visible' else
    data.Layout.CH1.CHContent.ISR_NEW_COST.presence = "Hidden"
    endif
    Thanks in Advance,
    VR.

    Hi Mukesh,
    THanks alot.
    Yes,  The Split functionality is working.  I have added the code in 'Change' event and  for selecting the value from the Drop down, am  writing the code in the 'exit'.
    In addition to this, I am populating the values to the drop down from the Generic service.  The problem is, while running  the  Process from Portal and check and send button,  the fields fetched from the generic service & the dropdown values are getting refreshed. i hope, this is because of the java script.
    pls. suggest me if this can be handled .
    Thanks &Regards,
    Venkatesh.

  • Is it possible to test the dropdown values?

    Here we are trying to test dropdown value using Adobe browser lab for firebug.
    We are testing Registration form which has many dropdown fields.
    But using Adobe browser lab for firebug not able to get the dropdown values.
    Thanks
    Jenny

    hi Mark,
    1.for dropdown fields kindly follow below steps :
        1. open url http://uat.univadis.com/ click on Unites Kingdom (last country)
        2. at the top right corner enter following credentials : username:[email protected] and password : test1234
         3. it will navigate to home page automatically after successfull login.
         4. click on Search Tab on the tab. on Search Page u will find field name "Show results in order of source".
         5 . select any drop down value and try to capture the same drop down value using adobe browser lab.
    I have tried above steps but selected drop down values are NOT shown in adobe browser lab. it is showing default drop down values. please let me know ur findings.
    2. And also i am not able to get a preview of screenshots after testing the screens. Plz let me know, how to get the preview of screenshots.(Where the screenshots will be saved?)
    Thanks,
    Jenny

  • Save the last value

    hello
    is there a way to register an that the last value of an numeric indicator in a  file LVM OR EXCEL
    OR
    THE inside a LabVIEW program is even better, for example in VI memory if there exists, or another trick I do not know.
    and thank you.
    Attachments:
    save the last value.vi ‏10 KB

    bilalus wrote:
    is there a way to register an that the last value of an numeric indicator in a  file LVM OR EXCEL
    There is no real "last value", because your VI will exceeed the range if I32 within milliseconds. When you stop the VI, the last value will be in the indicator. (what is the meaning of "register"?)
    bilalus wrote:
    THE inside a LabVIEW program is even better, for example in VI memory if there exists, or another trick I do not know.
    VI memory always exists and there are probably many tricks that you don't know. However, I have no idea what you actually want.
    Do you want to save the VI with a certain default value. Do you want to retain the current value between runs? Something else?
    Your feedback node alredy retains data between runs. If you always want to start with zero, you need to initialize it.
    LabVIEW Champion . Do more with less code and in less time .

  • Changing the dropdown values for one of the fields in CHECK STATUS query

    Hi,
    We are on SRM 7.1.
    In the CHECK STATUS transaction,in the selection screen(QUERY),there is a field called "ROLE" which has teh dropdown values of "APPROVE BY ME","REJECTED BY ME" and "GOODS/SERVICES DELIVERED TO ME".Is there any way some of these drowpdown values can be removed?
    Please advise.

    hi nmsrm1234
    i have a document for this issue.
    but i don´t find this document in internet. it is called : CUSTOMER-SPECIFIC UI ADJUSTMENTS IN SRM 7.0 WEBDYNRPO ENVIROMENT / META DATA HANDLING CONCEPT.
    if you can find it, you will get an idea to resolve this issue, if you will no have luck, please get me your mail, and i will send you the document.
    regards.

  • How to save the difference values in cube after planning functions.

    Hi,
    Now  i am facing small problem but it is tricky..
    in BPS reading the actual value and modifying the actual value in my plan layout and storing the plan values in my transactional cube.before saving the data i am checking the difference between actual and plan value and that difference value i am saving into my cube.here i am using two planing function one is distributing the actual value into my weeks(using fox code i done)after distributing now i am using second planning function to calculate the difference values.but in my layout alwyas i have to show distribute values only.not difference values but in cube i have to save difference values how can i manage this situation.
    Thanks...

    Hi,
    Now  i am facing small problem but it is tricky..
    in BPS reading the actual value and modifying the actual value in my plan layout and storing the plan values in my transactional cube.before saving the data i am checking the difference between actual and plan value and that difference value i am saving into my cube.here i am using two planing function one is distributing the actual value into my weeks(using fox code i done)after distributing now i am using second planning function to calculate the difference values.but in my layout alwyas i have to show distribute values only.not difference values but in cube i have to save difference values how can i manage this situation.
    Thanks...

  • How to keep the defaultValue in the netui:select tag at the beginning of the dropdown values?

    Hi,
    I am using <netui:select dataSource="{actionForm.xyz}" defaultValue="Any" optionsDataSource="{actionForm.someMap}"
    />
    Now I am getting the values from database to populate the dropdown using the optionsDataSource.
    As I am using the defaultValue, it is being added to the end of the dropdown and
    selected by default when I a mopening the page on browser.
    In my dropdown, the values are as follows:
    apple
    orange
    banana
    Any
    Now my requirement is, the defaultValue, Any, must be there at the top of the
    list instead at the bottom of thge dropdown values. i.e., In the above list, "Any"
    must be above apple option.
    How can I achieve this using netui:select tag?
    Thanks & Regards,
    Murthy

    Murthy,
    Unfortunately, though a very reasonable requirement, there is no option for
    placing the default item.
    - john
    "Murthy" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    I am using <netui:select dataSource="{actionForm.xyz}" defaultValue="Any"optionsDataSource="{actionForm.someMap}"
    />
    Now I am getting the values from database to populate the dropdown usingthe optionsDataSource.
    As I am using the defaultValue, it is being added to the end of thedropdown and
    selected by default when I a mopening the page on browser.
    In my dropdown, the values are as follows:
    apple
    orange
    banana
    Any
    Now my requirement is, the defaultValue, Any, must be there at the top ofthe
    list instead at the bottom of thge dropdown values. i.e., In the abovelist, "Any"
    must be above apple option.
    How can I achieve this using netui:select tag?
    Thanks & Regards,
    Murthy

  • I got error message in Firefox when passing the dropdown value to the next page

    Hello:
    I am using Ajax to populate a dropdown box. When I pass the
    value to the next page, I got an error message saying
    'form.thevalue' is undefined in Firefox. It works fine in IE.
    Please find part of the code below:
    form.cfm:
    <select name="appointment_date" id="appointment_date"
    onchange="showTime(document.apptform.select_employee.value,
    this.value, ' ' )">
    <option value=''>[Select]</option>
    <cfloop list="#datelist#" index="thedate">
    <cfif thedate eq '#chg_appointment_date#'>
    <cfset select='SELECTED'>
    <cfelse>
    <cfset select=''>
    </cfif>
    <cfoutput><option value="#thedate#"
    #select#>#thedate#</option></cfoutput>
    </cfloop>
    </select>
    <span id="TimeList"></span>
    GetTime.js:
    var oXmlHttp
    function showTime(staff, date, available)
    var url="/cf/misc/GetTime.cfm?nicknm=" + staff + "&dt=" +
    date + "&ti=" + available
    oXmlHttp=GetHttpObject(stateChanged)
    oXmlHttp.open("GET", url , true)
    oXmlHttp.send(null)
    function stateChanged()
    if (oXmlHttp.readyState==4 ||
    oXmlHttp.readyState=="complete")
    document.getElementById("TimeList").innerHTML=oXmlHttp.responseText
    function GetHttpObject(handler)
    try
    var oRequester = new XMLHttpRequest();
    oRequester.onload=handler
    oRequester.onerror=handler
    return oRequester
    catch (error)
    try
    var oRequester = new ActiveXObject("Microsoft.XMLHTTP");
    oRequester.onreadystatechange=handler
    return oRequester
    catch (error)
    return false;
    GetTime.cfm:
    <CFINCLUDE TEMPLATE="include.cfm">
    <cfset timelist = arrayToList(structSort(atime,
    "numeric"))>
    <span>
    <select name="available_time">
    <cfif #trim(URL.nicknm)# eq 'All'>
    <option value=''>[Select]</option>
    <cfloop list='#timelist#' index='time'>
    <cfif time EQ '#trim(url.ti)#'>
    <cfset select = 'SELECTED'>
    <cfelse>
    <cfset select = ''>
    </cfif>
    <cfoutput><option value="#atime[time]#"
    #select#>#time#</option></cfoutput>
    </cfloop>
    <cfelse>
    </cfif>
    </select>
    </span>
    When I pass #form.available_time# to the next page, in
    Firefox I got error saying 'form.available_time' is undefined. Any
    idea, please?
    Thanks in advance.

    This extension will restore Remote XUL to Firefox 4+ via a whitelist for each domain. <br />
    https://addons.mozilla.org/en-US/firefox/addon/remote-xul-manager/

  • How to populate the dropdown key values as shown in the below screen shot

    Hi
    i am trying to populate the drop down by key value for trader , for Trader we  have few values i need to populate the Those values in values columns . as shown in the below screen shot .

    Hi,
    Follow below steps
    Step 1 - Create basic wdp table
    Step 2 - Create context to store dropdown values Within your web dynpro application table
    Now you need to create a context node to store the dropdown values, but this needs to be within the context node of your table.
    For this example I will use fields CARRID and CARRNAME from structure SCARR to create the dropdown list within the table context.
    Choose the attributes to represent the id and the text values
    The finished context should now look like this
    Step 3 - Update context mapping within VIEW
    Within the Context tab of your view update the context node you have just modified (CARRIERS) right click and select 'Update Mapping'. Alternatively if this is a new context drag it from the right hand window and drop it onto the context node in the left window,
    Step 4 - Update table field
    Within the layout tab of the view, field the table field you want to replace with with a dropdown and remove the UI element associated with it
    Now insert new dropdownbyindex UI cell element
    Step 5 - Assign Dropdown Ui element to Context
    Click on your UI element within the Layout tab, you will now see all the properties for this element which can be changed. You now need to assign the field within the context which you want to be displayed in the drop down i.e. it will be the CARRNAME field within context element DROPDOWN_CARR. To do this simply click on the button at the end of the 'texts' property (the one with a yellow square and circle on it) and select the correct context field.
    Step 6 - ABAP code to populate dropdown list and set correct initial value
    Insert the following ABAP code into the appropriate place. For this example it will go within the WDDOMODIFYVIEW method of the view.
      Data: it_scarr type standard table of scarr, wa_scarr like line of it_scarr, context_node type ref to if_wd_context_node.  Data: it_ddcarr type STANDARD TABLE OF if_main=>element_DROPDOWN_CARR, wa_ddcarr like line of it_ddcarr, lr_element TYPE REF TO if_wd_context_element, ld_tabix type sy-tabix, ld_index type sy-index, it_carriers type STANDARD TABLE OF if_main=>element_CARRIERS, wa_carriers like line of it_ddcarr.  select * from scarr into table it_scarr. sort it_scarr by carrid.  * select * from scarr into table it_scarr. context_node = wd_context->get_child_node( name = 'CARRIERS' ).  * Get all rows of table and values stored in each cell currently displayed to user context_node->get_static_attributes_table( importing table = it_carriers ).  if sy-subrc eq 0. loop at it_carriers into wa_carriers. free lr_element. ld_tabix = ld_tabix + 1.  *     assign context_node to table context context_node = wd_context->get_child_node( name = 'CARRIERS').  *     assign lr_element to row of table lr_element = context_node->get_element( ld_tabix ).  *     assign data to dropdown of the row  context_node = lr_element->get_child_node( name = 'DROPDOWN_CARR'). context_node->BIND_TABLE( it_scarr ).  *     Set correct initial value read table it_scarr into wa_scarr with key carrid = wa_carriers-carrid. ld_index = sy-tabix. context_node->set_lead_selection_index( index = ld_index ).  endloop. endif.
    Step 6 - Save, Activate and Run
    Save and activate your abap web dynpro, now when you execute it you should see a drop down object similar to the following:

  • Dropdown value clears after saving the form?

    I have a pdf form with a couple dropdown lists. If someone selects a value and then saves and reopens the file, the dropdown value is empty.
    In other forms I also use dropdown and those do not have this issue. but I cannot find what is wrong with this one. Any suggestions?
    I have a custom keystroke script:
    if( event.willCommit )
       if(event.value == "")
    //if nothing is chosen in "Contract eigenaar" then Dropdown2 will be cleared
         this.getField("Dropdown2").clearItems();
       else
        test(event.value);
    And a script:
    //Values
    myDropdown1Values = ["Maak uw keuze", "Fast Flex B.V.", "QNH Sourcing B.V.", "QNH Consulting Midden B.V.","QNH Consulting Zuid B.V.","QNH Consulting Noord B.V."],
    myDropdown7Values = ["Maak uw keuze", "Eigen medewerker", "ZZP-er", "via Leverancier","PDV-er"],
    myDropdown8Values = ["","QNH Consulting Midden", "QNH Consulting Zuid", "QNH Consulting Noord", "Young Colfield"],
    //Populate
    this.getField("Contract eigenaar").setItems(myDropdown1Values);
    this.getField("Dropdown7").setItems(myDropdown7Values);
    this.getField("Dropdown16").setItems(myDropdown8Values);
    // Define what has to be shown in Dropdown2 when value is selected
    var DeptData = { "Maak uw keuze": [""],
                     "Fast Flex B.V.": ["","Fast Flex","Klant"],
                     "QNH Sourcing B.V.": ["","QNH Sourcing","Klant"],
                     "QNH Consulting Midden B.V.": ["","Detachering","Project"],
                     "QNH Consulting Zuid B.V.": ["","Detachering","Project"],
                     "QNH Consulting Noord B.V.": ["","Detachering","Project"]
    var DeptData2 = { "Maak uw keuze":{ Uitleg1: ""},
                     "QNH Consulting Midden B.V.":{ Uitleg1: "Het verkoopcontract wordt opgesteld tussen QNH Consulting Midden en de eindklant. QNH consulting Midden zorgt voor het contract met de eindklant en voor het contract tussen QNH Consulting Midden en Fast Flex . Het inkoopcontract wordt opgesteld door Fast Flex met de leverancier of ZZP-er. Fast Flex fungeert hier als broker. Er wordt ingekocht volgens de Algemene Inkoop Voorwaarden van Fast Flex. Indien er afwijkende afspraken opgenomen moeten worden in het contract kunnen deze hieronder in het formulier apart worden aangegeven."},
                     "QNH Consulting Zuid B.V.":{ Uitleg1: "Het verkoopcontract wordt opgesteld tussen QNH Consulting Zuid en de eindklant. QNH consulting Zuid zorgt voor het contract met de eindklant en voor het contract tussen QNH Consulting Zuid en Fast Flex . Het inkoopcontract wordt opgesteld door Fast Flex met de leverancier of ZZP-er. Fast Flex fungeert hier als broker. Er wordt ingekocht volgens de Algemene Inkoop Voorwaarden van Fast Flex. Indien er afwijkende afspraken opgenomen moeten worden in het contract kunnen deze hieronder in het formulier apart worden aangegeven."},
                     "QNH Consulting Noord B.V.":{ Uitleg1: "Het verkoopcontract wordt opgesteld tussen QNH Consulting Noord en de eindklant. QNH consulting Noord zorgt voor het contract met de eindklant en voor het contract tussen QNH Consulting Noord en Fast Flex . Het inkoopcontract wordt opgesteld door Fast Flex met de leverancier of ZZP-er. Fast Flex fungeert hier als broker. Er wordt ingekocht volgens de Algemene Inkoop Voorwaarden van Fast Flex. Indien er afwijkende afspraken opgenomen moeten worden in het contract kunnen deze hieronder in het formulier apart worden aangegeven."},
                     "QNH Sourcing B.V.":{ Uitleg1: "Het verkoopcontract wordt opgesteld tussen QNH Sourcing en de eindklant. Het inkoopcontract wordt opgesteld door QNH Sourcing met de leverancier of ZZP-er. Er wordt ingekocht volgens de Algemene Inkoop Voorwaarden van QNH Sourcing. Indien het een nieuwe klant betreft ontvangt QNH Sourcing graag een kopie van het klant contract zodat de inkoopvoorwaarden hierop aangepast kunnen worden. Tevens dient er een kredietcheck te worden uitgevoerd en klantgegevens te worden opgevraagd. Hiertoe ontvang je van ons een formulier klantgegevens."},
                     "Fast Flex B.V.":{ Uitleg1: "Het verkoopcontract wordt opgesteld tussen Fast Flex en de eindklant. Het inkoopcontract wordt opgesteld door Fast Flex met de leverancier of ZZP-er. Er wordt ingekocht volgens de Algemene Inkoop Voorwaarden van Fast Flex. Indien het een nieuwe klant betreft ontvangt Fast Flex graag een kopie van het klant contract zodat de inkoopvoorwaarden hierop aangepast kunnen worden. Tevens dient er een kredietcheck te worden uitgevoerd en klantgegevens te worden opgevraagd. Hiertoe ontvang je van ons een formulier klantgegevens."}};
    //Value Dropdown2
    function test(cDeptName)
      this.getField("Dropdown2").setItems(DeptData[cDeptName]);
      this.getField("Text1").value = DeptData2[cDeptName].Uitleg1;

    Hi
    actually my earlier post was incorrect
    i have edited my post
    Actually
    i want to update only those records that the user has modified
    eg
    col1 col2 status
    1 ABC good
    2 PQR good
    3 xyz good
    4 lmn excellent
    5 abcz excellent
    is the table before the user modifies
    the user goes and modifies multiple records as following
    col1 col2 status
    1 aaa good
    2 PQR good
    3 xxx good
    4 sss excellent
    5 abcz excellent
    and the user saves the form
    now i want the following output
    col1 col2 status
    1 aaa new
    2 PQR good
    3 xxx new
    4 sss new
    5 abcz excellent
    only the modified record's status should be updated
    sorry for the earlier lapse

  • How to catch the event for change dropdown value in alv

    it has a column output by dropdown in alv. the dropdown type cl_salv_wd_uie_dropdown_by_idx.
    now the problem is if change the dropdown value, i want to catch the event to change another column value.
    how can i do it?

    This part contains other ALV initialization code
    *... init ColumnSettings
      DATA:
            lr_column_settings TYPE REF TO if_salv_wd_column_settings.
      lr_column_settings ?= wd_this->r_table.
      DATA:
            lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
      DATA:
            ls_column     TYPE salv_wd_s_column_ref,
            lr_col_header TYPE REF TO cl_salv_wd_column_header,
            l_tooltip     TYPE string.
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'PLANETYPE'.
            DATA:
                  lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
            CREATE OBJECT lr_drdn_by_key
              EXPORTING
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_key->set_key_visible( abap_true ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
          WHEN OTHERS.
        ENDCASE.
    ENDLOOP.
      DATA:
            node_info TYPE REF TO if_wd_context_node_info,
            lt_valueset   TYPE STANDARD TABLE OF wdr_context_attr_value,
            l_value       TYPE wdr_context_attr_value.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'FLIGHT_INFO' ).
    data : lt_sflight type STANDARD TABLE OF sflight,
           ls_sflight like LINE OF lt_sflight.
    SELECT * from sflight into TABLE lt_sflight.
    LOOP at lt_sflight into ls_sflight.
      l_value-value = ls_sflight-planetype.
      l_value-text  = ls_sflight-planetype.
      INSERT l_value into TABLE lt_valueset.
      ENDLOOP.
      node_info->set_attribute_value_set(
      name = 'PLANETYPE'
      value_set = lt_valueset ).

  • Store dropdown value in a variable in WAD

    Hi,
    I would like to pass the values from dropdown box to variable in my IP application. These variables are used to restrict the char values in filters of my application. When I change the dropdown box, my variable value should automatically change. My dropdown box uses the Char/struc member (Characteristic_selection) as data binding because I am doing the cascading dropdown boxes for my selection. I can not use variable as data binding for my dropdown box and I know this will work if I use the variable selection as data binding for drop down box.
    Now, the dropdown value is never stored in the variable, I don't know what I'm doing wrong.
    So, I need to know:
    - Variable settings
    - Dropdown settings
    - Dataprovider sttings
    I am using WAD 7.0
    Thanks!

    Hi Sebastian,
    Ok if I understand right, you have 2 DropDown webitems - on selection of one you would want the 2nd to filter which is cascaded action on DropDowns; and on selection of each DropDown you would want to pass the selections to the main query variables. Check if the below settings work;
    DropDown 1 -> DP1 (perhaps on a master IO), Characteristic -> say C1, Affected Data Providers -> DP2 (DP of DropDown 2), Action -> Command via Command Wizard -> Execution Point of Time -> After Default Action, Command -> SET_SELECTION_STATE_BY_BINDING (under Data Provider Commands -> Commands for Filter Values), Data Provider Affected -> main query DP assigned to the Analysis webitem, Selection Binding -> Characteristic -> C1, Binding Type -> Variable, choose corr. query Variable
    DropDown 2 -> DP2 (perhaps on a master IO), Characteristic -> say C2, Affected Data Providers -> None, Action -> Command via Command Wizard -> Execution Point of Time -> After Default Action, Command -> SET_SELECTION_STATE_BY_BINDING (under Data Provider Commands -> Commands for Filter Values), Data Provider Affected -> main query DP assigned to the Analysis webitem, Selection Binding -> Characteristic -> C2, Binding Type -> Variable, choose corr. query Variable
    --Priya

  • How can I save the first dept. for an employee in a transport table?

    Hi All,
    I have created a table to store the transports to an employee from department to another department.
    the first department number to every employee is stored at the parent table called employees.
    when I insert a new record to the transports table (which is the child for the parent employees) for an employee and the manager agrees for this transport the original value of department number in employees table will be changed to the new one. I done this process through a db trigger on the transport table.
    Now the problem is that the original value of the first department number will be lost cause of the db trigger that changes this value after manager agreement!
    I looked to solve the problem by adding a new column in employees table to save the first dept. no. for each employee only if Count of records = 1 for that employee like this:
    -- Before Update DB Trigger on Transports Table:
    DECLARE
    pragma autonomous_transaction;
    N NUMBER;
    BEGIN
    SELECT count(EMP_SID) -- emp-sid is the FK referenced from employeess.emp_sid
    INTO N
    FROM TRANSPORT_TRANS
    where emp_sid=:NEW.EMP_SID
    GROUP BY EMP_SID;
         IF :NEW.AGREE_FLG = 1 AND N = 1 THEN -- If the manager agrees and this record is the first one for that employee
         UPDATE EMPLOYEESS E
         SET E.FST_AD=E.ADMINISTRATION_SID, -- E.ADMINISTRATION_SID has the oroginal value for admin no. and FST_AD is the new column to save the first value
                E.FST_HE=E.HEADQUARTERS_SID,
                E.ADMINISTRATION_SID = :OLD.ADMIN_SID, -- changing the value with then new one added on the table
                E.HEADQUARTERS_SID = :OLD.HEAD_SID
               WHERE E.EMP_SID = :OLD.EMP_SID;
         ELSIF :NEW.AGREE_FLG = 1 AND N != 1 THEN -- if the manager agrees but the record is not the first record for that employee
         UPDATE EMPLOYEESS E
            SET   E.ADMINISTRATION_SID = :OLD.ADMIN_SID, -- only change the original  values
                     E.HEADQUARTERS_SID = :OLD.HEAD_SID
                     WHERE E.EMP_SID = :OLD.EMP_SID;
         END IF;
    END;But the form gives me this error if I deleted (pragma autonomous_transaction;) st. :
    ORA-04091: table transports is mutating, trigger/function may not see it
    But when I keep it, the form gives me this error:
    ORA-06519: active autonomous transaction detected and rolled back
    Edited by: Dev. Musbah on Aug 18, 2009 2:09 AM

    Dev. Musbah,
    First make sure that the insert statement executes. And check whether other error messages are getting. Currently you are checking only NO_DATA_FOUND. so change the exception part with
    EXCEPTION
         WHEN NO_DATA_FOUND THEN NULL;
         WHEN OTHERS THEN MESSAGE('Some Error Occured');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

Maybe you are looking for

  • I am concerned about personal data being not encryption in transit over the Internet and therefore can be seen by other people.

    I am a new Firefox user. I have just installed Firefox 4 on my windows PC today, 5/27/11. I have two major questions: 1. Accidentally, I clicked some thing at random on the screen (I can't remember what it was) and this page, http://us.config.toolbar

  • "Wipe clean" hard drive

    I was about to "wipe clean" my G5 iMac for resale or give away with Installer Disc.  However, the only disc I can find reads, "iMac G5 Additional Software & Apple Hardware Test" .  Can I erase the drive with this disc?  If not, how?  HELP! ~Neophyte

  • Load Balancing on File Adapter..

    Hi Experts!! We have run into an issue with load balancing on the sender side which can potentially cause one node to go down.  We have 3 java server nodes on a single XI instance (ABAP & Java), when we pass about 30 to 50 messages of 10 MB size in a

  • Camera Raw 6.1 Weird bug

    Hello everyone. I recently updated to Ps CS5 and with it came camera raw 6.1. I use a Canon Rebel xsi.  So I use the .CR2 files My issue is that since I updated, most of the time that I try to process any CR2 and I play with the exposure, brightness

  • Installing phone=deleted apps?

    Is there a way to ensure apps of not being deleted after installing a "new" iPhone? Can they be saved through iCloud?