Use of Adaptive RFC and locking

Hello,
I am using an adaptive RFC model inside a Web Dynpro Application to maintain data residing on a SAP Enterprise system.
This RFC also sets a lock in order to make sure nobody else tries to change the same data.
I use pessimistic locking which means:
1. Web Dynpro calls a RFC
2. The RFC first locks the data then reads the data and returns the result back to Web Dynpro
3. The user changes the data and presses a save button
4. Web Dynpro calls the RFC to write and unlock the data
The problem i have is the fact that after locking and reading of the data the RFC is ended and the data is received by the Web Dynpro App. But at the same moment the lock is automatically unlocked because the RFC has ended succesfully.
How can i achieve that the lock is still there at the moment i want to change the data or is this procedure of pessimistic locking not possible?
Bertil

Hi,
Whether possible or not : Don't know. Probably not with RFCs.
More importantly, shall you do it? If it is transactional data you are updating , you may wish to consider concurrency issues (what if you locked and came to web dynpro, and user is thinking whether he shall take a coffee break first before pressing the 'Save'. Would you like to keep this record(s) locked and unavailable for the entire duration?)
Normally, you would read the data in the first call, let the user update it on the second screen, and then, when the user presses save, execute in sequence :-
- try locking the record,
- if locking is successful, Verify whether the record you read has changed in the meanwhile or not (verify what you have in your workarea(before changes done by user) is the same as in DB, by reading again from the DB)
- If above check is successful, go ahead with the update else throw an error message to the user to redo the txn
- unlock, exit
hope this helps,
cheers,
Ajay

Similar Messages

  • Adaptive RFC and Locking Objects from WD Java

    Hi,
    There are some pieces of information available on this subject but no coherent and easy to follow "manual". Also some questions remain.
    I'd rate this a very important, i.e. "business critical" problem. Therefore I would appreciate your help to get things sorted in this thread.
    So let's start with a summary of what I think I understood so far (corrections welcome!):
    - You can call RFCs from WebDynpro and locking will work (on the ABAP side).
    - Once you release your JCo connection the locks will be released, though.
    - Therefore, to keep a lock in between requests you have to keep the connection.
    - You can keep the connection by passing WDModelScopeType.APPLICATION_SCOPE or WDModelScopeType.COMPONENT_SCOPE to the constructor of the model class.
    - You can lookup the default scope for a model using
         WDModelScopeType defaultScope = WDModelFactory.lookupDefaultScopeForModel((Class) modelClazz);
    Now suppose you have many users, each holding some locks.
    Would you not easily run out of JCo connections? On the other hand by default WebDynpro RFC Models seem to keep a connection per application instance (= user session).
    Using WDModelScopeType: Do you really need to code this or can you just configure this during design time for the deployment?
    blog=/pub/wlg/1061 claims the default is APPLICATION_SCOPE.
    Will connections (and thus locks) be released automatically on an HttpSession timeout? I guess so because this means the end of the application and therefore end of scope WDModelScopeType.APPLICATION_SCOPE and WDModelScopeType.COMPONENT_SCOPE.
    I'm also not clear about this:
    /people/sap.user72/blog/2005/01/08/adaptive-rfc-models-in-web-dynprosome-pointers
    "But to ensure that the record remains locked it is necessary reserve the connection that was used for locking and be made unavailable for other models and also the connection should remain open as long as the lifetime of the screen. This becomes similar to locking records through SAP Gui . This can be easily achieved by having separate models for locking RFCs defined with APPLICATION_SCOPE and isolating its connection by not grouping with other model objects."
    What does "reserve the connection" mean?
    Suppose you lock some object and afterwards want to allow the user to request more information about this or other objects.
    Would you need to use a different connection for that?
    Suppose you want to lock two objects.
    Would you need to use two different connections for that?
    Suppose you want to edit both objects and save the changes inside one transaction (with atomicity). A transaction normally is associated with a single connection (unless XA protocol is used). So how would this work?
    What will cause the locks to be released?
    - Application expiration (timeout)
    - RFC that explicitely releases locks
    - Transaction commit/rollback (?)
    Reference:
    I found some of the information and further pointers in the blog mentioned above and here:
    Disconnect method
    Looking forward to your replies
    Markus
    Message was edited by: Markus Wissmann
    Another thread with the same topic and no final answers:
    Handling object locking in R/3 from WD through RFC
    Message was edited by: Markus Wissmann

    Hi,
    This for If you send destination params are different u sent it thru URL param only.
    For that u need generate URL by using the application .
    For that purpose u need to create two applications u can call the first application in second application u can create URL and send Destination params with URL only.
    Other wise u can create the par file that would be configured in portal and thru worksets u can pass the params like u mention the destinations.
    Or at the time generationg URLS only u can add the destination names.
    Thanks,
    Lohi.

  • Best Scenarios when to use IDOC Adapter, RFC Adapter and Proxy

    Please provide me links/weblogs which demonstrate the full scenario that when to use IDOC Adapter, RFC Adapter and Proxy when working with sender R/3 system.
    Regards
    Rachit

    Hi abhinash,
    Check these links for java proxy
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d
    for ABAP Proxy ...
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
    http://help.sap.com/saphelp_nw2004s/helpdata/en/48/d5a1fe5f317a4e8e35801ed2c88246/frameset.htm
    for RFC .....
    RFC-xi-SOAP Scenario
    How to send RFC response message back to XI File/FTP adapter?
    https://weblogs.sdn.sap.com/pub/wlg/3865//Troubleshooting [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    /people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1
    Hope you will find them useful ..
    Regards
    Abhi

  • Using an Adaptive RFC Model from JSP

    I'm trying to use an Adaptive RFC Model I created for use in our Web Dynpros from a Portal Application project. I've created 2 DCs:
    1. A Web Dynpro DC, only containing the imported Adaptive RFC Model. The model has been added to the public parts.
    2. A Portal Application DC, with the model DC added as a DC usage (along with the other required DCs)
    Now, everything appears to work from inside NWDS. The dot operator works while editing my JSPDynPage class, and everything builds fine, but when I deploy and test in the portal, I get "package not found" errors on the actual JSP. I assume this is because the JSP is compiled at run-time. How do I expose these classes to the JSP compiler?
    It's seems like using the same method to call BAPIs in Web Dynpros and Java iViews would be a good practice following SAP's "reusable code" policy, so there must be a way to do it...

    Jonathan,
    Adaptive RFC Model works correctly only when running inside WebDynpro container. JSP runs outside container (in regular J2EE WebApplication container).
    The error you receive is due to missing run-time references to container classes.
    Actually, what you are trying to do is dead end, sorry.
    Use SAP Enterprise Connector instead of Adaptive RFC model. Generated connector classes works from any environment. Also they are sooo similar to Adaptive RFC that you'll even not mention a difference.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • My iphone 4s' screen is black, but it's still on and charging. I broke my lock screen button so I am unable to turn it off using the home button and lock button. Is there any other way my phone can restart or turn off ? Is my phone broken for sure?

    My iphone 4s' screen is black, but it's still on and charging. I broke my lock screen button so I am unable to turn it off using the home button and lock button. Is there any other way my phone can restart or turn off ? Is my phone broken for sure?

    Kbkohn wrote:
    I am in tears right now because I entered all my 11month old sons milestones into my phone and now I have nothing I'm so upset and am hoping there is a way to get this information back. 
    Most intelligent people would not store such sensitive data on a device that could so easily be lost, stolen, or damaged.  Even if they chose to do so, they would use the device as designed and regularly sync and backup that device as described in the User's Guide.
    Have you done so?  If you have, all of the data is either in iCloud or iTunes on your computer.  Replace the device and restore the new iDevice with the backup of the old one.

  • Difference between Adaptive RFC and Adaptive RFC2 model

    Hi,
    What is the difference between Adaptive RFC and Adaptive RFC2 model ?
    Regards,
    Sunaina Reddy T

    Hi
    Main difference are
    1.JCo 3.0 to connect to SAP Systems
    2.Improved connection management
    3.Faster performance
    4.Lower memory consumption
    5.SystemLandscape API is no longer needed
    6.Compatible to ARFC1 to allow easy migration
    Check the thread for further input
    1.[Whatu2019s New in Web Dynpro Java?|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8062c7d3-c86f-2b10-4894-a9a323da20b3]
    Best Regards
    Satish Kumar

  • I have iphone 4s 32GB ,the volume of the ringer and alerts can't be adjusted using the volume buttons and lock sounds and keyboard clicks available, but all not appear ??!!!!!!!

    I have iphone 4s 32GB ,the volume of the ringer and alerts can't be adjusted using the volume buttons and lock sounds and keyboard clicks available, but all not appear ??!!!!!!!

    Hi nitramred,
    To start troubleshooting this issue where you are unable to adjust the volume after receiving a call, please go ahead and first force close all of the apps currently running on the device, and then reset it by following the steps in the articles below.
    iOS: Force an app to close
    Turn your iOS device off and on (restart) and reset
    Take care,
    Alex H.

  • What is adaptive RFC and How to Use it

    hi friends
    what is the adaptive RFC
    what is the use of it
    how we can use it
    explain me anyone
    and send pdf also
    thanks
    ramu.

    Hi,
    To give u a brief idea.
    rfcs are used to call data from the backend that is R/3.We use the Bapis from the R/3 system which have some pre defined functionality and data is populated in the correspoding ui elements in webdynpro interface.earlier Rfcs were used but now we have adaptive rfcs in which
    if there are changes in the backend(R/3 system) such as changes in the datatype,structures,fields would be automatically be refllected in the rfcs and there would be no errors in web dyn pro even if there is  a change in the back end
    to be more specific folow this link
    http://help.sap.com/saphelp_nw70/helpdata/EN/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm
    and try out this application
    to use the rfcs firstly check out this document for configurations
    Important Configurations for Calling ABAP Function from Java Web Dynpro Application
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07753b9-fa0c-2a10-64a8-c6754c45396e
    heres the application.
    Creating a Web Dynpro Application Accessing ABAP Functions
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/355b9c90-0201-0010-d2a8-89fece426526
    regards
    Nikhil Tapkir

  • Adaptive RFC and multiple systems; Mapping JCO_DESTINATIONS by code?

    Hi,
    I have just learned <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/82/76a2406546ba15e10000000a1550b0/frameset.htm">here</a> that I can access several R/3 systems with the adaptive RFC model by using URL parameters like:
    http://<hostname>:<port>/webdynpro/dispatcher/local/ESSProject/ESSApp?
    <b>sap-wd-arfc-useSys=WD_MODELDATA_DEST:ABC&
    sap-wd-arfc-useSys=WD_RFC_METADATA_DEST:ABC</b>
    The parameters are a mapping of the original JCO_DESTINATION (WD_MODELDATA_DEST) called by the WebDynpro application to the target system which instead should be called (WD_MODELDATA_DESTABC).
    Does someone know wheather this mapping can be done by java coding? For example before the execute method will be called.
    Best regards,
    Marcus

    Hi,
    This for If you send destination params are different u sent it thru URL param only.
    For that u need generate URL by using the application .
    For that purpose u need to create two applications u can call the first application in second application u can create URL and send Destination params with URL only.
    Other wise u can create the par file that would be configured in portal and thru worksets u can pass the params like u mention the destinations.
    Or at the time generationg URLS only u can add the destination names.
    Thanks,
    Lohi.

  • Web Dynpro with Adaptive RFC and "complex" ABAP Structures

    Hi there,
    I'm calling an RFC that returns a table with a "complex" structure, i.e. a structure with nested structures and tables. The issue I am having is that I would like to loop over that table and extract the relevant attributes from each  row (i.e. attributes of the structure itself or of the nested structures or attributes of records of the nested tables), I however don't understand how.
    My first attempt looks as follows
    for(int i = 0; i < wdContext.node<<tab>>().size(); i++) {
      IPrivate<<view>>.I<<tab>>Element x =
        wdContext.node<<tab>>().get<<tab>>ElementAt(i);
    However "x" doesn't seem to have the getter methods for the nested tables in question?
    Help would be greatly appreciated.
    Regards, Chris.

    Hi,
    If you are using model node binding over adaptive RFC model all nested structures / tables becomes sub-nodes rather then attributes.
    VS

  • My iphone 4s will not charge nor turn on and it does not reset. This has been going on for about 2days, at first it would only stay to 1% i turned it off to charge better and it will not turn back on nor reset using the home button and lock button.

    I have no idea what to do, this is the second time that my phone has completely went dumb on me, the first time was March 2, and after 3hours of charging it finally turned on and charged completely now it does not do that. It stayed at 1% for a whole day (yesterday sunday) and now it does not turn on, and the home and lock button will not reset it. What do i do?? Help...

    This is the MacBook forum, you might post your question in the iPhone forum https://discussions.apple.com/community/iphone

  • Used ipod touch disabled and locked

    how can i unlock a used ipod touch i bought at a fleamaket it says disabled but locked

    Place the iPod in recovery mode and then connect to your computer and restore via iTunes. For recovery mode see:
    iPhone and iPod touch: Unable to update or restore
    For how to restore:
    iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software

  • Why does my memory use always max out and lock up.  iPhoto and iTunes are the only apps open.

    I also upgraded the momory to 8 gig and the problm is on going

    Open Activity Monitor, Show:>All Processes, sort on CPU%, see if anything using too much CPU% when this happens, click on Memory tab, do you have many Pageouts? Click on the Disk Usage tab, how much free space?
    Open Console in Utilities & see if there are any clues or repeating messages when this happens.
    In the Memory tab, are there a lot of Pageouts?

  • Inconsistency of results using adaptive RFC

    I'm calling a function from a R/3 System using Adaptive RFC and i'm having different results from my webdynpro application that the ones that i'm having in the R/3.
    If someone could tell me why this happen I will appreciate.
    Thanks.

    Hi Frank,
    Iin another opportunity I had tried to do the same procedure you are trying and not getting hit. I ended up using the parameter "sap-wd-client = WmlClient" in the url of the application ... What makes this return in xml format and can be accessed like a Web Service. It really is not a proper use for a Web Dynpro application, but with some customization finally meet demand.
    Regards,
    Angelo

  • One adaptive RFC Model and Multi Backend System.

    Hi All,
    I am trying to fetch data from multi backend system by using an adaptive RFC model.
    It is not tidy to create multi model for a RFC function to fetch data from multi SAP system, because we have dozens of SAP systems.(over 40)
    So, I would like to switch to multiple SAP systems with an adaptive RFC model at runtime.
      1 model(Same Function) -
    > System A
    > System B
    > System C
    Is there any sample or tutorial about this sort of senario?
    Thanks in advance.
    Message was edited by: JeongEog IM
    Message was edited by: JeongEog IM

    JeongEog,
    You may use SAP java Connector for doing that. Refer the following links for the step-by-step approach.
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/561106b8b3bc449f890cddfdc8d3e2/content.htm">Example program 1</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/f0/eedf3d0eb8af5ee10000000a114084/content.htm">Open Connection</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/24/efdf3d0eb8af5ee10000000a114084/content.htm">Calling a Function and Closing a Connection</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/content.htm">Example program 2</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/eedf3d0eb8af5ee10000000a114084/content.htm">Connection Pool</a>
    Bala

Maybe you are looking for

  • No Emergency Release Hole In MacPro DVD Drive

    I had a DVD stuck in the drive of my MacPro, tried everything to open the drive, but as nothing would work, I turned off the computer, and hoped to find the little hole under the driver tray that you stick an unwound paperclip in to open the driver.

  • Can the internal drive be updated to larger capacity

    can the internal drive be changed to a larger capacity,current drive is 160GB?

  • Radio button trouble when more than 2 selections

    I have a VI that uses 9 radio buttons to select one of nine cases. Each case contains a subVI that essentially creates a dated filename to write varying GPIB data to. The first two selections (1 and 2) work as designed. I get a date-coded filename wi

  • Rebate partial settlement

    Hello Experts Is it possible to apply the scales based on the rebates during partial settlement, currently it seems the standard rebates in the system will apply rebate scales only once the Final settlement is carried out ? Please suggest. Thanks

  • Very slow speeds

    I have run the BT speedtester with these results: Download Speed 163 Kbps 500 Kbps Max Achievable Speed Upload Speed 227 Kbps 516 Kbps Max Achievable Speed Broadband is very slow and I am sure I can achieve higher speeds. Please help!