Should we use Lock when we use FM change_document

Hello All,
I have a requirement to change all the open items assignment field ( ZOUNR) for a particular company code and fiscal year and also for a particular G/L account.
so i have found a FM that will update the Dcoument related information change_document , now what i want to know is whether to use this FM between ENqueue and Dequeue.
here is my logic
i will select all the documents with open item from for a particular Comp code, fiscal year G/L account and Posting date. after keeping all the data into an internal table it_final. i want to make use of the FM change_document.
so should i lock the updation using enqueue and dequeue. or can i directly pass the internal table to the FM wihtout using the Lock mechanism.
Thanks in advance

Hi,
You must to use the Lock mechanisam when you update the Table. For example you have selected  the record that record you want modify . If some one is deleteing the record you will not able to modify. If you lock the table no will get the change access. So you can easily modify using the lock mechanism.
Regards
Thiru

Similar Messages

  • Locking when using a component as an object in the application scope...

    I have a component that I am building right now that hold
    application settings that are stored in a database table. The
    settings are maintained in a structure "variables.settings" within
    the component and can only be accessed by get and set methods. I
    use the following to create the instance of the object:
    <cfset application.settings =
    createObject("settings","component").init() />
    Now when getting a setting I do not think locking is needed
    as its just reading the value and I am not really concerned with a
    race condition...
    But when using the set method which will update the value of
    the setting.... should I be locking that as technically the object
    is in a shared variable scope? Or is it safe because its within the
    cfc/object?
    If locking is needed, would I need to lock when using the set
    method? or can I just build the lock into the set method so that
    its always there?

    To disagree with craigkaminsky, I think you only need to lock
    if you are
    concerned about race conditions and what could happen during
    a 'dirty
    read' and|or conflicting writes.
    A lot of developers have an old impression of ColdFusion that
    one *must*
    lock all shared scope variable access to maintain a stable
    application.
    This dates from the ColdFusion 4.5 days where there where
    bugs in
    ColdFusion that could cause memory leaks and eventual
    application
    instability if one did not lock shared scope reads and
    writes. This has
    long been fixed, but the advice persists.
    So now it is only a matter of your data and what would happen
    if one
    user read an old value while it was in the process of being
    updated by
    another user. Or could two users be updating the same value
    at the same
    time and cause conflict. If either of those two statements
    are true,
    then yes you should use locking as required by your
    application.
    But if they are both false and it does not matter that user A
    might get
    the old value microseconds before user B changes it. Or there
    is no
    concern with user A changing it once and user B changing it
    again to
    something different moments later without knowing the user A
    has already
    changed it. Then locking is probably unnecessary.
    There can be a cost to over locking shared variable writes
    and|or reads.
    Every time one creates a lock, one is single threading some
    portion of
    ones code. Depending on how the locking is done, this single
    threading
    may only apply to individual users or it may apply to every
    single user
    on the entire server. Either way, too much of this in the
    wrong places
    can create a significant bottle necks in ones application if
    too many
    user requests start piling up waiting for their turn through
    the locked
    block of code.

  • Unwanted Database Lock when using CAF BO method 'update'

    Hi all
    We are using the Composite Application Framework (CAF), and Business Objects (BOs) to save data on the database. A service call is using a BO ‘Update’ method as follows:
    _location.debugT("Test debug line 4");
    getBOSalesDataService().update(salesData);
    _location.debugT("Test debug line 5");
    The same method is then called by another service, while the first service is still active. It does not error, but it waits until the first service has timed out. You can see this from the following screenshot:
    I think this is because the first service sets a lock on the SQL database. This is not an explicitly coded lock, but a database lock. I’ve tried using the following statement:
    getBOSalesDataService().unlock(salesData.getKey(), IBusinessObjectNodeServiceBase.MODE_WRITE);
    It doesn’t work. I think this because the lock was not created by a ‘lock’ statement. Are there any other statements I can use to commit
    all database updates? If it was ABAP, I would use a ‘COMMIT WORK’, is there a Java / CAF equivalent?
    I have spoken to our Basis consultants, they have shown me Solution Manager where we can actually see the locks happening. Session ID 53
    is the first update, 54 is the second.
    Thanks
    Iwan

    For updates you actually need a lock to avoid inconsistencies.
    the lock should automatically be released when the JTA transaction is completed - in the case of CMP EJBs when the first service is finished...

  • Releasing locks when using "Navigate Pushbutton" in Web Interface Builder

    Hi
    I am creating a basic BPS application in Web Interface Builder for manual data entry into a Cube.
    I have a requirement for a user to navigate away from the data entry screen to a "Start Screen".  To do this, I am using the "Navigate Pushbutton" component.
    When the user navigates away from the data entry screen, I want the locks to be released.  I have attempted to do this using the "End Command" attribute of the Navigate Pushbutton to "True".  According to the Help for this attribute, the following should happen:
    " When this property has the value TRUE, the page context will be lost when you press the pushbutton (and all locks are deleted)."
    However, when I look at the locks in SM12, I can see that the locks remain, even after the user has clicked on the Navigate Button.
    Therefore, it would appear that the "End Command" attribute does not release the locks when it is set to True.
    (By the way, I have also tried setting it to false, but the same issue occurs).
    Has anyone got any advice on how I can solve this?
    (We are running BW 3.1).
    Thanks in advance for any thoughts.

    Hi,
    You are correct this is standard functionality that should work. Please post the solution proposed by SAP.
    As a stop gap you can look at this topic
    User Lock BPS Web interface
    thanks

  • XControl always locked when used in class -- possible bug?

    Hi,
    This is not dissimilar to this question. However, I think that the issue is slightly different and possibly a bug. If do the following:
    create a project,
    create an XControl,
    create a class,
    add an instance of the XControl to a class method
    you should see that the XControl is locked all of the time. This only occurs when the XControl is used with a class. If the XControl is placed on a VI, in a project library or not, the XControl will only be locked when the VI which is using it is open (i.e., in memory and the XControl is running).
    This may be expected behaviour due to the way classes are loaded; however, as a user I find it unexpected -- is it a bug?
    Regards,
    Steve.
    Solved!
    Go to Solution.

    Unlike normal libraries (.lvlib), classes always load all their member VIs into memory when the class is loaded into memory.  So if one of those VIs uses an XControl, then it will become locked as soon as you load the owning class into memory, even if the VI is not open.  You might be able to get around this by right-clicking the XControl in the project and selecting "Unlock Library for Editing".  This will temporarily break any VIs that call the XControl until you are done editing it.
    Chris M

  • We have 4 iphones in our family and an Ipad.  When we purchase music I would like for the entire family to be able to use it.  Should each of us use a different apple account or should we use the same one.

    We have 4 iphones and an Ipad in our family. When we purchase music, I would like for the entire family to be able to use it and then back it up to Icloud. What is the best and cheapest way for this to happen.  Should we all have a different apple id or should we use the same one.

    You will all need to be on the same itunes account ID.
    You can however all have seperate icloud accounts aswel.

  • When creating a new DPS should I use sizes offered by InDesign or the display size of the device?

    Hello all,
    When creating a new DPS, should I use the sizes offered by InDesign or the display size of the device?  I ran into this question when I was looking up the sizes of different devices and found that iPhone 5s, iPhone5c, and iPhone4s sizes differ than the defauly dimensions offered by InDesign. 
    Also, should I worry about the ppi resolution?  With iPhone, they all seem to be 326ppi but when dealing with other devices is this something that I should take into consideration?  Ideally, I could be creating DPS apps for all devices offered in the Digital Publishing drop down in InDesign (iPhone, iPad, Kindle Fire/Nook, and Android).
    Thank you for any help you can provide.
    By the way, if it helps I am using InDesign CC.

    Using 1024x768 and creating PDF articles will get you OK with both iPad resolutions, and, as Bob L. says, quite decent "one size fits all" result for all other devices.

  • I live in Australia, should I use PAL or NTSC settings when creating my DVD?

    I am new to creating DVDs and I am not sure what settings will give me the best quality when I burn it to DVD. I live in Australia, should I use PAL or NTSC settings? Any other hints?

    Hi
    My best Guess is - PAL
    Does Your electicity current use 50Hz or 60Hz
    Sweden 240V 50Hz - TV - 25 frames per sec = PAL
    USA 110V 60Hz - TV - 29,97 fps = NTSC
    AND
    Then it comes to HOW the Video was recorded - AS iDVD does not convert in a very good way. I use JES_Deinterlacer to do this when I need to send a DVD to USA. and it's free on Internet and even very expencive converters doesn't do it any better.
    Yours Bengt W

  • When should I use static variable and when should not? Java essential

    When should I use static variable and when should not? Java essential

    Static => same value for all instances of the class.
    Non-static => each instance can have its own value.
    Which you need in which circumstances is completely up to you.

  • Should I use screen lock with find my iPad.

    Im using a wifi only iPad, so if it is lost or stolen the finder or thief will need to be able to access my iPad and connect to a wifi signal before I can track it. I therefore think I should not use keypad lock so that I can allow them

    You don't have to use one, it's personal preference as to whether you use one or not - I use one on my iPad Mini as I prefer the feel of them compared to the glass screen, other people don't like or use them as they prefer the glass (and some screen protectors can affect the clarity of the screen). Depending upon where you will be using the iPad (e.g. if it's dusty or dirty) you may want one to give the screen a bit of extra protection.

  • What exception should I use when commit work fails ?

    hi all:
        I create a class with methods to insert , modify and delete trasaction data, 
    when commit work fails, I want to throw an exception, what exception should I use
    for this case?

    In general, you should do your commit using CALL FUNCTION IN UPDATE TASK. As this runs in a different process, you will never be able to catch an exception in your main task, even if you throw one in the Open SQL code. What you should do is carefully validate your data before posting it to the database, so that commit cannot fail for data integrity reasons. If it fails for technical reasons (DB down etc.) there is nothing that your code could do about it anyway, so in this case even getting an exception would be no use. What exactly is it you are trying to accomplish?
    -- Sebastian

  • J1INCHLN when should I use error control mode checkbox

    Hi Experts,
    I am using t-code J1INCHLN for creating remittance Challan.
    But in ECC6, EHP 5 there is new functionality added & no documentation available for same.
    There is one field with tick option called Error Control Mode.so when should i use this functionality.
    Can anyone help on this?
    Thanks and Regards,
    Sameer

    HI
    Please refer the note no :  1567443
    Manual Control in J1INCHLN to change currency key/doc type
    "After this, if you will run J1INCHLN, you will get a checkbox at the end
    with 'Error Control Mode' which will be selected by default. If you want
    to change document type, currency or rate during processing, you should
    uncheck it else it will take you to the last screen."
    I hope note is allready available in your system hence you are getting above cheeck box.
    If you want to change the document type and currency or rate during posting then you need use the check box.
    Regards
    Madhu M

  • HT1206 I buy apps in my iPhone using different Apple IDs. Which Apple ID should I use to authorize the computer when synchronizing iPhone with iTunes?

    I buy apps in my iPhone using different Apple ID. Which Apple ID should I use to authorize the computer when sync iPhone with iTunes?

    Hi again,
    After a little further research, it appears that you would need to create separate iTunes libraries in order to be able to continue to purchase and download previously purchased items on the same computer, for two different Apple IDs. Sorry - but my husband and I have had the library we sync with authorized for so long, that we have not run into this issue, but it appears that you will get an warning when you try to authorize the second ID on the same computer, indicating that another ID is already associated with it.
    So, you will probably have to set up separate iTunes libraries for each ID:
    http://www.imore.com/how-use-multiple-apple-ids-one-computer-and-itunes
    Sorry for any confusion - hope this helps!
    Cheers,
    GB

  • Please tell me the use of ranges , when it should be used

    please tell me the use of ranges , when it should be used.

    Anytime you have to equate to multiple values in your programs.  Say for example, you need to get data for two company codes from a table.
    data: it001 type table of t001.
    ranges: r_bukrs for t001-bukrs.
    r_bukrs-sign = 'I'.
    r_bukrs-option = 'EQ'.
    r_bukrs-low = '0010'.
    append r_bukrs.
    r_bukrs-sign = 'I'.
    r_bukrs-option = 'EQ'.
    r_bukrs-low = '0020'.
    append r_bukrs.
    select * into table it001 from t001 where bukrs in r_bukrs.
    Regards,
    Rich Heilman

  • Shutter locks when using the camera in AV mode.

    EOS Rebel T3i - Shutter locks when using the camera in AV mode.  It actually freezes up when in this mode...no it's not just allowing more light in through the shutter but rather locking in the open position.  How can I resolve this? Thank you.

    Does it do this in bright sunlight at the lowest f/number?
    How do you know the shutter is locked open?
    Does it do this on multiple lenses?
    How long does the phenomenon last, and how do you stop it?
    Do you end up with an image? Is it totally overexposed and motion blurred?
    Positive it is not mirror lockup?
    Scott
    Canon 6D, Canon T3i, EF 70-200mm L f/2.8 IS mk2; EF 24-105 f/4 L; EF-S 17-55mm f/2.8 IS; EF 85mm f/1.8; Sigma 35mm f/1.4 "Art"; EF 1.4x extender mk. 3; 3x Phottix Mitros+ speedlites
    Why do so many people say "fer-tographer"? Do they take "fertographs"?

  • Why or When should we use Execute Immediate in PLSQL??

    Hi Frnds,
    Long Ago i have received a interview question that ...
    How can U create a table in the PLSQL object(Function or procedure)?
    But the thing y should we use execute immediate?
    In which scenario we should we should use????????????
    Why or When should we use Execute Immediate in PLSQL????

    OR
    http://stackoverflow.com/questions/18375990/oracle-what-does-execute-immediate-means
    For DML you'd use it when running statements that you don't have available at compile time, e.g. if the column list is based on a selection from the user.
    In your case it's being used because DDL cannot be run as static SQL from within PL/SQL. Only certain query, DML and TCL commands are valid. Anything else has to be treated as dynamic.
    I'd say it's rare to need to use DDL from a PL/SQL block. TRUNCATE might be reasonable; if you find anything creating or dropping objects on the fly then that might be more of a concern as it can suggest a suboptimal data model.
    EXECUTE IMMEDIATE itself does not automatically commit; but if you execute DDL then that will behave the same as if you ran it outside PL/SQL, so it will commit in your case, yes.
    Incidentally, I'm not sure why your code is using an intermediate variable to hold the statement; that's useful if you want to display what it's going to run maybe, but you don't seem to be doing that. What you have could be done as:
    EXECUTE IMMEDIATE 'TRUNCATE TABLE BD_BIDS_EXT_DET';
    Thank you

Maybe you are looking for

  • SAP Pricing Routine For EDi1 & EDI2 Condition Types Not Triggered

    Hi All, We have implemented customer expected price functionality by incorporating EDI1 and EDI2 condition types in the pricing procedure. Also, I have copied standard routine 8 and made new routines and assigned to EDI1 and EDI2 in calculation type.

  • How can I use a 5.1 speaker system? Logitech X-540 5.1

    I am looking into buying this: http://www.amazon.co.uk/Logitech-X-540-Multimedia-Speaker-System/dp/B000LBHFMO Although, I am aware there aren't enough ports in order for it to work on my laptop. How do I go about getting these ports externally? I mea

  • F4 help for select option

    HI ALL, please help me. i need to get f4 help for zlsch field, if i give only one company code its working fine , if u give 2 company codes its not working,even though i kept s_bukrs-high code. please help me its urgent s_bukrs  FOR lfb1-bukrs  no in

  • Playlist sorting options

    I would love to be able to sort my playlists by Artists, then drill down by album so as not to clutter my Spotify. It's pretty hard to organize my playlists the current way. Any ideas on a future iteration that will enable this capability?

  • Slow record selection in tableView component with large number of records

    Hi experts, we have a Business Server Page (flow logic) with several htmlb:inputField's. As known from SAP standard we would like to offer value helper (F4) to the users for the ease of record selection. We use the onValueHelp() method of the inputFi