[Solved] How to update records in entity based on view with distinct

Hi
- I have a relational view of the form:
SELECT DISTINCT
FROM TAB1, TAB2, ...- I created instead of triggers for delete, update and insert.
- I created an entity object on this and an updatable view object
- I added this to my module.
- Then I test the view object in the module (module > test), and if I try to update an existing record, I receive the error:
(java.sql.SQLException) ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
So, ADF internally create as select FOR UPDATE cursor to update the modified record and as the error shows, this is not possible on a view with distinct, ...
Is there a way to work around this error without to rewrite the view?
I was thinking that there is maybe a way to force ADF not to use the select FOR UPDATE and use UPDATE .. SET <value> WHERE <pk>, or maybe to create a new instead of trigger to catch the select FOR UPDATE?

Arti,
Here's another solution (that will still use locking, and can help avoid the "lost update" problem):
http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html
John

Similar Messages

  • How to update Records from Internal table to u2018Zu2019 table?

    Hi Friends,
    How to update Records from Internal table to u2018Zu2019 table.
    I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
    ( my internal table & u2018 Zu2019 table structures are same.)
    Thanking you.
    Regards,
    Subash

    Hi,
    loop at internal table.
    modify <Z- table > from values < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    endloop.
    or
    UPDATE <Z- table > from table < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    Prabhudas

  • How to update multiple calling hours based on business partner

    Hi All,
    please help me in this issue : how to update multiple calling hours based on business partner in SAP CRM.
    Regards,
    Siva kumar.

    Check maintainance view V_TB49, add new scheduling type.

  • How to update a custom field in declarative workflow with VS 2013

    Hello,
    How to update a custom field in declarative workflow with VS 2013
    any help would be appreciated!!!!!
    Thanks regards, Vignesh.

    Dear all,
    I'm using 4.6C right now, i already implement BADI MEREQ001, but this only valid
    for creating PR via ME51N.
    I found an EXIT_SAPLEBND_001 and tried to implement it,
    but i got another difficulties since how i transfer CEBAN structure to EBAN structure.
    thanks very much.
    Regards,
    Billy

  • How to update Records of SAP table from .CSV file

    Hi,
    I have written a code which takes a data from (,) delimited CSV file and adds it into the Internal table.
    Now I want to update the all fields in SAP table with the Internal table.
    I want to use Update statement.
    Update <table Name> SET <field needs to update> WHERE connditon.
    I don't want to iterate through thousand on record in sap table to check the where condition.
    Could you please tell me how to do it.

    Hi. I thing you will not workaround the iterating of the internal table.
    You can pre-load all the records into another internal table
    check lt_csv[] is not initial. " important, otherwise next select would read all records of the table
    select .... into lt_dbitab for all entries in lt_csv where key-fieds = lt_csv-key_fields...
    check sy-subrc eq 0 and lt_dbitab[] is not initial.
    then do in-memory update of the it_dbitab
    loop at it_dbitab assign <fs>.
      read table lt_csv assign <fs_csv> with key ... " lt_csv should be sorted table with key, or you should try to use binary search
      if sy-subrc eq 0.
        ...change required lt_dbitab fields: <fs>-comp = <fs_csv>-comp...
      endif.
    endloop.
    ant then you can do mass-update
    update dbtab from table lt_dbitab.
    From performance view, this solution should be much faster than iterating lt_csv directly and updating every single database record
    Br
    Bohuslav

  • How to update record xml data?

    Hi,
    How can update existing record using an existing xml packet?
    Thanks.

    Hi,
    The above Exception seems to be because of mapping error.
    Check your mapping for all the mandatory 1-1 mapping, also the 1-unbounded parent node mapping.
    Once when you import the XSD and activate your External Definition if it does without any error then there is no problem with your External Definition.
    If this error occurs only when you test your mapping then this is mapping error and not because of XSD.
    Please check the parent node mapping like 1-unbounded.
    Reward Points if useful
    Regards
    Ashmi.

  • How to update address fields from a different view?

    Hello Everyone,
    I have created a context node(Model Attribute) of standard address fields using BuilAddress in a view that doesn't have it and successfully displayed them. This is contacts view where the original address of the contact is not available. Now our requirement is to update the standard address if needed from the contacts view itself. How can I do this?  The address fields are available for display only, even if I want to update them using code based on some condtions if not manual entry how can I achieve that?
    Did anyone ever use CRM_BP_UIU_SAVE Badi? I see no posts related to this in forum. Can anyone give me a sample code on what can be done in here and what data of BP is accessible in this BADI and how?
    Thanks,
    Sunil

    Hi Murali,
    Are you sure I can update the address fields using BAPI's from WEBUI? I have tried this already and the BAPI or Function just woudn't call, always return with error message.   I was thinking that BAPI's and Functions for updating just wouldn't work from WEBUI.
    To give you more details, I am in the BP_DATA/AccountContactEF view. I added the context node Address and brought in all the fields from BUILADDRESS structure, it generated the get, set methods for me. I want to update a couple of fields like telephone info, street, city etc. In this view I just redefined Create_Contact method and I tried to update the address using BUPA_ADDRESS_CHANGE for the contact person and it never works. I also tried BUPA_ADDRESS_REMOVE to delete and add the new address using BUPA_ADDRESS_ADD, but that wouldn't work either.
    So that is why I am exploring the option of using BADI, which I found out is very similar. I was able to access pretty much everything of BP data and Contact data. but there also the functions or Bapi's wont work.
    Let me know if you did anything similar. Also as you mentioned the GET_I method, Context node creation  Wizard generated it for me and I have the field editable, its just that when I save it , it wont save and the old values are read back and populated. Meaning if I have  'NY' for region and I change it to 'CA' , after save 'NY' comes back.
    Thanks for you help.
    Sunil

  • How to update UDF in OID11g(OIM 11g configured with LDAP SYNC)

    Hi All,
    I have configured OIM11g with LDAP SYNC and it is working fine. i have added some UDF on the user creation form and the same attributes has been created on OID as well. Now, when i create users on OIM with these custom attributes the values are not getting updated on OID resource, can anyone please let me know how to update these attributes on OID?
    Thanks in advance,

    to Update a UDF you must assign a copy value adpter in Lookup.USR_PROCESS_TRIGGERS(design console / lookup definition)
    eg.
    CODE --------------------------DECODE
    USR_UDF_MYATTR1----- Change MYATTR1
    USR_UDF_MYATTR2----- Change MYATTR2
    Edited by: Lighting Cui on 2011-8-3 上午12:25

  • Create edit form based on view with multiple column key

    Hi
    I have a requirement to create a form to update some tables columns based on a view.
    The problem is that the view has a primary key of 4 columns.
    I have tried to create a rowid key based on one underlying table but this does not work.
    I am calling the form from an interactive report but can only pass 3 keys to the form, so only get 3 fields populated.
    Is there some way i can create the form manually as the wizards cannot cope with this requirement?
    My view is here:
    CREATE OR REPLACE FORCE VIEW "DMOADMIN"."MO_STATUS_LOG_VIEW" ("MONEY_ORD_NO", "STATUS_CODE", "DESCRIP", "STATUS_DATE_TIME", "TXN_DATE_TIME", "LLOG_ID", "LINE_SEQ_NO", "CANCEL_IND", "PROCESS_ID", "PBU_ID", "TXN_SEQ_NO", "CANCEL_REASON", "CONDITION_ID", "ADMIN_DATE_TIME", "ADMIN_LLOG_ID") AS
    SELECT a.money_ord_no,
    b.status_code,
    b.descrip,
    a.status_date_time,
    c.txn_date_time,
    c.llog_id,
    c.line_seq_no,
    c.cancel_ind,
    c.process_id,
    c.pbu_id,
    c.txn_seq_no,
    c.cancel_reason,
    c.condition_id,
    d.txn_date_time admin_date_time,
    d.llog_id admin_llog_id
    FROM mo_status a,
    mo_status_desc b,
    host_txn_log c,
    host_admin_log d
    WHERE a.status_desc_id = b.id
    AND a.money_ord_no = c.money_ord_no(+)
    AND a.status_date_time = c.txn_date_time(+)
    AND a.money_ord_no = d.money_ord_no(+)
    AND a.status_date_time = d.txn_date_time(+)
    WITH CHECK OPTION;
    I have tried to populate the data using with an on load process using a plsql query but it is not working. I get no data found error message. Help!

    Hi Erwin,
    I have a similar situation.
    Tabular form based on a view. The view contains a table in a another instance via dblink and everything works fine.
    The only one difference between my and your view is that my "instead of" view is only for UPDATE. You must to have "intead of" trigger only for UPDATE. Insert and delete works fine withoust "instead of" trigger.
    So, try to delete INSERT and DELETE words from your "INSTEADOFBUBA" trigger.
    hope it helps,
    Mzz

  • Role-Based CLI Views with AAA method

    Hi,
    I'm configuring Role-Based CLI Views on a router for limiting access to users.
    My criteria:
    - There should be a local user account on the router that has the view 'service' attached to it
    - If the router is online and can reach the radius server, people in the correct group are assigned the view 'service'
    My configuration:
    aaa new-model
    enable secret 1234
    username service view service secret 1234
    aaa group server radius my_radius
    server-private 10.1.1.1 auth-port 1645 acct-port 1646 timeout 3 retransmit 2 key 0 1234
    server-private 10.1.1.2 auth-port 1645 acct-port 1646 timeout 2 retransmit 1 key 0 1234
    aaa authorization console
    aaa authentication login mgmt group my_radius local
    aaa authorization exec mgmt group my_radius local
    line con 0
    authorization exec mgmt
    logging synchronous
    login authentication mgmt
    line vty 0 4
    authorization exec mgmt
    logging synchronous
    login authentication mgmt
    transport input ssh
    The ERROR
    Now I want to go configure the cli view 'service'...
    # enable view
    Password: 1234
    *Jun  1 08:00:02.991: AAA/AUTHEN/VIEW (0000000D): Pick method list 'mgmt'
    *Jun  1 08:00:02.991: RADIUS/ENCODE(0000000D): ask "Password: "
    *Jun  1 08:00:02.991: RADIUS/ENCODE(0000000D): send packet; GET_PASSWORD
    *Jun  1 08:00:21.011: RADIUS: Received from id 1645/13 10.1.1.1:1645, Access-Reject, len 20
    The Questions
    Why does the 'enable view' try to pick a method list when you have to supply the enable secret to access the root view?
    Can you change this behaviour to always use the enable secret?
    The TEMP Solution
    If you're logged on to the router via telnet or SSH, the solution or workaround to this issue is:
    aaa authentication login VIEW_CONFG local
    line vty 0 4
    login authentication VIEW_CONFG
    Do your configuration of the view and re-configure the line to use the correct (wanted) method of authentication.
    Thanks so much for the suggestions
    /JZN

    hi,
    You have the following configured:
    aaa  authentication login mgmt group my_radius local
    aaa authorization  exec mgmt group my_radius local
    line  con 0
    authorization exec mgmt
    logging synchronous
    login  authentication mgmt
    line vty 0 4
    authorization exec mgmt
    logging synchronous
    login authentication mgmt
    transport  input ssh
    Hence every time you try to login to the console or try the ssh the authentication will head to the radius server because of the following command "login  authentication mgmt".
    You cannot make it locally. Whatever defined on the method list mgmt first will be taking the precedence.
    enable seceret will be locally defined. but you have the following configured:
    aaa  authorization  exec mgmt group my_radius local
    line  con 0
    authorization exec mgmt
    line  vty 0 4
    authorization exec mgmt
    Hence exec mode will also be done via radius server.
    when you configure:
    aaa  authentication login VIEW_CONFG local
    line vty 0 4
    login  authentication VIEW_CONFG
    You are making the authentication local, hence it is working the way you want.
    In short, whatever authentication is defined 1st on the method list will take precendence. the fallback will be checked only if the 1st aaa server is not reachable.
    Hope this helps.
    Regards,
    Anisha
    P.S.: please mark this thread as answered if you feel your query is resolved. Do rate helpful posts.

  • How to update records in a table based on user selection..

    Hi all,
    This time the above doubt is totally based on the logic of coding which I tried a lot but didn't get any solution. so atlast I come to sdn site.
    please help..
    The requirement is like that I have a table with 6 fields (1 primary key and other are nonkeys). If the user inputs some values in the fields on the screen, then a row will be added in the table. Upto this i have done well. but when the user want to change some value  in the existing row of the table my program unable to do so. Because I couldn't get any logic to do that as there are 5 nonkey fields, so if any one field is modified then the respective row should be selected first based on the user selection and then it should be updated.
    At this point I could not get any idea as it may take a lots of if conditions (I guess) to reach to that particular row.
    Please help..
    thanks ,
    sekhar

    Hi Sekhar,
    I am afraid, the whole design of your program is wrong, let me explain
    Let us say you have two rows(5 non key fields) that the user wants to update and the data in these five non key fields are identical and in your program you are getting a number(which is the key) using a number range object. So you will have two entries in the table for the same data.
    And on the update page when the user enters the non key fields, how will the program know(or for that matter any one of us) which record to pick, if you have two identical books and if asked for a book wouldn't you ask which one among these two do you want?
    Possible Solution: Identify a possible key maintaining the integrity of the data, that is a combination of the non key fields which will help you identify a unique row and make these fields as key fields in the table.
    A more costly solution(if you do not want to change the non key field keys to key fields) would be to, adding a check(using select statement) to see if the non key fields combination already exists in the Z table before inserting a record into the table.
    If yes, throw a message to the user and just update the values in the table, else insert the record.
    Another solution would be to, use the non key fields to generate a key(using some logic) and using this instead of the number range object.
    regards,
    Chen

  • How to update record in Table control

    Dear Friends,
      I have table control that has space for 10 records but i need to update 15 record from the flat file which is getting into the table how can i do this.
    Regards,
    MAHENDRA.

    Hi,
    you record for an item and then click on page down and save it.use the loop on this bdc to populate the the bdc table no need to do manually.
    LOOP AT  l_i_dettab_item INTO l_wa_dettab_item..
          l_cursor = l_cursor + 1.
          IF l_cursor GT 1.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                   '=P+'.
          ENDIF.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001- GTIN_VARIANT_TYP'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001-VTWEG'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
          PERFORM bdc_field       USING l_cursor_notation
                                        l_wa_dettab_item-vtweg.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001-DATEFROM'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
             PERFORM bdc_field       USING l_cursor_notation
                                        l_v_date.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        l_cursor_notation.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=SAVE'.
        ENDLOOP.
    Here my ok code for page down is =P+  so i am looping on the table control data and then populating the bdc table after this i will populate the remaing info required for the call transaction and refresh bdcdata.
    thats it no need to do recording 1000 times.
    now if u do like this it doesn't depend on the number of records on table control.
    it will take all the records.
    Reward if useful.
    Regards,
    sasi
    Regards,
    sasi

  • How To Suppress Records In Subreport Based on Value in Main Report

    I want to supress records in the Details section of my subreport based on a value in the Details of my Main report (main report could have same record as subreport).
    I created the following formula with a shared variable and placed it in the Details section of my main report:
    WhilePrintingRecords;
    Shared StringVar sCertCode :={ACCPASCERT.CERT_CODE}
    I placed the subeport in the Group Footer of the Main Report.
    In the subreport, in the Section Expert I added the following formula for Supress of the Details section:
    WhilePrintingRecords;
    Shared StringVar sCertCode;
    sCertCode = {ACCJBCERTS.PERS_CODE}
    Unfortunately even though the value in the main report is the same as the value in the subreport, those records are not being suppressed in the subreport.
    Would appreciate any ideas.
    Thanks.

    Thanks Zilla.
    The group is not based on Cert_Code but on another database field.
    I can try linking on the Cert_Code. But, how do you make the link "<" ">" when linking the main report and the subreport. I don't see that as an option?
    Edited by: Giulia Smyth on Feb 27, 2009 4:05 PM

  • How to update Record Model for old Records(Personnel Record) in DPF?

    Hi
    i was able to successfully implement Digital Personnel files and Record Management for my scenario, but now question is:
    i have created a record for personnel using "SE38--> Report (RPASRCREATEDPF)"  or "Tx RPASRCREATEDPF)  after a while i decided to add a node to my record model , how can i update my personnel records to new record model?
    i need to do it for several staff and this is not logical to change record for every individual staff. Also when i deleted a record and recreated it all of old Archived and Processed Document gone.
    Any Idea?
    Regards,
    Ali.

    Hi Pragya
    Thank you for your very helpful answer, i tried that report and it has changed my records but problem is, i am using SAP sample record model , i have changed some Nodes Name and it seem name change has not taken effect in my records, those nodes that i added to my record model is correctly transferred, but some changes has not affected my personnel records.
    Green: Change Affected
    Red: Not Changed
    Regards,

  • How to update open PO price based on Price date category in contract?

    I've created a contract/ outline agreement with Price date category as '2'- Delivery date. (Path is Item details> More Functions> Additional Data). This means that PO price should be determined based on its delivery date.
    In contract, there are two date ranges for conditions. PO creation and delivery date falls under different ranges. Now, the open PO price is getting updated based on PO creation date but not on delivery date. We have tried using MASS transaction for this.
    Can someone suggest any solution?

    The Price Date category field was visible in contract  but not in our PO. Due to this, MEMASSPO was not updating the field value and we were changing the value to '2' manually by debugger. Hence some table updates were missing and causing the whole issue.
    The solution is to change the screen layout for PO. If Price date cat field is hidden, then you need to make it optional entry in SPRO- Purchase Order - Define screen layout at document level--> Quantity and Price for ME21N , ME22, ME22N and for field selection key assigned to PO document type.
    This field will be available in ME22N- Condition Control TAB.
    Regards
    Ankita

Maybe you are looking for

  • Apps disabled on the Verizon Galaxy S6 and S6 Edge

    Samsung Galaxy S6: Verizon, AT&T remove Microsoft apps | BGR I was curious about which features would be removed from the galaxy s6/ s6 edge on Verizon; Verizon has been known to remove features! (Which might have influenced a consumer's decision to

  • Generate a text .sql  (another question)

    thanks for your script V. garcia about generate a text .sql but, i want to know if i want to generate a text sql with a database but i want to take juste object without row inside. In fact, i want empty base, juste object? Is it possible? thanks for

  • Using a reset button for a dynamic table

    I have a 6 page form that includes several dynamic tables. There is a reset button that clears only specific parts of the form because it is something that will be filled out weekly and a lot of the information will stay the same. My problem is that

  • Camera Raw 8.3 Workflow option no longer has a preset drop down to create custom presets.

    I do not know why I am no longer able to assign presets to my Camera Raw workflow.  The drop down in no longer available at the top.  Any suggestions on what I did to hide this, I would appreciate it. Thanks

  • Random "Server Not Found" errors.

    Since I updated to the most recent version of Firefox I'm randomly getting "Server Not Found" errors when I try to navigate to sites via searches, direct links, and typing in the URL. Anyone know what's going on?