Locking of objects between service calls

Hello,
Is there any practial way to lock an object (for example a loan) with one service so that it stays locked until another service commits the transaction and releases the lock? The service is a RFC function module that will be called by a web application. My problem is that when I use the standard ENQUEUE function the lock dissappears as soon as the first service is finished.
Also, if one service would create a lock of an object and another one starts the update task, they probably wouldn't be in the same LUW, would that be a problem? If so, is there a solution?
Thank you and kind regards,
Steffen

Steffen:
In the locking service use the _SCOPE parameter value of 3 in your enqueue function call. This retains the lock after the first service (locking process) ends. The second service that does the update can then dequeue the lock after the update is processed.
No problem with setting & freeing locks in different LUW, as the SAP locking mechanism is co-operative (i.e. software controlled) rather than database controlled. Just make sure that you use a standard SAP enqueue function so that other unrelated processes will honor the lock set by your first service.
Regards,
D.

Similar Messages

  • Link between Service Call and Marketing documents not working

    Hello all,
    I found a field in Marketing Documents - Rows data - that should be the link between a Service Call and the Marketing Documents.
    The field is for example "INV1.isSrvCall" but, even if I create an Invoice from the Service Call, the field will be populated with the value "N".
    Dows anyone knows how to make this field work? Or any workarround to make the connection between a Service Call and the generated documents?
    Thanks in advance,
    Kind Regards

    The problem with SCL4  is that SAP updates it way too late in the process to be meaningful while in the module. You create a service order, then go into the expense document. That is when we need to know the service call id and the internalsn of the equipment being worked on Only when you get out of the service module do SAP post to SCL4.  
    The data (before writing to SCL$) exists as a veriable on the original service form.  But can we access it from the expense document?
    The question is how to access the data (service id) on the original service form from an expense document within the servide module. It is the service form, and that is currently not in focus, so I do not know if you can access it as a varaible, while in the expense document (sales order or invoice) that is in focus.
    Can any one help with this/
    David

  • Lifetime of JNI objects between calls.

    Is it possible to store/cache non-class JNI objects between calls?
    I know I can 'lock' jclass object to *env however I need to be able to do more than this.
    Implementation :
    C++ code for which I am not responsible for NOR will I ever get access to the source code needs to be built into a Java Application.
    Everything that I need to do works fine except when I need to have jobject's and, in particular, the JNIEnv reference to be cached in the dll between JNI calls.
    Raison d'etre : I want to implement a Callback using a Java object (Observer/Observable) so that the status of the C legacy app can be monitored via a callback implemented as part of the dll.
    Java object is called via the C callback, sets status via a status method called via JNI, Java App is notifoed of the change.
    Problem, as long as the first call the the jobject occurs within the actual JNI call that creates the Java object all is well, as soon as I try and store the jobject and JNIEnv references so that the C callback can call it as well then things break.
    Is it possible to have JNI objects whose lifetime spans JNI calls at all?

    In the meantime I have found out exactly how to achieve callbacks via native/Java. Having studied Sheng Liang's book (an absolute must buy and read) things became a lot clearer.
    This is what I discovered...
    The main issues with implementing callbacks within a JNI framework are the following..
    Lifetime of the JNIEnv and other classes/objects involved on the native side of the process.
    Threading issues on the native side, especially when interacting with Objects created in a different thread.
    The first issue is dealt with, in part, by being able to obtain a valid JNIEnv at arbitrary points in the native code. If you obtain a valid JNIEnv in an arbitrary native thread that JNIEnv is valid in it so this also helps problems with the second issue.
    The key to obtaining a valid JNIEnv is in having a reference to the calling VM.
    The function..
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
    allows you to cache a reference to the calling JVM. It is called when the dll is loaded before any other functions in the native code are called. The JavaVM reference is valid throughout the lifetime of the dll's instance.
    you can then do this to obtain a valid JNIEnv anytime you like..
    JNIEnv *env;
    vm->GetEnv((void **)&env, JNI_VERSION_1_2);
    Ok, thats dealt with problem of obtaining valid JNIEnv's when we need them.
    In order to extend the lifetime of objects and, in particular, classes from which those objects are instantiated you need to create global ref's to them. I did mine this way..
    In the calling Java code, I instantiate a callback object and pass that to a native method whose native code does the following..
    gets the object's class as a local reference, creates a NewGlobalRef of the passed object and its class. These jobject and jclass global references are stored as global vars in the DLL. You can also, at this point, create jmethodID's for all the methods you may need to call as part of the callback process however callbacks should finish as quickly as possible so restrict your calls to the minimum. Caching the method ID does not require a global ref, nor is is thread 'sensitive'. GetMethodID can be used to store a local jmethodID reference in a global jmethodID var, this saves you some time and performance hits in the native callback functions.
    The above description deals with the lifetime of objects between JNI calls. What about the threading issues?
    We have seen how to get a valid JNIEnv when we want one. This JNIEnv is valid for the NATIVE thread in which we call vm->GetEnv((void **)&env, JNI_VERSION_1_2);
    There is another way of getting valid JNIEnv's when we want them but this seems only to work when we are using the invocation interface (having the native side create an embedded JVM). This is the jvm->AttachCurrentThread function. I have tried both, only GetEnv seems to work as expected in the native DLL code, AttachCurrentThread when the JVM is invoked from inside a native application.
    To successfully perform the native/Java callback, assuming you have cached a JavaVM reference and the callback object/class correctly, is to get a valid JNIEnv as shown above, use this JNIEnv for the method calls you need to perform on the callback object, cleanup if needed.
    Note, you MUST DeleteGlobalRef's before the DLL is unloaded. If you don't you may find your Java VM crashing on exit (a horrible bug to have to track down).
    Either explicitly create a cleanup native method that you have to call and/or use the JNI_OnUnload function that is called just before the DLL is unloaded (usually when the JVM is being stopped).
    Things you can do to make your callback efficient :
    Make the calls return as soon as possible. I use the Observable/Observer pattern so that further Java objects (the observers) can handle the changes made to the callback object. If, like me, you are reflecting state changes in the native system component via callbacks and displaying them in a GUI environment then your Observer can wake up a thread to do the GUI updates, the observable callback need only notifyObservers in order to start things off and return.
    Hope this clears things up for you, if you have further questions please mail me, I believe my email address is available, if not post here and I will get to you.

  • Service Call in SBO 2005 B PL 38 - Activity done but not added to call

    Hi All,
    I have updated PL 38, SBO 2005 B, I had created Service call, it was created successfully, now i have done activity of return but it dosent add to activity tab and gives us error -> "Generate SCActivity : A Service Call Activity dose not exist"
    Can any one has idea or solution of this please.
    With Warm Regards
    Chintesh Soni

    Hi
    I am not sure note :891809 is suitable for your issue or not.
    this note is about "The Activity exists but it seems that there is no link saved between
    Service Call and Activity."
    hope it could be helpful.

  • Service Call activities

    Currently if you create an activity against a service call the call number and source are copied to the activity as Source Object Type service call and Source Object No. as the call number.
    If you close this activity and create a follow up activity the service call details are not copied across to the follow up.
    It would be very useful if they were copied as - for example.
    The first activity is an Engineers Visit to check a faulty unit.
    This requires a Purchase order to be placed for a repair as the next activity.
    The next activity could be returning the repaired unit to the customer.
    If you could use follow up activities it would keep all activities and the history on the service call screen.
    At present the follow up activities are only attached to the BP so you lose the traceability.

    hi Cladio
    if u want to add the remarks field then u have two options first option is that u can add a UDF user defined field for remarks however if u want the remarks column to be there in the standard service call screen then u can do it by the help of coding
    Hope this would suffice your concern
    Regards
    Manish

  • Service Call Number Missing

    Hi
    I am facing an unique problem, we are creating service calls, but in between service call number are missing.  We have queried for the missing number, its saying no data found.
    Kindly help in this.
    Regards
    Sundaram

    Hi Gordon,
    We are using SAP B1 8.8 PL 14.  Why 20% recorded as empty calls. Not able to understand.  Is it a problem in the application or in the end user side.
    Can u pl explain.
    Thanks
    Sundaram

  • Service call report - overdue ??

    Hi, Experts,
    On the main menu [service] -> [service reports] -> [service call'] the first report.
    After executing it, the report has one column named "overdue", could you pls advise how to tell it's overdue or not?  what's the date the report used to compare?
    Thanks.
    Emily

    Hi Emily,
    I believe this Overdue compare the Response times and Resolution times between service call and service contract.
    Thanks,
    Gordon

  • Comlete cycle fo Service call

    Hai all
      I need to know about the complete cycle of the service call object, upto service call creation to payment generation,
      Please anybody helpme in this regard
    Regards
    somaraju

    Somaraju,
    I am not sure what you are asking specifically, but if you are trying to get an understanding of how to use the Service functionality in SAP Business One, you should look at the eLearning for SAP Business One at the service.sap.com SAP website.
    HTH,
    Eddy

  • Problem in passing/returning objects over dynamic web service call

    Hi Friends,
    I am beginner in java web service.
    Here is the problem I am facing when I pass/return user defined objects to remote web service method using dynamic we service call.
    The client can call the remote web service method in 2 ways.
    1. By generating client stubs using WSDL file
    - In this case, I am able to pass/return the user defined objects to remote method without any issue only when the server side web services are deployed in any server(jboss)
    - But in java 1.6 & above, the web services can be deployed without server using endpoint. In this case, I am not able to pass/return objects over web service calls.
    2. Without generating client stubs (dynamic web service call)
    - This will establish a connection at run time using the given WSDL file (I have attached the document). I have to form an XML(This will contain API name, arguments) string as input at run time
    - In this case, it allows only string as argument while passing & returning.
    Please let me know if you can help me on this.
    Regards,
    pani

    I'm not sure about your question, but this might help:
    [http://forum.java.sun.com/thread.jspa?threadID=5251188|http://forum.java.sun.com/thread.jspa?threadID=5251188]
    You might also want to read on JAXB.

  • Object store for web service call?

    Hi all,
    If I can't do synchronous web service calls I remember
    reading something about an object that you can send with the call
    containing attribute you set and it will be included in the
    callback. I can use this to store some info I need for the call
    back on the client side.
    I cant find info about this object now despite searching high
    and low. If this object exists what is it called (callbackStore?)
    thanks
    Mark

    Hi Mike,
    Good news!!! I figured out what's happening.
    The codes that I posted were related to the Process. They are process status codes.
    What you are looking for is related to the Job. So here are the job status codes.
    JOB_STATUS_UNKNOWN = 0 (default)
    JOB_STATUS_QUEUED = 1
    JOB_STATUS_RUNNING=2
    JOB_STATUS_COMPLETED=3
    JOB_STATUS_FAILED=4
    JOB_STATUS_TERMINATED=5
    JOB_STATUS_SUSPENDED=6
    JOB_STATUS_COMPLETE_REQUESTED=7
    JOB_STATUS_TERMINATE_REQUESTED=8
    JOB_STATUS_SUSPEND_REQUESTED=9
    JOB_STATUS_RESUME_REQUESTED=10
    cheers,
    Parth

  • How to handle lock object in BDC  call transcation method?

    Hi,
    how to handle lock object in BDC  call transcation method?
    Thanks In advances.

    If you are updating Z-fields then you need to create a lock entry, before you use call transaction.
    After creating lock object, please use FM Enqueue_<lockname> before CALL transaction and FM Dequeue_<lockname> after you have commited your data.
    Thanks,
    Kartavya

  • Will Service call out return an exception with an object embedded in it

    Hi,
    I have a service callout in a request pipeline.Service will throw an exception with a custom object embedded inside the exception.When i see the response $fault in the service error handler, i dont see the object.Is this something which can be done or not?if yes then guide me through it.

    Hi,
    If you invoke the service call out, and it returns a soap fault (make sure that it returns http 500), so you should be able to access the custom fault element inside $fault/con:details/con1:ReceivedFaultDetail/con1:detail
    Are you sure that your webservice is returning the fault properly?
    Are you not raising a new error after getting the response in the error handler, right?
    Regards,
    Fabio Douek.

  • Series Primary overlaps object Service Call

    hI SAP gurus,
    i am trying to create new series in Document Numbering for  'Service Call' , it doesn't allow me to create Series Numbering and following Error is showing ...
    Series Primary overlaps object Service Call
    Does any one know how should i create a new Series for Service Call..?
    i appreciate your help.
    Thanks and Regards,
    kaviprashu

    hi,
    ok i will quote this for you
    Symptom
    It is a legal requirement in Brazil that service calls are numbered.
    Solution
    To facilitate the legal requirement that users can trace and manage service calls efficiently, it is now possible to assign service calls to sequential series numbering. All marketing document numbering rules (search, overlapping numbers, manual series, and etc.) are also applied on service calls. The following fields and objects are added:
    In the Document Numbering - Setup window, the service calls object is added.
    To access the Document Numbering - Setup window, choose Administration -> System Initialization -> Document Numbering.
    In the Series - Service Calls - Setup window, the 'Primary' series is added.
    For new and upgraded companies, the application automatically creates the 'Primary' series for service calls.
    In the Numbering Series - Setup window, the 'Primary' series is added.
    In the Service Call window, the No. fields (selection of series and number) are added.
    To access the Service Call window, choose Service -> Service Call.
    In the Relate Series to Document - Setup window, the service calls object is added.
    For the service reports (Service Calls, Service Calls by Queue, Response Time by Assigned to, Average Closure Time, Service Monitor, My Service Calls, My Open Service Calls and My overdue Service Calls, Service Contract document - subtab Service Calls and Customer Equipment Card - subtab Service Calls):
    Call No. (label text) is changed to Call ID.
    The Document No. field represents the new call no. field.
    Series column is added to service reports.
    The Check Document Numbering - Selection Criteria window also includes checking of the service calls sequence.
    To access the Check Document Numbering - Selection Criteria window, choose Administration -> Utilities -> Check Document Numbering.
    For new created service calls, no record will be written to History Change Log when you add service calls (the same as the system behavior in the marketing documents).
    Only after the actual update on an already added service call, a history record will be added.
    There is no change in the already existing Call ID field, the behavior of this field stays the same.
    Other terms
    service calls, series, numbering, B1, sequential
    Header Data
    Released on     15.08.2011 15:48:33
    Release status     Released for Customer
    Component     SBO-SER-SCL Service Call
    Priority     Recommendations/additional info
    Category     Advance development
    References
    This document is referenced by:
    SAP Business One Notes
    1606253           Overview Note for SAP Business One 8.81 patch 07
    Validity
    Software Component
    Version
    SAP BUSINESS ONE
    8.81
    regards,
    Fidel

  • Difference between Project call off order and Service order

    Hi,can anyone please explain to me the
    Difference between Project call off order and Service order
    Thanks,
    SS

    Hi SS.
    Please post your query to Project System (PS forum for getting quicker answers.
    /community [original link is broken]
    Yuo may please close this thread.
    Regards
    Datta

  • Azure newby! Persist an object across multiple Azure WCF Service Calls.

    I have created a small .NET Library (DLL) which does custom calculations and such.
    I would like to create an Azure WCF service which basically wraps this libraries API.
    The library, by necessity, is setup like an engine that must be initialized before use, so I don't want each and every service call to instantiate its own copy of the library. Is there a way to have the first call instantiate the library
    and then persist it somewhere so that other service calls will just use the same instance?

    Hello,
    We are researching on the query and would get back to you soon on this.
    I apologize for the inconvenience and appreciate your time and patience in this matter.
    Regards,
    Azam khan

Maybe you are looking for

  • Java.lang.Exception... RMI error

    Hello... I'm have a problem when the program RemoteServer.java is compiled: The reference is in: http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/rmi.html I have a link from /usr/lib/ to /usr/local/lib and libgcj.so.3 is

  • Battery Recall

    Hi everyone. I bought a first generation MacBook Pro (the original Core Duo 1.83GHz version) way back in June 2006 from the Apple Retail store near where I live in Meadowhall, Sheffield. I have recently been noticing my MagSafe connector flickering w

  • HELP!!  Solaris 10 - Mount NFSv4 Share from Linux using Kerberos Security

    Greetings all, my apologies if this post is in the wrong place... I have an issue getting Solaris 10 to mount an NFSv4 share from a SuSE Linux 10 machine using kerberos security. I am able to mount the NFSv4 share from another SuSE 10 machine. The ke

  • Process code for Function Module IDOC_INPUT_MBGMCR

    hello!! here i m tryin to create n inbound idoc idoc type - MBGMCR02 Function Module - IDOC_INPUT_MBGMCR but i dont knw the process code for dat can ny 1 help me to find it? 1st of all how to find da process code if u hav the FM ? it wld b more helpf

  • Dreamweaver rollover working in preview but not online

    I use image swap for rollovers often. After making some changes to my friends website I noticed all the rollovers stopped working. I tried it in all browsers, I tried restoring a file from time machine, I tried it with a bunch of different images. So