Developer 10g Capture All CHANGED Item Values

Still learning this application one module at a time so be kind :)
What is the most efficient way to capture all the data block item values that have changed on the form at say the pre-update trigger?
I'm thinking of testing for:
RECORD_STATUS = 'CHANGED'
and if true then assign the first item to v_item using:
v_item := 'block_name' || '.' || get_block_property('block_name',first_item)
Then loop through each item in the block and test the DATABASE_VALUE against the form value and if they are not equal the assign the DB value to a variable and the form value to a variable and build a string of text to be displayed to the user by using:
IF GET_ITEM_PROPERTY(v_item,DATABASE_VALUE) <> :BLOCK_NAME.ITEM_NAME THEN
v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
v_frmvalue := :BLOCK_NAME.GET_ITEM_PROPERTY(v_item,ITEM_NAME);
v_string := v_string || 'Old value was ' || v_dbvalue || ' and new value is ' || v_form value;
Then advance to the next item by resetting the v_item variable to the next item using:
v_item := 'BLOCK_NAME' || '.' || GET_ITEM_PROPERTY(v_item,NEXTITEM);
And repeat the process until there are no more items in the block:
EXIT WHEN 'BLOCK_NAME' || '.' || NULL;
So what would be the most efficient way to do this?

The form holds information that is inserted by a technician then the manager of the technician has to approve the info and submit it to the director for final approval.
So what I do is capture any of the changes that the technician makes and put that sting into an email and send it to the manager so they know that changes were made to the record and they can approve or decline the changes before submitting it on to the director.
My successful POST-UPDATE trigger at the form level ended up like:
<<
p_html := 'Catalog item ' || :ITEMS.MANUFACTURER || ' - ' || :ITEMS.MODEL_DESC || ' ' || :ITEMS.MODEL || ' has been modified and the results are as follows: <br> ';
v_item := 'ITEMS' || '.' || get_block_property('ITEMS',first_item);
<<item_loop>>
loop
exit when v_item = 'ITEMS' || '.' || null;
v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
v_itemname := GET_ITEM_PROPERTY(v_item,ITEM_NAME);
v_block := 'ITEMS';
v_name := v_block || '.' || v_itemname;
v_frmvalue := NAME_IN(v_name);
IF v_dbvalue <> v_frmvalue THEN
p_html := p_html || 'OLD VALUE WAS: ' || v_dbvalue || '<br>AND NEW VALUE IS: ' || v_frmvalue || '<br>';
END IF;
v_item := 'ITEMS' || '.' || get_item_property(v_item,nextitem );
>>
The p_html variable is the string that I send to the email package to send out via our mail service.
Maybe this will help someone with a similar need.
Cheers,
Max

Similar Messages

  • ODI CDC using Logminer - how to capture all changes for one PK

    Hi,
    Let me explain our scenario and challenges we are facing -
    *1.     Captures all changes in CDC –*
    We are using CDC (LOGMINER) to capture change. Currently current ODI code capture latest change happened during last execution.
    Now requirement is to capture all changes happened after last execution cycle.
    To achieve this, can you please suggest what changes we need to do in current code.
    *2. Performance Improvement* - Current CDC can handle 400 TPS (Transactions per second, here transactions means single record) and we are looking for 2000 TPS
    we are expecting 15 million records for INIT load and 7-8 million records on daily basis for CDC
    What needs to be done to improve the performance. In case if you need more details to answer this, please let me know.
    Oracle database version at source and target - 11g
    ODI - 11g
    Thanks in advance.
    Regards,
    Dinesh.

    Hi Dinesh,
    I have some experience with ODI And Logminer / Streams.
    Can you confirm what JKM you are using?.
    For your 1st point - the logic to only get the latest update is contained within the JV$ / JV$D view , you can edit the definitions of these views if you want to bring through all transactions - there should be an SCN number in the change table you can order by if you are interested in the order the transactions occurred - I assume you are otherwise your target DB will get out of sync.
    As for performance - Have you tweaked the Streams settings ? How many Change sets do you have ?

  • Changing Item Values before saving Purchase Requisition in me51n, set_data function

    Hello,
            I have written a user exit, which is called whenever changes are made to a purchase requisition. User Exit is MEREQ001 , function module EXIT_SAPLMEREQ_010 . My requirement here is that the Requisitioner should be 135 for every PR item under certain conditions. Therefore whenever there is any change made to the PR, before saving the PR item, I need to set the Requisitioner to 135, give a status message saying that the Requisitioner is set to 135 and save the Pr with the changed values. Following is the code I have written in EXIT_SAPLMEREQ_010. However, the set_data function called below does not change the PR values. Pls help
    data: lt_item type mmpur_requisition_items,
           wa_item type mmpur_requisition_item,
           wa_itemdet type mereq_item,
           wa_itemref type ref to if_purchase_requisition_item,
           w_message type i.
    constants: c_135 type afnam value '135'.
    call method im_req_header->get_items
         receiving
                 re_items = lt_item.
        loop at lt_item into wa_item.
         wa_itemref = wa_item-item.
         wa_itemdet = wa_itemref->get_data( ).
         if wa_itemdet-afnam ne c_135.
           w_message = 1.
           wa_itemdet-afnam = c_135.
           call method wa_itemref->set_data( wa_itemdet ).
         endif.
       endloop.
      IF w_message = 1.
        MESSAGE 'Requisitioner defaulted to 135 for all items' TYPE 'I'.
      ENDIF.

    Hi Sachin,
               I am able to get a reference to if_purchase_requisition_item in my code (wa_itemref ) and am also able to access each of the line items in the PR in the work area wa_itemdet.
    At this point in the code ( wa_itemdet-afnam = c_135 ) , the work area value is set to '135', However, call method wa_itemref->set_data( wa_itemdet ), does not change the values of the work area wa_itemdet . Pls help

  • Change item value when a specific item has changed... how can i do that?

    Hi guys, i need to ask something...
    Is it possible to have a process or a computation, that gives value to an item, only when one specific item has changed.
    I have other items on my page too, but this two are related, and i need to give a specific value to the first one, only when the value of the second has changed...
    Help please
    tsveti:)

    Hey Farhan, i guess i need some help on that easy javascript...
    i havent done much thing with it so i have almost none experience with js....
    So in 'HTML Form Element Attributes' for the second item I m trying this :
    onchange="javascript:{document.getElementById('P1_SUBPROJECT').value = '-1';}"
    but when i change the value of this second item, the first one (P1_SUBPROJECT) dont get -1
    what am i doing wrong?

  • Change item value before commit

    Hello,
    I have a form in which I issue an execute_query from a mouse click to retrieve database values from a data block onto a form. The user is then able to change the values of these items on the form and commit them via a button on the form. What I want to do is make sure that some of the values, based on another item in the block, are negative and if not, change them to a negative value. before the changes are commited. I can't seem to find the right trigger to accomplish this-- has anyone have an idea on how to do this?
    Thanks in advance.
    Jeff

    Hi,
    How about putting your code in :
    1. Pre-Update or
    2. When-Database-Record
    [Block Level trigger]
    The trigger text could be something like :
    If (:block.col is > 0 ) Then
    :block.col := :block.col * -1;
    End If;
    -- Shailender Mehta --

  • Is there a way to read All UI Item Values through XML?

    We do a lot of validations before adding or updating AR documents in SAP 2007 (soon to be 8.8). Since these updates have not yet been sent to the database, we are reading the UI item values one by one off of the form, and this is slow to write and not much faster to run.
    Is there a way to get the entire form, a Sales Order for example, as an XML document with the item values? The best we can find is by going to the File menu and choosing Export Form to XML. It gives a relatively concise XML file that includes the values for each item on the form. The only problem is that it saves it as a physical file on the file system.
    So, is there any way to get the equivalent result of Export Form XML programmatically through the UI-API?
    Thank you,
    Mike

    Hi Michael,
    You can use the  GetAsXML method of the form object:
    e.g
    SAPbouiCOM.Form F = SBO_Application.Forms.ActiveForm;
    String XMLString = f.GetAsXML();
    System.Xml.XmlDocument XmlDoc = new XmlDocument();
    XmlDoc.LoadXml(XMLString);
    Regards, Lita

  • Change ITEM value:  VARAD

    Hi,
    My question is:
    When page is populated the project_id is equal to 8, when I change project_id to 5 and click Submit button it updates the record with project_id 8 and not 5.
    Is there a way to change this so that it gets the current value....
    Thank You for your help and suggestions
    Jesh
    Edited by: user11095252 on Jul 24, 2009 12:35 PM

    Varad,
    I tried using the javascript popup found in this script, but still no luck
    Re: open popup window and passing parameter to the popup
    When I look at the session on the popup page, the value is still not passed and
    when i change the value of project_id (in the main page, which is page 1) from 8 to 5 and I click on sessions at the bottom of the screen, it still shows 8
    Also have a similar case posted on this Thread: Add Insert & Update
    Add Insert & Update
    I might need some help with this
    Thank You for your time
    Jesh

  • Change item value by process in DML Form: best practice?

    Hi,
    i have a working DML Form and would like to build an option for choosing values in a popup window and refreshing the page items after closing the popup window.
    the DML Form has a button which opens the popup window with
    javascript:popUp2('f?p=&APP_ID.:210:&SESSION.', 600, 580)
    the popup window has a javascript function under HTML Header
    <script language="JavaScript">
    function passBack2()
    doSubmit();window.opener.doSubmit();window.close();
    </script>
    and a button which called the javascript function
    javascript:passBack2();
    while the user chooses a new value and closed the popup window an application item holds the selected value.
    the following page rendering of my DML Form use the application item in before header computations to get the new values.
    from the developer toolbar's session link i found the values changed by the computation correctly and signed with 'I' but they will not displayed in the page and will not used in the Automatic Row Processing update.
    how to accomplish this?
    Michael

    Michael,
    while the user chooses a new value and closed the popup window an application item holds the selected value.
    How does that happen, with an after-submit process on page 210?
    the following page rendering of my DML Form use the application item in before header computations to get the new values.
    All your popup page does is submit itself and then submit the calling page. There is no invocation of the before-header computation on the calling page in this sequence. You should use an after-submit computation.
    Scott

  • Change item value at Sales Invoice form before create a document

    HI,
    I am trying to change value for "TrackNo" item on the sales invoice form just before create a sales invoice,
    I have the following code:
    Dim oForm As SAPbouiCOM.Form
    Dim oItem As SAPbouiCOM.Item
    Dim oEdit As SAPbouiCOM.EditText
    Dim periodo As String
    Dim sf As String
    Try
       oForm = Nothing
       oForm = entorno.Forms.Item(FormUID)
       oItem = oForm.Items.Item("251")
       oEdit = oItem.Specific
       oEdit.String = "Y"
    Catch
    End Try
    It seems to work only If i have selected the logistics folder ( the folder where the "TrackNo" Item is located)
    If I have selected another folder as "contents" or "Accouting" when I create the document it fails.
    Can you help me with this problem?
    Many Thanks

    Buenas Sergio,
    Try forcing a click event on the logistic folder. I don´t think there is another option. You are only able to asign the value if the control is visible(and editable).
    Regards,
    Ibai Peñ

  • How to change item value after re-loading the page.

    Hi all,
    I have two pages 1,2. From page 1 I am calling page2 (like LOV) by using callMyPopup and in page2 i am setting some variables and returns/refreshes to page1 refreshes using window.opener.window.location=new_url java script, at same time it pass few parameters to page1. How can I write some pl/sql code to show some message to user on page1. I mean I am returning some numbers so i want change into meaning full text. I tried processes no luck. Please help me.
    Thanks

    Hey James.
    Please share with everyone,
    Which version of Oracle Apex are you using?
    What is the Database version.
    and what is the Browser version and type?

  • ALV  issue - capturing user changes in editable fields using custom button?

    Hi,
    I created a custom button in ALV tool bar.   And also in my ALV grid I have couple of fields Editable option. User can change values for these 2 fields.
    My question is -
    After changing values for these editable fields(more than 1 record)  , user will click on custom button and then I have to update all the user changed values in to my internal table(lt_tab)  and then I have to process logic.
    Problem is when user click on Custom button in ALV tool bar it is not having the changed values in lt_tab table.
    Only when user clicks  some thing on ALV grid records or fields then it is getting all the changed values in to lt_tab.
    Can any one tell me how I can get changed values when user clicks on custom button?
    1. Can we place custom button in ALV Grid? instead of ALV tool bar? 
    or
    How I can capture user changes when they click on custom button?
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    TABLES
          T_OUTTAB                          = lt_tab
    Please check this logic-
    CASE r_ucomm.
        WHEN '&IC1'.
    - It_tab  having all changed field values
      WHEN 'custom button'.
          lt_tab  - not having any changed values - showing all initial lt_tab values.
    I highly appreciate your answers on this.
    Thanks.
    Rajesh.

    Hi,
    Use this code, its working:-
    *&      Form  ALV_DISPLAY
    *       SUB-ROUTINE ALV_DISPLAY IS USED TO SET THE PARAMETERS
    *       FOR THE FUNCTION MODULE REUSE_ALV_GRID_DISPLAY
    *       AND PASS THE INTERNAL TABLE EXISTING THE RECORDS TO BE
    *       DISPLAYED IN THE GRID FORMAT
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sort        " sort info
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
         i_save                            = 'A'
         is_variant                        = wa_variant     " variant name
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     I_HTML_HEIGHT_TOP                 = 0
    *     I_HTML_HEIGHT_END                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 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.                    " ALV_DISPLAY
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is EXECUTE then process the selected records
        WHEN 'EXECUTE'. "user-defined button
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    * refresh the ALV Grid output from internal table
          l_selfield-refresh = c_check.
      ENDCASE.
    ENDFORM.
    This will reflect all the changes in the internal table. Now you can include your logic as per your requirement.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • How to deploy developer 10G application

    Asalam-o-Alekum & Hello
    Dear Gurus
    I am trying to Migrate From the Forms6i to Developer 10g and initially I am migrating my forms to the Developer 10g.
    currently all user connect through LAN or VPN to my Oracle Database 10g (Windows Server 2003).
    No I want to move 10g
    Now can anyone help me that what will be the steps required for client level to access my system, I mean application server.
    Salman

    It is always best to start with the documentation. Take a look at the following:
    Application Server 10g Release 3 and scroll to the bottom.
    Oracle Forms Documenations and scroll down to the Oracle Application Server Forms Services 10g) - Deployment Guide
    There is more to setting up the App Server than just installing the software and starting the server processes. You need to configure the AS for your specific application.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Line Item Value change in MIRO Transaction

    I have one  requirement i.e as follows.
    <b>Line Item Value change in MIRO Transaction</b>
    After getting the items in table control of  the miro screen of a particular order.
    I have to clicked on edit own condition of selected item.
    then it will show another screen ( create invoice document item - conditions)which have the all condtions details like
    Fra1 , frb1 , sd%  ,  Penalty % , gross price , frieght charges etc.
    In this screen first time it is showing line item as
    in the miro intial screen i.e. if u click po item
    10 it will show 10 only.
    after  updating fra1  value , i came back to the main screen at that time it is asking that select the any one of three.
    after selecting manual selection its fra1 was changed.
    once again if i go to the same line item by clicking
    the edit own condition(13 column if u select all information in textbox whixh is above tablecontrol right corner) it is showing line item as 1 in screen ( create invoice document item - conditions) which  should be line item as 10. ( here i took line item as 10)
    Please clarify this, why it is showing
    first time as  a original line item and
    after updating it is showing like
    for line item 10 -
    1
                   20 -
    2
                  100 -
    10
                  110 -
    11.

    "...it does not work..." is probably the worst description of a problem you can imagine. As an application developer you should know that. Do you use firebug to see what happens once it "does not work"? Any better hints?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • All default routing value has to be changed, while changed the work center in production order

    Dear friends,
    our client they want to change the work center in production order.according to production version work center also they are changed.so while change the WC,all the default value has be changed as per routing what we maintained in routing.At present we have to enter the manually change the W.C as well as set up time and operation time enter manually.Any other option to do the automatically capture value from routing while change in Work center in production order.pl help me on this.
    Thanks&Regards
    Sabhapathy R

    Hi Rahul,
    Thanks for reply. I am maintained in diff value  maintained routing , Ex :First routing i have  work center 'X' value maintained as a setup time in 15 Min's and operation time 10 Min's
    second work center 'Y' I have maintained as set up time 10 Min's and operation time 30 Min's,
    Now I want to change the work center in production order as a 'Y' so whatever value maintained in routing , it has to be changed automatically (10 min's and 30 Min's), but system will not change only old value only picked (15Min's AND 10 Min's).
    Now I think you get to know what the client requirement, kindly do the need full.
    Regards,
    Sabhapathy R

  • Is it possible to know if an item value has changed

    Hi,
    I'm working on a form and need to know if an item value has changed without compare it with database_value of get_item_property. there is a button <save> on the form and i want to know when user click again and again on button save if this item value has changed. thanks for your ideas.

    Tabit7 - Posted: Apr 9, 2011 12:15 AMbut sometimes in query mode, the item is not navigable and its vallue changed and the prev_value did not work, perhaps the w-n-i-i do not fire>
    If you look up the trigger in the Forms Help system it will tell you if the trigger will fire in Query Mode. The WNII trigger will file in Query Mode where as the Pre-Text-Item trigger does not.
    i try an other way and it seems to work, i put a flag in w-v-i when database_value is different from block value and use this flag in button Save, thanks a lot for your idea it put me in the way. Glad you were able to find a way to resolve your issue. ;-)
    HamidHelal - Posted: Apr 10, 2011 9:27 AM can you please give an example of u'r idea ? >
    First, create a variable that is visible to the entire form. Many people would simply use a GLOBAL variable, but I do not like the limitations of GLOBALs and I don't like the fact that they are visible to the entire Forms sessions, not just my form. I prefer to use a Forms program unit (PU) Package Specification so I can explicitly define the variable data type (eliminates the need to cast the GLOBAL to the correct data type) and the variable only occupies the amount of memory needed to support the variable. Also, when I exit my form, the variable is automatically erased.
    /* Sample Forms PU Package Specification */
    PACKAGE Form_vars IS
       g_prev_val   VARCHAR2(50);
    END Form_vars;No that I've created a variable to store the Previous Value of an Item, I can write code to use it. I will use a Form Level When-New-Item-Instance (WNII) trigger to ensure I capture the value exiting value of the item before any changes.
    /* Sample WNII trigger */
    BEGIN
       Form_vars.g_prev_val := Name_in(:system.trigger_item);
    END;This is a very simple example. There are many other ways to implement this method; such as using the Pre-Text and Post-Text-Item triggers as Abdetu suggested.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • How do I import movie files from my external hard drive into I-Tunes?

    Hello I have a whole load of movies and tv shows stored on an external hard drive. I would like to import a few of them into I-Tunes and then on to my Ipad because I'm going travelling tonight. I'm dragging the file into I-Tunes but it won't copy. Th

  • HD version of episodes mandatory !?

    Hello all, I have a problem/question because I just "purchased" free TV episodes on iTunes store and, as they are available in HD, iTunes is repeatingly trying to downlload the HD version of the episodes (which are huge of course) and I do NOT want t

  • Code works in DW8 but not DW CS3

    Why would the following code work in Dreamweaver 8 but not in Dreamweaver CS3? Expires in <select name="mnuExpires" id="mnuExpires"> <option value="0" >0</option> <option value="30" <% if true then response.write("selected") %> >30</option> <option v

  • Are there any alternatives for iphone backup extractor?

    Hi all, I find that the 'iphone backup extractor' program is very useful, however it is quite annoying that they limit the extraction to 4 files at a time and that we have to pay in order to get our own data files propperly. :S When I restore my old

  • Flash Player image size small

    Playing a Flash presentation in Firefox, I noticed that Control+"+" did not enlarge the images. Making the window larger only increased the white space around the images. How does a viewer make the pictures and text of a presentation larger?