Food for thought : Closing I/O streams ....

hi all,
my intention is to release all the I/O streams after i have finished their use .to do it i call the .Close()
method in a finally block .
my question is : how is calling .Close() on an I/O stream different from, assigning a null to it .
i.e. :
objIOStream.Close();// in finally
objIOStream = null; // in finally
will the gc behave differently in these two cases ?
what is the logical diffrence in the two approaches ?
can i be sure that my streams would be closed/resources freed by using even the second approach ?
thanks in advance,
Ravi

It's not quite the same thing.
Closing the stream may cause it to set its internal stream to null but that doesn't mean that the outer stream becomes available for garbage collection.
For example, in the following, outerStream doesn't gets garbage collected although it does get closed. When close is called, the FileInputStream that it wraps is closed and, according to your last post, the reference to it set to null - the FileInputStream should then be eligible for garbage collection. However, my Test class still maintains a reference to the BufferedInputStream thus preventing it from being garbage collected even though it can no longer do anything useful with it.
public class Test
  private InputStream outerStream;
  public Test() throws Exception
    try
      outerStream = new BufferedInputStream(new FileInputStream("C:/blah.txt"));
    finally
      outerStream.close();
}Explicitly setting objects to null in order to get them garbage collected is usually unnecessary, however. In the example above outerStream should have been declared locally in the constructor - it will then be eligible for garbage collection when it falls out of scope.
Hope this helps.

Similar Messages

  • Accessibility for the visually Impaired - food for thought

    Experts,
    Some food for thought:
    From a technical perspective, all I can imagine of as a solution to deliver accessible applications to visually impaired users of SAP, is an orchestrated screen design and cursor flow with complete keyboard navigability and minimum or zero click sensitivity.
    Have TTS/speech driven navigation or other alternatives been introduced in SAP already? If yes, what are the steps to be performed to harness the same in a typical SAP ERP Installation. Please enlighten me.
    Also, if you think this post is in the wrong forum, please let me know.
    Thanks in advance!
    NW

    Hi,
    Pls check below link.
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/af/94c0417546cd17e10000000a155106/content.htm
    Anil

  • Logic Crashing, food for thought...

    I posted this in another thread, but thought it might be worth posting separately.
    First, keeping in mind that crashes probably happen to Logic users all around the world running different versions on different computers with varying amounts of plugs, 3rd party apps, etc., and that not every Logic user is a member of an online forum... OK, having said that...
    Based on my casual observations reading through this most recent rash of crash complaints, I noticed that many of these posters are running the latest OS, 10.4.9. And I recently had an experience in another studio where, after installing Logic on a 10.4.9 computer that Logic crashed incessently.
    Anyway. So, my food for thought: has anyone found that they're crashing more often since updating to 10.4.9?

    MBP (core duo 1.83) all updates, no problems. Just ran some of the scenarios that others are reporting - it's as stable as ever.
    The only thing I've run across lately is Logic on the MBP not picking up my config from AMS. I have a G4 MDD in my studio, and I'm setting up to be able to switch systems with 1 usb and 1 firewire cable. The midi system is rather complex (40+ ports), and I spent my time working on my laptop.... then found Logic just ignores it. Works fine on the MDD - also running 10.4.9.
    but no crashes on either system... knock on wood.
    MBP 1.83 & MDD 1G DP   Mac OS X (10.4.8)   Logic Pro 7.2.3, Motu 828MkII+828, Firebox LC&XT, Tranzport, Unitor8+(3x)AMT-8's

  • Export puzzle--food for thought.

    Hi,
    I used to use FCE 2 on Panther and made a movie and used the export feature to make a DVD. I used "Export to QuickTime Movie" and made the thing self contained.
    After lots of time and upgrades (FCEHD 3.5.1, OS X Leopard, a new hard drive, etc,) I was having trouble with playing those old timelines. The rendered part were red indicating that they needed done even though I hadn't changed anything, so I figured I would render them fresh. I deleted my render files to save some space and just did it again. No problem.
    But now some of my old QT exports won't play, saying they are looking for these old rendered files. Weird, since I thought they could stand alone. Whatever, I'll just export them again, right? Here's the twist: the new exports are way bigger than the old ones. For example, a 90 second clip was 16.6 MB on FCE2, it is now 326.9 MB on FCEHD3.5.1 Does this have something to do with the HD part in the upgrade? Why is this new stuff so big?
    Perhaps I exported the old QT files using something else and compressed it, but I doubt it since the directions clearly state to do that and let iDVD compress it for me. And the info on the files look identical otherwise (codec, dimensions, open with FCE, etc). I'm guessing its just the difference between FCE2 and FCEHD3.5.1 exports. Am I right?
    Thanks,
    Ed

    You're probably right, although I could have sworn I made them self contained. But the signs seem to point to them being referrential. I guess I was wondering if i was possible that the new versions of FCE made things bigger by virtue of being "HD" and such.
    Thanks,

  • O.T. Food For Thought

    Not something I would have thought any forum members are guilty of,but it does make you wonder how many adults of the future will know what they looked like when they were little :
    'In the U.K., the information security company Symantec commissioned a poll of 2,227 consumers that revealed 89% of them own a digital camera or cameraphone but about one-third of digicam owners don't back up their digital images. Not even with printsa large majority (70%) of digicam owners print 25% or less of their images and fully 30% said that they did not print out ANY hard copies. So, presumably many photographers are depending on their digicam memory cards or their PC's hard drive for storage, but memory cards can get lost or broken and ALL hard drives eventually fail.'

    Malcolm, Hi; I'm one that does not print much. I have a couple of external hard drives and I copy every thing on at least two sources. Most of my digital images and digital video gets put on CD, DVdisk or internet to share.
    Now that I'm getting into PSE I have been thinking about print again. When I do print I use Shutterfly or other on-line services. I have a good printer and a LCD monitor so I have been thinking about getting software to calibrate this monitor or using one of my old CRT monitors, since I have been reading about the difference in what you see on a LCD monitor and your print output. So far The prints I have made at home look good after I nudge up sliders on my printer preferences
    Some of the images I have been editing are looking good and I may not be satisfied with this method or on-line services any longer. Mickey

  • Just Food for Thought

    I think when my contract expires on 01/26/2013 that I will not renew my contract with VZW. I'll still remain with VZW, I'll pay the full-retail price for whatever glitzy device is all the rage. I figure, $800 FRP, without the threat of an ETF is well worth the peace of mind. I still pay the full price for the phone, just not upfront. 

    Verizon Bases the cost of the cell phone off of how much time your contract is, because part of the monthly bill actually goes to reimburse Verizon for the astronomical price of cell phones. Take the HTC Thunderbolt for instance with a 2 year contract they are going for $250 but the Full retail cost of the phone is about $650, if Verizon gets the guarantee from you that you will pay your bill for 2 years then they will sell you the phone at that cost because they will eventually get their money back. That is the whole reason for having contracts in the first place, So that average people can afford nice phones. Even the simplest phone in the line up like the Samsung Haven the full retail cost of that phone is like $175 and that is just a simple flip phone that doesn't Even have a camera. Who would pay that much for a phone? So in a sense you don't save any money by purchasing your phone at full retail because part of your bill will still go toward paying back a cell phone that you don't have a contract on. The only way you would save money is if you bought your phones from eBay or some 3rd party source, and then Verizon offer you an incentive and discount your plan for not purchasing phone through them. Since that isn't happening anytime soon, just sign the contract!

  • Food for thought: results differ when source compiled in JBuilder and Java

    Hi,
    I was working with JBuilder and i found that One of the JavaSource files which had a class attribute as final and was assigned somewhere later in a method, was getting compiled by JBuilder (as a member of a project), but the same class file while compiling with javac was giving compilation error.
    Also the size of the other class files on which i was working, generated by JBuilder and javac (Both are JDK 1.3) were different. How can there be a difference while compiling.
    If anybody can tell the reason.. i will be enlightened.
    Regards,
    Guru

    Your settings in JBuilder for how it compiles is probably set to compile with debugging allowed (command line -g), which will account for the size.
    As for your first problem, I can't help you. The only thing I can think of is that either JBuilder actually did not (re)compile that particular file or it's actually using a different compiler (e.g. jikes) that allows that kind of construct.

  • Food for thought

    I just checked the reconditioned Macs that Apple is selling on line and noticed most of the reconditioned fairly new Macs are selling with Snow Leopard as the operating system. Lion is only coming on computers with i5 and i7 processors. Hmmmmmmmmmmmmmmmm Very interesting!

    http://store.apple.com/us/browse/home/specialdeals/mac?mco=OTY2ODw
    I typed this because my browser wouldn't copy and paste for some reason. If it doesn't work simply go to the apple store on their web site (NOT the APP STORE, the store link on the apple web site) and look in the left lower column and you'll see a section for reconditioned Macs, iPads, iPhones, etc. I bought a reconditioned Macbook 3 years ago for $300 off new price and it works awesome to this day. In the future when looking for Mac products i'll ALWAYS buy reconditioned if what i want is available.

  • Food for thought: integrating SOAP in WLS6

    Looking at the multitude of questions regarding SOAP and WLS 6, I think
    the time has come to make some kind of HOWTO on integrating SOAP
    (especially apache's rpcrouter) in WLS 6.
    Like many others, I also have a strong need to make my EJB's available
    through SOAP in the very near future. My customers directly call EJB's.
    When they make Java apps, that's fairly straightforward and fast, but I
    also have clients requiring specific languages and runtime environments.
    What would I do when I want to make my EJB's directly available through
    SOAP?
    My guess is to:
    - install rpcrouter as a normal servlet in WLS;
    - write thin wrapper over the EJB's ("Provider Classes" in apache's
    rpcrouter admin);
    - define DeploymentDescriptors for these EJB-wrappers.
    The above is managable, but what about argument and return-type classes?
    These are all home-brewed and fairly complex (extending many classes and
    implemented many interfaces).
    The client at the other side needs class declarations and
    implementations if it is ever to pass one as an argument to a SOAP
    function call.
    In case of a Java client, I might give it these classes at forehand. In
    case of, say, a C-sharp app, this ain't an option.
    Another, even more fundamental problem is that of the interface -
    implementation abstraction: my EJB return-types and arguments are all
    interfaces. So the clients automatically use RMI to obtain an
    implementation at runtime. What about SOAP here? How do SOAP clients
    obtain implementations of these classes?
    Is there anyone (that includes you BEA) who can tell me more on this and
    even get me a working SOAP interface for my EJB's?
    Thanks in advance,
    Erik van Zijst

    I've seen that page. But it doesn't go deeper than the examples from
    apache and MS which I already ran.
    I can easily send strings and primitive datatypes to and from different
    languages. My trouble is with complex classes.
    Consider it the other way round: you are writing a Java app that needs
    to do rpc with a C# application. The return types of the remote methods
    are all complex classes. So you'll have to create stubs for them I
    guess. How do you do that?
    Erik
    Jane wrote:
    Check out the Developer Center...
    http://developer.bea.com/circuit/xml.html
    Jane
    Erik van Zijst <[email protected]> wrote:
    Looking at the multitude of questions regarding SOAP and WLS 6, I think
    the time has come to make some kind of HOWTO on integrating SOAP
    (especially apache's rpcrouter) in WLS 6.
    Like many others, I also have a strong need to make my EJB's available
    through SOAP in the very near future. My customers directly call EJB's.
    When they make Java apps, that's fairly straightforward and fast, but I
    also have clients requiring specific languages and runtime environments.
    What would I do when I want to make my EJB's directly available through
    SOAP?
    My guess is to:
    - install rpcrouter as a normal servlet in WLS;
    - write thin wrapper over the EJB's ("Provider Classes" in apache's
    rpcrouter admin);
    - define DeploymentDescriptors for these EJB-wrappers.
    The above is managable, but what about argument and return-type classes?
    These are all home-brewed and fairly complex (extending many classes and
    implemented many interfaces).
    The client at the other side needs class declarations and
    implementations if it is ever to pass one as an argument to a SOAP
    function call.
    In case of a Java client, I might give it these classes at forehand. In
    case of, say, a C-sharp app, this ain't an option.
    Another, even more fundamental problem is that of the interface -
    implementation abstraction: my EJB return-types and arguments are all
    interfaces. So the clients automatically use RMI to obtain an
    implementation at runtime. What about SOAP here? How do SOAP clients
    obtain implementations of these classes?
    Is there anyone (that includes you BEA) who can tell me more on this and
    even get me a working SOAP interface for my EJB's?
    Thanks in advance,
    Erik van Zijst

  • A confusing piece of code, may be food for thought.

    Looking at the following code it seems very obvious to me that the output should be 1010 but it turns out to be 2020. Could anybody explain the reason behind it?
    public class TestClass
      public static void main(String args[ ] )
        TestClass tt = new TestClass();
        tt.ww();
      public void ww()
        Base b = new Base();
        Base b2 = new Base();
        b.iAge = 10;
        b2.iAge = 20;
        System.out.print(b.iAge);
        Integer iw = new Integer(b.iAge);
        col(iw);
      public static void col(Object o)
        Integer iw = (Integer) o;
        System.out.print(iw.intValue());
    class Base
      public static int iAge;
    }

    Considering that the iAge member is 'static' (only one copy no matter how many instances of the object), and that you last set it to 20 before you output anything, what's to wonder about?

  • Socket Exception when closing Server Socket Streams if Client closes first

    Hi
    I have 2 processes - a Server socket and a client socket. If I close the Client process first, and then try closing down the Streams on the Server process, I get a SocketException with message "Socket is closed" when I try and close the 2nd Stream. It does not matter on the order of the Stream being closed down, the exception is always thrown when I try and close the second stream. The code snippets are below:
    SERVER =======
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ServerSocketTest {
    public static void main(String args[]) {
    try {
    ServerSocket ss = new ServerSocket(9999);
    Socket s = ss.accept();
    // Get refs to streams...
    InputStream is = s.getInputStream();
    OutputStream os = s.getOutputStream();
    // sleep to let client shutdown first...
    try {
    Thread.sleep(10000);
    } catch (InterruptedException e) {
    System.err.println(e);
    System.err.println("B4 inClose: isBound=" + s.isBound());
    System.err.println("B4 inClose: isClosed=" + s.isClosed());
    System.err.println("B4 inClose: isConnected=" + s.isConnected());
    System.err.println("B4 inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("B4 inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getInputStream().close();
    System.err.println("After inClose: isBound=" + s.isBound());
    System.err.println("After inClose: isClosed=" + s.isClosed());
    System.err.println("After inClose: isConnected=" + s.isConnected());
    System.err.println("After inClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After inClose: isOutputShutdown=" + s.isOutputShutdown());
    s.getOutputStream().close(); // will break here with SocketException!
    System.err.println("After outClose: isBound=" + s.isBound());
    System.err.println("After outClose: isClosed=" + s.isClosed());
    System.err.println("After outClose: isConnected=" + s.isConnected());
    System.err.println("After outClose: isInputShutdown=" + s.isInputShutdown());
    System.err.println("After outClose: isOutputShutdown=" + s.isOutputShutdown());
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    CLIENT ======
    import java.net.Socket;
    public class ClientSocket {
    public static void main(String args[]) {
    try {
    Socket s = new Socket("localhost", 9999);
    try {
    // sleep to leave connection up for a while...
    Thread.sleep(2000);
    } catch (InterruptedException e) {
    System.err.println(e);
    s.close();
    } catch (Exception e) {
    System.err.println(e);
    The debug shows that isClosed() is set to 'true' after the first call to s.getInputStream().close(). The Sun API Socket class getOutputStream() has a call to isClosed() at the start of the method - it then throws the SocketException that I get. Why does the SocketImpl do this before I get a chance to call a.getOutputStream().close()?
    One final thing, the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called.
    Any ideas/help here greatly appreciated.
    Thanks
    Gaz

    Ok, I know what's going on now - I needed something to do on Friday afternoon anyhow!
    Basically if you call either getOutputStream.close() or getInputStream().close(), the underlying Sun implementation will close the Socket.
    Here's what's happening under the covers in the Sun code:
    s.getInputStream() is called on the Socket class.
    The Socket class holds a reference to the SocketImpl class.
    The SocketImpl class is abstract and forces sublclasses to extend it' s getInputStream() method.
    The PlainSocketImpl extends SocketImpl.
    PlainSocketImpl has a getInputStream() method that returns a SocketInputStream. When the stream is created for the first time, the PlainSocketImpl object is passed into the Constructor.
    The SocketInputStream class has a close() method on it. The snippet of code below shows how the socket is closed:
    <pre>
    * Closes the stream.
    private boolean closing = false;
    public void close() throws IOException {
         // Prevent recursion. See BugId 4484411
         if (closing)
         return;
         closing = true;
         if (socket != null) {
         if (!socket.isClosed())
              socket.close();
         } else
         impl.close();
         closing = false;
    </pre>
    So, it seems that out PlainSocketImpl is getting closed for us, hence the SocketException being thrown in Socket.getOutputStream() when I call it after Socket.getInputStream()/
    I've not had a look at the reason why the calls to s.isInputShutdown() and s.isOuputShutdown always seem to return false even if the Streams have had their .close() method called though - any thoughts appreciated.
    Thanks
    G

  • Authorization for opening & Closing posting periods - OB52

    Hi,
    Is there any way to set authorization for opening & closing of posting periods in OB52?
    My scenario:
    I have 2 company codes - A & B assigned to 2 different posting period variant - say PPA & PPB.
    The user belonging to CoCd A should not be able to open/close posting period of CoCd B and vice versa.
    Is this possible through any authorization settings?
    Request your help on this.
    Regards,
    Sridevi

    Hi Sridevi
    Please go through the following:
    You can assign authorization groups for permitted posting periods. This means that, for example, some posting periods can only be opened for particular users within monthly or annual closing. You can only assign the authorization group at document header level and it only affects period 1. The authorization object is called F_BKPF_BUP (Accounting document: Authorizations for posting periods). Read the corresponding chapter on "User maintenance" in the "Assigning authorizations" topic.
    "User maintenance"
    Due to the modular authorization concept of the system, you can define authorization profiles which are tailored to the workplace of your employees. You can, for example, assign authorization to a workplace in the Accounts Receivable, Accounts Payable or General Ledger Accounting areas.
    By assigning authorizations you define which business-related objects your employees are allowed to process and which editing functions are allowed.
    In the following activities for authorization management, you must carry out the following for employees who are to work with the system:
    Assign authorizations
    The authorizations are assigned by specifying permitted values for the pre-defined objects.
    Define profiles
    In the SAP system, authorizations are grouped together in workplace profiles. Therefore one or more profiles must be allocated to the individual employee in the master record.
    I hope this helps.
    Regards
    Kavitha

  • Issue: Detected use of SPRequest for previously closed SPWeb object

    I have a solution to create web site by a custom web template. I used ULS Viewer to monitor the sharepoint error log during the process. I see some unexpected error(Detected use of SPRequest for previously closed SPWeb object.  Please close SPWeb
    objects when you are done with all objects obtained from them, but not before.)
    I believe that It will bring up a memory leak issue in anytime future. so I spend some time to find the root cause. It has no unexpected issue by creating web site with out of the box template(BLOG,WIKI, etc). I will get only get it with custom
    template. Does anyone know the reason and soltuon for this issue? Thanks.

            protected void Button2_Click(object sender, EventArgs e)
                string Client = "Client";
                string creatorId = "UserId";
                string creatorname = "Robin Hung";
                string rreatorEmail = "[email protected]";
                SPSecurity.RunWithElevatedPrivileges(delegate()
    using (
    SPSite newSite =
    new SPSite("http://localhost/sites/" + Client))
    SPWebTemplateCollection WTC =
    newSite.GetWebTemplates(1033);
    SPWebTemplate webTemplate =
    newSite.GetWebTemplates(1033)["SubSite"];
    newSite.AllowUnsafeUpdates = true;
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity.
    Verbose,
    EventSeverity.
    Verbose),
    TraceSeverity.Verbose,
    "Test 2", "Called");
    using (SPWeb spWeb = newSite.OpenWeb())
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity
    .Verbose,
    EventSeverity
    .Verbose),
    TraceSeverity.
    Verbose,
    "Test 21",
    "Called");
    spWeb.AllowUnsafeUpdates = true;
    spWeb.Webs.Add("Robin4", "Robin2", "test", 1033,
    webTemplate, false, false);
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity
    .Verbose,
    EventSeverity
    .Verbose),
    TraceSeverity.
    Verbose,
    "Test 211",
    "Called");
    spWeb.Webs.Add("Robin5", "Robin2", "test", 1033,
    WTC["SubSite"], false, false);
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity
    .Verbose,
    EventSeverity
    .Verbose),
    TraceSeverity.
    Verbose,
    "Test 212",
    "Called");
    spWeb.Webs.Add("Robin6", "Robin2", "test", 1033,
    WTC[30], false, false);
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity
    .Verbose,
    EventSeverity
    .Verbose),
    TraceSeverity.
    Verbose,
    "Test 213",
    "Called");
    spWeb.AllowUnsafeUpdates = false;
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity
    .Verbose,
    EventSeverity
    .Verbose),
    TraceSeverity.
    Verbose,
    "Test 22",
    "Called");
    newSite.AllowUnsafeUpdates = false;
    //currentSite.AllowUnsafeUpdates = false;
    SPDiagnosticsService.Local.WriteTrace(0,
    new SPDiagnosticsCategory
    ("Log",
    TraceSeverity.
    Verbose,
    EventSeverity.
    Verbose),
    TraceSeverity.Verbose,
    "Test 4", "Called");

  • FAST FOOD FOR EDITING

    when i get into working on stuff I really hate stopping and doing other things ...unless I'm waiting for some process to get done ( eg. export etc ).
    So when I am on computer working I get sucked into it and dont like to stop even to eat etc.
    I have discovered that fast food is the answer.
    even better...get on phone and order food delivered !
    but other than that I've discovered you can enhance frozen food TV dinner things or soups...pretty quick and is really good...
    1) get stouffers (sp?) fetticinii alfredo...nuke...( 2 min ? ) and add can of tuna ( mix it in..) yum...instant tuna casserole !
    2) get progressive new engl clam chowder.. heat up... add can of chopped or minced clams...heat a min longer....way better !
    ( add red pepper or whatever ).
    whats YOUR secret editing fast food solutions ???

    darnit.. i was writing email to my state senator and missed the crab story.. what happened ? can we eat them ?
    yum... i ate some crab cakes for breakfast this morning... from icelandic or something like that... microwave on high for 2 minutes covered... the perfect fast food for editing...add cocktail sauce.
    cock and tail .... sauce... appeals to most people on a subliminal level .... IMO...
    for me its the tail part.. but hey, friday is gay day in the film biz ...( IMO ) and mayor bloomberg tends to prove it 7 days a week !
    no offense.. my best friend is gay
    just kidding but it could be true
    how would i know anyway? maybe i havent met the right wife yet.. 3 down but there are many fishes in the sea.... any chics feeling adventurous out there ??
    edit... true story :
    I was working on set of some stupid tv cop show ( i think it was law and order at chelsea piers but forget ) and sitting at a big 'conference table' with other crew members during a take. after the take we had to move to the room we were sitting in to shoot, and to do that we had to lower some bay lights etc which were above the big table .. so the room had to be cleared of people to do that ( dont wanna drop stuff on people etc ).
    Soooo, the subject of this " new " movie ( brokeback mountain ) got brought up by some *** hags sitting at the table... chics who love gay guys in general for the spirit of the thing.. ( this is hollywood so theres no figuring out why this is true ) .. and one asked ME if I was gonna go watch the movie. Like go to a theater and watch this new movie.  This is starring the guy who killed himself like a week ago.... and everyone was sorta talking about this great new movie and the dead guy.
    Being a grip etc.. and pretty old ... I looked at this young woman and there musta been something in my countenance that sobered her up or something...cause she looked away and giggled and changed the subject and then got out of the room when I said, " We're gonna lower the bay light, get out of the room ".
    I never saw her again. The dead guy is still dead. The gay movie about cowboys is still a blockbuster. Life goes on , eh ?

  • DI-Error: You cannot select batch or serial numbers for a closed row

    Hello Experts,
    I have several B1-Systems connected to R/3-Systems via B1iSN.
    In B1 for example I have 2 rows in Purchase Order. One row was closed by a goods receipt - 1 row is still open.
    From our R/3-System we send Order-Acknowledgements to B1. Because line 1 is already closed we want to ignore row 1 and update only information in row 2. By using KeyExpansion I could solve that requirement (check in B1-System if row is already closed -> insert row in IDoc only with LineNum). For example:
    <Document_Lines>
      *<row>* <!-- ignore -->
        *<LineNum>0</LineNum>*
      *</row>*
       <row> <!-- update -->
        <LineNum>1</LineNum>
        <ItemCode>ABCDEFGHIJK</ItemCode>
      </row>
    </Document_Lines>
    Unfortunately DI-API does not allow to update each row separated. I always have to send all rows in IDoc even if one row is closed.
    For one B1-Company batchnumbers on every transaction is required. When creating Goods Receipt we have to define a batchnumber for item. But now if I want to update a open row (as described above) I get an B1iSN-Error:
    DI Error: (-10) You cannot select batch or serial numbers for a closed row
    Any ideas to solve that Error? Thanks.
    Regards,
    GB

    Hi Bastian,
    I have still one open question. How to tread Document Lines Additional Expenses?
    If I use the logic of visual order I still get the error "You cannot select batch or serial numbers for a closed row".
    Example:
    <Document_LinesAdditionalExpenses> 
    -      <row>
               <LineNumber>4</LineNumber>*no expenses*
    </row>
    -      <row>
               <LineNumber>0</LineNumber>*no expenses*
    </row>
    -     <row>
               <LineNumber>1</LineNumber>*no expenses*
    </row>
    -     <row>
               <LineNumber>2</LineNumber>*no expenses*
    </row>
    -     <row>
               <LineNumber>3</LineNumber>*expenses correct*
               <ExpenseCode>3</ExpenseCode>
               <LineTotal>10.00</LineTotal>
    </row>
    </Document_LinesAdditionalExpenses> 
    How can I solve that?
    Thanks and regards,
    GB

Maybe you are looking for