Advice on how to implement

Hi All,
I have to support an existing customization and need to make the following change but do not know how to proceed. Any suggestions/advice would be welcome.
The customization inserts invoices at header and line level. One screen allows you to enter the header information and the next the line information.
At the header level you can enter a sales person who has a gl code against them, and this is reflected at line level. So the sales person is stored at header level and the gl code at line level segment2. So when creating a new invoice and moving from header to line level the gl code is already populated.
However there is a function to copy an existing invoice (both header and line). So you can copy an existing invoice and change the salesperson at header level but the gl code at line level does not change to correspond with the new salesperson.
At first I thought it should be a simple case of comparing whats is in the headerVo (gl code for the sales person) with the gl code held at the line VO and the setting the correct attribute at line level, but the lineVo's don't seem to exist at this point (I get a null pointer exception).
Does anyone have any thoughts or ideas about what I could here? Many Thanks for any help

I could understand that you want to get salesperon name from header and polpulate appropriate gl_code at line level.
I m sure header nd line VO will be in same AM, so why you are not able to get handle of VO.
Please check about this page properly and paste here the code which you are using..
--Parag N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to implement Security Domains with Delegated Management

    Hello,
    I have read the GlobalPlatform docs and 'scoured' the Internet for some useful advice on how to implement DM with Java Card.
    The GlobalPlatform docs say that "The interface between a SD and the Card Manager is not defined by Open Platform" and that "It is assumed that a SD cannot be developed in the same manner as a normal app". How then is someone supposed to be able to implement a system that includes Java Card applets and post-issuance uploading of applets using DM?
    I have purchased the Aspects Developer IDE with DM supported Java Card smart cards but am at a loss of how to actually implement the SD applets with DM....I know this technology is not supposed to be easy , but it should be possible to research and find the information that is required to learn it.
    Can anyone point me in the direction of somewhere that will provide me with some direction?
    Thanks in advance,
    Ann

    Hi Kavitha,
    check this link http://andrejusb.blogspot.in/2011/04/housekeeping-for-adf-security-test-all.html
    http://www.orastudy.com/oradoc/selfstu/fusion/web.1111/b31974/adding_security.htm
    Edited by: MaDi on Jun 11, 2012 3:46 PM

  • How to implement a logout

    I have a basic jsp application with a form-based authentication[which is working well].
    I would like advice on how to implement a logout mechanism from the application.
    I would also like help on how to retrieve the user ID of the user so that i display it on the screen.
    ochomo

    Call HttpSession#invalidate() to invalidate the session.
    The remote user is available by HttpServletRequest#getRemoteUser() and its principal by HttpServletRequest#getUserPrincipal() by the way.

  • How to implement a simple node-edge graph?

    Can any one give me some advice on how to implement a simple node-edge graph in a frame? Every node is a rectangle which can be moved by mouse, and every edge is a arc between two nodes.
    Should the node class extend JPanel, and the edge class extend Graphics? and so on?

    It is impossible to generate similar update from OWB.
    Does your table1 contain primary key columns? What is the number of rows in this table?
    The only working solution in this case - use table1 twice in mapping - as source and as target (with UPDATE operation),
    link these operators with primary key columns and specify matching by PK columns.
    Updated column link to Constant operator attribute.
    In this case OWB generate SQL like
    merge table1 a
    using table1 b
    on (a.pk_column=b.pk_column)
    when matched then update set column1=1
    Regards,
    Oleg

  • I believe that i have malware on my mac, osx 10.9.4. accordingly, i've tried to run clamxav (on my mac HD) but just get a spinning wheel, then have to shut down. any advice on how to stop spinning wheel or get rid of malware? please help. :-).

    i believe that i have malware (possible highjack of safari browser) on my mac, osx 10.9.4. accordingly, i've tried to run clamxav (on my mac HD) but just get a spinning wheel, then have to shut down. any advice on how to stop spinning wheel or get rid of malware? i have symnatic endpoint and, after scanning, it reveals nothing. please help. :-).

    are locked user files or that have incorrect permission a bad thing?
    Yes.
    why am i removing symantec?
    Short answer: Because it's worse than useless and worse than the imaginary "viruses" you're afraid of would be if they really existed. For the long answer, see below.
    1. This is a comment on what you should—and should not—do to protect yourself from malicious software ("malware") that circulates on the Internet and gets onto a computer as an unintended consequence of the user's actions. It does not apply to software, such as keystroke loggers, that may be installed deliberately by an intruder who has hands-on access to the computer, or who has been able to log in to it remotely. That threat is in a different category, and there's no easy way to defend against it.
    The comment is long because the issue is complex. The key points are in sections 5, 6, and 10.
    OS X now implements three layers of built-in protection specifically against malware, not counting runtime protections such as execute disable, sandboxing, system library randomization, and address space layout randomization that may also guard against other kinds of exploits.
    2. All versions of OS X since 10.6.7 have been able to detect known Mac malware in downloaded files, and to block insecure web plugins. This feature is transparent to the user. Internally Apple calls it "XProtect."
    The malware recognition database used by XProtect is automatically updated; however, you shouldn't rely on it, because the attackers are always at least a day ahead of the defenders.
    The following caveats apply to XProtect:
    ☞ It can be bypassed by some third-party networking software, such as BitTorrent clients and Java applets.
    ☞ It only applies to software downloaded from the network. Software installed from a CD or other media is not checked.
    As new versions of OS X are released, it's not clear whether Apple will indefinitely continue to maintain the XProtect database of older versions such as 10.6. The security of obsolete system versions may eventually be degraded. Security updates to the code of obsolete systems will stop being released at some point, and that may leave them open to other kinds of attack besides malware.
    3. Starting with OS X 10.7.5, there has been a second layer of built-in malware protection, designated "Gatekeeper" by Apple. By default, applications and Installer packages downloaded from the network will only run if they're digitally signed by a developer with a certificate issued by Apple. Software certified in this way hasn't necessarily been tested by Apple, but you can be reasonably sure that it hasn't been modified by anyone other than the developer. His identity is known to Apple, so he could be held legally responsible if he distributed malware. That may not mean much if the developer lives in a country with a weak legal system (see below.)
    Gatekeeper doesn't depend on a database of known malware. It has, however, the same limitations as XProtect, and in addition the following:
    ☞ It can easily be disabled or overridden by the user.
    ☞ A malware attacker could get control of a code-signing certificate under false pretenses, or could simply ignore the consequences of distributing codesigned malware.
    ☞ An App Store developer could find a way to bypass Apple's oversight, or the oversight could fail due to human error.
    Apple has so far failed to revoke the codesigning certificates of some known abusers, thereby diluting the value of Gatekeeper and the Developer ID program. These failures don't involve App Store products, however.
    For the reasons given, App Store products, and—to a lesser extent—other applications recognized by Gatekeeper as signed, are safer than others, but they can't be considered absolutely safe. "Sandboxed" applications may prompt for access to private data, such as your contacts, or for access to the network. Think before granting that access. Sandbox security is based on user input. Never click through any request for authorization without thinking.
    4. Starting with OS X 10.8.3, a third layer of protection has been added: a "Malware Removal Tool" (MRT). MRT runs automatically in the background when you update the OS. It checks for, and removes, malware that may have evaded the other protections via a Java exploit (see below.) MRT also runs when you install or update the Apple-supplied Java runtime (but not the Oracle runtime.) Like XProtect, MRT is effective against known threats, but not against unknown ones. It notifies you if it finds malware, but otherwise there's no user interface to MRT.
    5. The built-in security features of OS X reduce the risk of malware attack, but they are not, and never will be, complete protection. Malware is a problem of human behavior, and a technological fix is not going to solve it. Trusting software to protect you will only make you more vulnerable.
    The best defense is always going to be your own intelligence. With the possible exception of Java exploits, all known malware circulating on the Internet that affects a fully-updated installation of OS X 10.6 or later takes the form of so-called "Trojan horses," which can only have an effect if the victim is duped into running them. The threat therefore amounts to a battle of wits between you and the scam artists. If you're smarter than they think you are, you'll win. That means, in practice, that you always stay within a safe harbor of computing practices. How do you know when you're leaving the safe harbor? Below are some warning signs of danger.
    Software from an untrustworthy source
    ☞ Software of any kind is distributed via BitTorrent, or Usenet, or on a website that also distributes pirated music or movies.
    ☞ Software with a corporate brand, such as Adobe Flash Player, doesn't come directly from the developer’s website. Do not trust an alert from any website to update Flash, or your browser, or any other software.
    ☞ Rogue websites such as Softonic and CNET Download distribute free applications that have been packaged in a superfluous "installer."
    ☞ The software is advertised by means of spam or intrusive web ads. Any ad, on any site, that includes a direct link to a download should be ignored.
    Software that is plainly illegal or does something illegal
    ☞ High-priced commercial software such as Photoshop is "cracked" or "free."
    ☞ An application helps you to infringe copyright, for instance by circumventing the copy protection on commercial software, or saving streamed media for reuse without permission.
    Conditional or unsolicited offers from strangers
    ☞ A telephone caller or a web page tells you that you have a “virus” and offers to help you remove it. (Some reputable websites did legitimately warn visitors who were infected with the "DNSChanger" malware. That exception to this rule no longer applies.)
    ☞ A web site offers free content such as video or music, but to use it you must install a “codec,” “plug-in,” "player," "downloader," "extractor," or “certificate” that comes from that same site, or an unknown one.
    ☞ You win a prize in a contest you never entered.
    ☞ Someone on a message board such as this one is eager to help you, but only if you download an application of his choosing.
    ☞ A "FREE WI-FI !!!" network advertises itself in a public place such as an airport, but is not provided by the management.
    ☞ Anything online that you would expect to pay for is "free."
    Unexpected events
    ☞ A file is downloaded automatically when you visit a web page, with no other action on your part. Delete any such file without opening it.
    ☞ You open what you think is a document and get an alert that it's "an application downloaded from the Internet." Click Cancel and delete the file. Even if you don't get the alert, you should still delete any file that isn't what you expected it to be.
    ☞ An application does something you don't expect, such as asking for permission to access your contacts, your location, or the Internet for no obvious reason.
    ☞ Software is attached to email that you didn't request, even if it comes (or seems to come) from someone you trust.
    I don't say that leaving the safe harbor just once will necessarily result in disaster, but making a habit of it will weaken your defenses against malware attack. Any of the above scenarios should, at the very least, make you uncomfortable.
    6. Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was always a bad idea, and Java's developers have proven themselves incapable of implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style virus affecting OS X. Merely loading a page with malicious Java content could be harmful.
    Fortunately, client-side Java on the Web is obsolete and mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice. Forget about playing games or other non-essential uses of Java.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it—not JavaScript—in your browsers.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a task on a specific site, enable Java only for that site in Safari. Never enable Java for a public website that carries third-party advertising. Use it only on well-known, login-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.
    Stay within the safe harbor, and you’ll be as safe from malware as you can practically be. The rest of this comment concerns what you should not do to protect yourself.
    7. Never install any commercial "anti-virus" (AV) or "Internet security" products for the Mac, as they are all worse than useless. If you need to be able to detect Windows malware in your files, use one of the free security apps in the Mac App Store—nothing else.
    Why shouldn't you use commercial AV products?
    ☞ To recognize malware, the software depends on a database of known threats, which is always at least a day out of date. This technique is a proven failure, as a major AV software vendor has admitted. Most attacks are "zero-day"—that is, previously unknown. Recognition-based AV does not defend against such attacks, and the enterprise IT industry is coming to the realization that traditional AV software is worthless.
    ☞ Its design is predicated on the nonexistent threat that malware may be injected at any time, anywhere in the file system. Malware is downloaded from the network; it doesn't materialize from nowhere. In order to meet that nonexistent threat, commercial AV software modifies or duplicates low-level functions of the operating system, which is a waste of resources and a common cause of instability, bugs, and poor performance.
    ☞ By modifying the operating system, the software may also create weaknesses that could be exploited by malware attackers.
    ☞ Most importantly, a false sense of security is dangerous.
    8. An AV product from the App Store, such as "ClamXav," has the same drawback as the commercial suites of being always out of date, but it does not inject low-level code into the operating system. That doesn't mean it's entirely harmless. It may report email messages that have "phishing" links in the body, or Windows malware in attachments, as infected files, and offer to delete or move them. Doing so will corrupt the Mail database. The messages should be deleted from within the Mail application.
    An AV app is not needed, and cannot be relied upon, for protection against OS X malware. It's useful, if at all, only for detecting Windows malware, and even for that use it's not really effective, because new Windows malware is emerging much faster than OS X malware.
    Windows malware can't harm you directly (unless, of course, you use Windows.) Just don't pass it on to anyone else. A malicious attachment in email is usually easy to recognize by the name alone. An actual example:
    London Terror Moovie.avi [124 spaces] Checked By Norton Antivirus.exe
    You don't need software to tell you that's a Windows trojan. Software may be able to tell you which trojan it is, but who cares? In practice, there's no reason to use recognition software unless an organizational policy requires it. Windows malware is so widespread that you should assume it's in everyemail attachment until proven otherwise. Nevertheless, ClamXav or a similar product from the App Store may serve a purpose if it satisfies an ill-informed network administrator who says you must run some kind of AV application. It's free and it won't handicap the system.
    The ClamXav developer won't try to "upsell" you to a paid version of the product. Other developers may do that. Don't be upsold. For one thing, you should not pay to protect Windows users from the consequences of their choice of computing platform. For another, a paid upgrade from a free app will probably have all the disadvantages mentioned in section 7.
    9. It seems to be a common belief that the built-in Application Firewall acts as a barrier to infection, or prevents malware from functioning. It does neither. It blocks inbound connections to certain network services you're running, such as file sharing. It's disabled by default and you should leave it that way if you're behind a router on a private home or office network. Activate it only when you're on an untrusted network, for instance a public Wi-Fi hotspot, where you don't want to provide services. Disable any services you don't use in the Sharing preference pane. All are disabled by default.
    10. As a Mac user, you don't have to live in fear that your computer may be infected every time you install software, read email, or visit a web page. But neither can you assume that you will always be safe from exploitation, no matter what you do. Navigating the Internet is like walking the streets of a big city. It's as safe or as dangerous as you choose to make it. The greatest harm done by security software is precisely its selling point: it makes people feel safe. They may then feel safe enough to take risks from which the software doesn't protect them. Nothing can lessen the need for safe computing practices.

  • How to implement User Exit in APO?

    Hello All,
    I am not sure how to use user exits. I was wondering if anyone can help me understand how to implement any user exit? Is there any T.Code where you do that? or ABAP coding is required? Also how different is BAdi from User exits?
    Any advice is welcome.
    Thanks,
    Sanju

    Hi Sanju,
        Check this link.
    http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
    BADI or user exit, I don't think it is a choice between the two. Both serve the same purpose, add some custom logic to the standard logic. It depends on your requirement, the point when the user exit or BADI is called, information that is available to you in that user exit/BADI and information that you can change in that user exit/BADI. There is no difference in implementing the User Exit in APO or R/3.
    Regards,
    Siva.

  • Frustrated. Need Advice on SAP Security Implementation!!!

    I'm very frustrated with my latest project and I would really appreciate your feedback.
    I recently joined a company that's implementing SAP. They are already in the realization phase and will soon enter the final preparation stage. I was brought in to implement SAP Security. I was provided with a  compiled list of roles and tcodes based on the blueprints from the teams and this was my starting point.
    I wanted to do a presentation with the teams so that we all know what my expectations/requirements are from them and vice versa. In preparation for this, I gathered their processes from their blueprints. I wanted them to break each processes into detailed activities/tasks/functions. From there, they can identify the tcodes and then the roles. I also wanted to do this approach because the company is following SOX regulations. I showed this to my team lead and the PM and the PM adviced me not to go with this strategy because there would be too much work involved. I wanted this approach because I also wanted to do the SOD but I was told not to do it because it would only confused them. He just wanted to work on polishing the list of roles and tcodes.
    Some teams leads are all experienced people while other teams are not because they are working with an employee from the company. Kinda like a partnership, 1 is a consultant while the other is a team lead from the company. Which I believe is normal practice so that there is knowledge transfer.
    So I had my presentation and I found out that most of the team leads have not seen this compilation of roles and tcodes. I also found out that even though they are already in the realization stage, majority of the teams have no idea what roles to give nor do they know who to give it to. I also asked for the org chart from the HR team but I was told that they still don't have it and cannot give it to me. They even asked me why I need it. They also informed me that HR structural authorizations are not going to be implemented and yet nobody can give me a damn good reason why. All they tell me is that because they don't need it.
    So as you can see, I'm not getting the cooperation/support I need to be able to do my job properly. How can I when every strategy I wanted to do is being turned down? What should I do? Really need your advice on how to proceed. Your inputs are highly appreciated.
    Thanks in advance!

    Julius, Auke and Alex,
    Im sure everyone would agree that the advice you guys offer is more than valuable. Thank you for that.
    I myself have been encountering the same situation that Litz is facing except for that in my case the Management is very co-operative (and trust me, this helps a lot). My problem is that neither me nor my Management know what access  needs to be given to Consultants or IT Staff after GoLive or even now.The Functional Consultants "don't have the time" to tell me what Tcodes they need access to, and they insist that they should have sap_all, and I have no idea what access they SHOULD have.
    I was going to post another thread for my questions but I guess there are already too many which address the same issue. These threads did give me a good insight on how SAP Security should be managed, and I was able to get some of it chalked out. I have a few questions though, which I wasn't too sure about even after reading through the countless threads.
    Most consultants in my company had sap_all in QA since no one knew what they should be have and often had we noticed that they would be playing with the Basis Tcodes. Now knowing what they have been doing in QA, I do not want to give them sap_all in Prod (although they insisted) at any cost. So, I made a role (z:sap_all), copied sap_all, disabled Basis Tcodes and assigned it to them. Then I kept adding Tcodes one by one on request basis.
    We haven't gone Live (they say that we are still in testing phase since the final cutover is due in the next few weeks) yet and I know that this cannot work after Go-Live since z:sap_all has Tcodes like SE38, AL11, SM50 etc in Prod. They say that they need these to do processing and it is okay to give it to them since we haven't gone live. I would also like to mention that my company is trying to get SOX compliant and needs these things in place.
    I have been entrusted a BIG responsiblity and am trying my best to live up to the expectations and I am relying yon you guys to help me out.All the Business Roles are in place, and its just the IT roles that I'm worried about.
    So, my questions are
    1. Until how long is it okay for Functional Consultants to have this kind of access in Prod ?
    2. After we Go-Live, would a display only role for all functional Tcodes suffice for them ? Or should they have Basis Tcodes too ? If yes, which ones (Im asking this because I know that it should be minimal)
    3. I have been to told to create an "IT-Support role" by the Manager of the Implementation Partner for after GoLive. But he has no idea what T-codes it should have or what it does. Any ideas on this ?
    4. I have read about the "firefighting role". Im guessing that the IT Support Role is the same as this. But what exactly does the firefighting role have? And in what situations is it assigned?
    5. How important is the period before the final Cutover important as far as SOX compliance goes?
    A little enlightenment on the common issues encountered after Go Live would also help me assess the situation a lot better.
    I hope Im not asking too much of your time here. Thank you again guys !! Appreciate it !
    Kunal

  • Advice for editor gutter implementation...

    Hello Java Gurus!
    I am writing to you to seek advice regarding how one best could implement the gutter in a
    textual editor. A gutter is a section, often to the left of the editing area, where line numbers
    and different markers can be added to improve the interaction with the editor.
    Just to play around and see how it would look like, I put a JPanel inside a scolled pane
    and added two text areas to the JPanel. Using a border layout the gutter is placed to the west
    and the editing area in the center. This quit test just showed me that this is what I am aiming
    for, but it needs to be implemented with some intelligence. If the gutter is a text area and
    the line numbers are printed out, the solution becomes quite slow for files that contain more
    than about a thosand lines.
    Both for looks and performance issues, what do you people feel would be the best solution
    to implement the gutter? Am I correct in asuming that drawing the line numbers would be a
    better solution? Anybody here who has played around with something similar that has some
    advice?
    Best regards,
    X.

    Here's something I've been using for a while now. It doesn't have bookmarking or any other interactive functions, but it works correctly with wrapped lines. I use it with a JTextArea, but it should work with a JTextPane or JEditorPane as well.
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Rectangle;
    import java.awt.event.ComponentAdapter;
    import java.awt.event.ComponentEvent;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.BorderFactory;
    import javax.swing.JComponent;
    import javax.swing.SizeSequence;
    import javax.swing.UIManager;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Document;
    import javax.swing.text.Element;
    import javax.swing.text.JTextComponent;
    * LineNumberView is a simple line-number gutter that works correctly
    * even when lines are wrapped in the associated text component.  This
    * is meant to be used as the RowHeaderView in a JScrollPane that
    * contains the associated text component.  Example usage:
    *<pre>
    *   JTextArea ta = new JTextArea();
    *   ta.setLineWrap(true);
    *   ta.setWrapStyleWord(true);
    *   JScrollPane sp = new JScrollPane(ta);
    *   sp.setRowHeaderView(new LineNumberView(ta));
    *</pre>
    * @author Alan Moore
    public class LineNumberView extends JComponent
      // This is for the border to the right of the line numbers.
      // There's probably a UIDefaults value that could be used for this.
      private static final Color BORDER_COLOR = Color.GRAY;
      private static final int WIDTH_TEMPLATE = 99999;
      private static final int MARGIN = 5;
      private FontMetrics viewFontMetrics;
      private int maxNumberWidth;
      private int componentWidth;
      private int textTopInset;
      private int textFontAscent;
      private int textFontHeight;
      private JTextComponent text;
      private SizeSequence sizes;
      private int startLine = 0;
      private boolean structureChanged = true;
       * Construct a LineNumberView and attach it to the given text component.
       * The LineNumberView will listen for certain kinds of events from the
       * text component and update itself accordingly.
       * @param startLine the line that changed, if there's only one
       * @param structureChanged if <tt>true</tt>, ignore the line number and
       *     update all the line heights.
      public LineNumberView(JTextComponent text)
        if (text == null)
          throw new IllegalArgumentException("Textarea cannot be null");
        this.text = text;
        updateCachedMetrics();
        UpdateHandler handler = new UpdateHandler();
        text.getDocument().addDocumentListener(handler);
        text.addPropertyChangeListener(handler);
        text.addComponentListener(handler);
        setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR));
       * Schedule a repaint because one or more line heights may have changed.
       * @param startLine the line that changed, if there's only one
       * @param structureChanged if <tt>true</tt>, ignore the line number and
       *     update all the line heights.
      private void viewChanged(int startLine, boolean structureChanged)
        this.startLine = startLine;
        this.structureChanged = structureChanged;
        revalidate();
        repaint();
      /** Update the line heights as needed. */
      private void updateSizes()
        if (startLine < 0)
          return;
        if (structureChanged)
          int count = getAdjustedLineCount();
          sizes = new SizeSequence(count);
          for (int i = 0; i < count; i++)
            sizes.setSize(i, getLineHeight(i));
          structureChanged = false;
        else
          sizes.setSize(startLine, getLineHeight(startLine));
        startLine = -1;
      /* Copied from javax.swing.text.PlainDocument */
      private int getAdjustedLineCount()
        // There is an implicit break being modeled at the end of the
        // document to deal with boundary conditions at the end.  This
        // is not desired in the line count, so we detect it and remove
        // its effect if throwing off the count.
        Element map = text.getDocument().getDefaultRootElement();
        int n = map.getElementCount();
        Element lastLine = map.getElement(n - 1);
        if ((lastLine.getEndOffset() - lastLine.getStartOffset()) > 1)
          return n;
        return n - 1;
       * Get the height of a line from the JTextComponent.
       * @param index the line number
       * @param the height, in pixels
      private int getLineHeight(int index)
        int lastPos = sizes.getPosition(index) + textTopInset;
        int height = textFontHeight;
        try
          Element map = text.getDocument().getDefaultRootElement();
          int lastChar = map.getElement(index).getEndOffset() - 1;
          Rectangle r = text.modelToView(lastChar);
          height = (r.y - lastPos) + r.height;
        catch (BadLocationException ex)
          ex.printStackTrace();
        return height;
       * Cache some values that are used a lot in painting or size
       * calculations. Also ensures that the line-number font is not
       * larger than the text component's font (by point-size, anyway).
      private void updateCachedMetrics()
        Font textFont = text.getFont();
        FontMetrics fm = getFontMetrics(textFont);
        textFontHeight = fm.getHeight();
        textFontAscent = fm.getAscent();
        textTopInset = text.getInsets().top;
        Font viewFont = getFont();
        boolean changed = false;
        if (viewFont == null)
          viewFont = UIManager.getFont("Label.font");
          changed = true;
        if (viewFont.getSize() > textFont.getSize())
          viewFont = viewFont.deriveFont(textFont.getSize2D());
          changed = true;
        viewFontMetrics = getFontMetrics(viewFont);
        maxNumberWidth = viewFontMetrics.stringWidth(String.valueOf(WIDTH_TEMPLATE));
        componentWidth = 2 * MARGIN + maxNumberWidth;
        if (changed)
          super.setFont(viewFont);
      public Dimension getPreferredSize()
        return new Dimension(componentWidth, text.getHeight());
      public void setFont(Font font)
        super.setFont(font);
        updateCachedMetrics();
      public void paintComponent(Graphics g)
        updateSizes();
        Rectangle clip = g.getClipBounds();
        g.setColor(getBackground());
        g.fillRect(clip.x, clip.y, clip.width, clip.height);
        g.setColor(getForeground());
        int base = clip.y - textTopInset;
        int first = sizes.getIndex(base);
        int last = sizes.getIndex(base + clip.height);
        String text = "";
        for (int i = first; i <= last; i++)
          text = String.valueOf(i+1);
          int x = MARGIN + maxNumberWidth - viewFontMetrics.stringWidth(text);
          int y = sizes.getPosition(i) + textFontAscent + textTopInset;
          g.drawString(text, x, y);
      class UpdateHandler extends ComponentAdapter
          implements PropertyChangeListener, DocumentListener
         * The text component was resized. 'Nuff said.
        public void componentResized(ComponentEvent evt)
          viewChanged(0, true);
         * A bound property was changed on the text component. Properties
         * like the font, border, and tab size affect the layout of the
         * whole document, so we invalidate all the line heights here.
        public void propertyChange(PropertyChangeEvent evt)
          Object oldValue = evt.getOldValue();
          Object newValue = evt.getNewValue();
          String propertyName = evt.getPropertyName();
          if ("document".equals(propertyName))
            if (oldValue != null && oldValue instanceof Document)
              ((Document)oldValue).removeDocumentListener(this);
            if (newValue != null && newValue instanceof Document)
              ((Document)newValue).addDocumentListener(this);
          updateCachedMetrics();
          viewChanged(0, true);
         * Text was inserted into the document.
        public void insertUpdate(DocumentEvent evt)
          update(evt);
         * Text was removed from the document.
        public void removeUpdate(DocumentEvent evt)
          update(evt);
         * Text attributes were changed.  In a source-code editor based on
         * StyledDocument, attribute changes should be applied automatically
         * in response to inserts and removals.  Since we're already
         * listening for those, this method should be redundant, but YMMV.
        public void changedUpdate(DocumentEvent evt)
    //      update(evt);
         * If the edit was confined to a single line, invalidate that
         * line's height.  Otherwise, invalidate them all.
        private void update(DocumentEvent evt)
          Element map = text.getDocument().getDefaultRootElement();
          int line = map.getElementIndex(evt.getOffset());
          DocumentEvent.ElementChange ec = evt.getChange(map);
          viewChanged(line, ec != null);
    }

  • Could you please tell me how to implement many companys  in one Group?

    Dear All,
           I have one question how to implement many companys  in one Group about FI,Could you pls give me some advice,thank  you very much .

    Hi
    Suppose that you want to create a Company , Reliance Group of Companies(RGI) and Company codes Reliance Infocomm(REL1) and Reliance Petrochemicals(REL2).
    Go to OX15----->Define Company
    IMG--->Enterprise Structure-->Definition-->Financial Accounting---->Define Company
    Here you will create RGI as Company.
    Go to OX02----->Define Company Code
    IMG--->Enterprise Structure-->Definition-->Financial Accounting---->Edit,Copy,Delete,Check Company Code.
    Here you will create REL1 and REL2 as Company codes.
    Go to OX16------>Assign Company Code to Company
    IMG---->Enterprise Structure--->Assignment-->Financial Accounting---->Assign Company Code to company.
    Here you will assign Company to both the Company Codes.
    Regards
    Venkat

  • Advice on how to build a business case for partitioning

    Hi Everyone,
    I'm the architect of a business intelligence/data warehouse team. We've grown to the point where I believe we need database partitioning. I believe we are at about 1.5 TB of data. Our largest tables are in the 100 million row counts with relatively wide record lengths (~100 columns). Our just sort of large tables are in the 10 million to 50 million range, however, they have very long row lengths (~300 columns). Based on our future source system plans, our data will become even more granular and there is still a need to maintain our historical data.
    Those aren't the only reasons, but are some of the larger driving issues that are making most members of our team think it's time we purchased database partitioning. Our team is pretty unanimous for partitioning, many of our source system partners also consider it a "no-brainer", however, we're getting push back from our CIO saying that 1.5 TB and 100 million records isn't that much data as compared to other "big data" companies and that it doesn't require partitioning.
    Does anyone have a advice on how to build an business case for purchasing partitioning? Is there a good way to demonstrate cost-vs-benefit value?
    Thanks for your feedback.
    -=Joe

    I'm going to be contrarian and start from the end of your post.
    >
    Does anyone have a advice on how to build an business case for purchasing partitioning? Is there a good way to demonstrate cost-vs-benefit value?
    >
    Yes - forget about cost-vs-benefit. That's the CIOs job not yours. You're an architect. Stick to architecture. Design and implement the architecture needed to meet the business requirements of your projects. If you are given requirements that can't be met with your current infrastructure then that is when you should propose alternative infrastructure.
    >
    We've grown to the point where I believe we need database partitioning. I believe we are at about 1.5 TB of data. Our largest tables are in the 100 million row counts with relatively wide record lengths (~100 columns). Our just sort of large tables are in the 10 million to 50 million range, however, they have very long row lengths (~300 columns). Based on our future source system plans, our data will become even more granular and there is still a need to maintain our historical data.
    Those aren't the only reasons, but are some of the larger driving issues that are making most members of our team think it's time we purchased database partitioning.
    >
    NONSENSE! That's what ALL of the above statements represent - UTTER AND ABSOLUTE NONSENSE.
    Who cares what you believe? Beliefs don't carry weight, facts do. You do list some facts: 1.5 TB of data, 100 million row counts, wide record lengths, large sorts, long rows, data will get more granular, need to maintain historical data.
    Ho Hum! So what? How do ANY of those facts indicate any sort of issue or problem, existing or potential, at all? They don't. You haven't provided information that suggests that ANY of those facts illustrate what Justin referred to as 'pain points'.
    Unless those facts prevent you from doing your job of providing an architecture that meets the business requirements you don't have a leg to stand on.
    My first reaction to your request would be similar to your cio's. Implicit in your cio's response are some questions you need to ask and answer
    1. What is it that you do now that you can't do with the current architecture?
    2. What is it that you need to do for an upcoming requirement that you can't do with the current architecture?
    3. What alternatives are available to modify the current architecture to do what can't be done in items #1 and #2 above?
    That #3 is where my skepticism lies. You seem to have already concluded that partitioning is the answer. Why? What problems do you think it will solve? Why not RAC? Why not a separate data warehouse system? Why not split that historical data off into an OLAP system? Maybe that can reduce the size of the OLTP system to where you won't have whatever problems you are having.
    Partitioning is just about addressing some performance issues. A lot of times partitioning is used more for management purposes such as loading/offloading data without impacting those huge tables you are talking about.
    If my hot queries use a primary key value to retrieve data it isn't going to matter much if the tables are partitioned or not.
    That is what sets the context for what Justin is telling you. You and your team need to document the constraints (and SLAs) your system currently has, how close you are to hitting those constraints, your options for avoiding/evading those constraints using the current infrastructure and the options for avoiding/evading those constraints using a modified architecture.
    It is up to the CIO to do the cost-benefit analysis of working within the limits imposed by the current infrastructure versus modifiying the architecture.

  • Iterator interface, how to implement?

    Hi,
    I'm working on an assignment, but I can't really understand one thing. In the following few lines I'll try to describe the situation.
    I have a class which has a TreeMap of Objects. These Objects have there own variables etc... and are comparable.
    Now I need to implement an interface which makes it possible to iterate over the objects in the TreeMap.
    And I need to add some functions like:
    getCurrent() (where does the pointer stands at this moment)
    getNbElements() (how many elements are there after the current position of the pointer)
    advance() (put the pointer one position further, like next() but without the return)
    reset() (put the pointer back at the first element)
    I have no idea how to implement this, do I need to create a seperate class which is the iterator ?
    I hope someone can clear some things up, I don't need a solution, just a way of thinking.
    Thanks in advance.

    Shyamisuga wrote:
    S. U can do all tat by implementing method for each of ur function., instead my suggestion would be to use Arraylist in this case, as they hav all these functions implemented, u just gotto cal them, makes life lot simpler.. :)Awesome advice. He can implement them by implementing them. I thank the gods you're not a pathologist
    "Lassa fever? Ah, that's easy to cure. Simply cure it, and it'll be cured"

  • After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer. Does anyone have any advice on how to fix this issue?

    After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer and .mac account. Does anyone have any advice on how to fix this issue?

    Welcome to the Apple Community.
    Which OS are you using.

  • How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?

    Hi
    If a organization have 200 to 300 daily complains of there IT equipment/Software/Network e.t.c.
    How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?
    Is there any standard DataSources/InfoObjects/DSOs/InfoCubes etc. available in SAP BI Content?

    Imran,
    The point I think was to ensure that you knew exactly what was required. A customer service desk can have many interpretations from a BI perspective.
    You could have :
    1. Operational reports - calls attended per shift , Average number of calls per person , Seasonality in the calls coming in etc
    2. Analytic views - Utilization of resources , Average call time and trending , customer satisfaction , average wait time
    3. Strategic - Call volumes corresponding to campaigns etc , Employee churn and related call times
    Based on these you would then have to construct your models which would be populated by data from the MySQL instance for you to report.
    Else if you have BWA you could have data discovery instead or if you have HANA - you could do even more and if you have a HANA sidecar - you technically dont need BW. The possibilities are virtually endless - it depends on how you want to drive it and how the end user ( client ) sees value in the same.

  • How to implement implicit and explicit enhancement points

    Hi,
    Can anybody please provide some technical aspects of enhancement spots. I have gone through several sap sites and help poratl but have not get much technical things (how to implement or related t codes). please do not provide link to read theories.
    Rgds
    sudhanshu

    Hi,
    Refer to this link...
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5f/103a4280da9923e10000000a155106/content.htm

  • How many types of authentications in sharepoint and how to implement those authentication in sharepoint?

    Hi All,
    How many types of authentications in sharepoint and how to implement those authentication in sharepoint?
    can any one explain the above things with examples?
    Thanks in Advance!

    In addition to
    A Sai Gunaranjan you can also check this URL for Sharepoint 2010:
    http://technet.microsoft.com/en-us/library/cc288475(v=office.14).aspx
    http://www.codeproject.com/Tips/382312/SharePoint-2010-Form-Based-Authentication
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

Maybe you are looking for