How to nullify the NullPointerException in my code. plz help  Very Urgent!!

hi,
I registered the crystl32.ocx properly and the previous errors were gone.
thank you for your suggestions.
and right now I have an error as shown below.
Exception in thread "main" java.lang.NullPointerException
at crystal.CrystalReport.aboutBox(CrystalReport.java:4466)
at javaapplication10.CrystalClient.main(CrystalClient.java:25)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
how to overcome this.

Thanks a lot mike.
I have attached some part of the source code here.
package crystal;
import com.linar.jintegra.*;
* COM Class 'CrystalReport'. Generated 11/10/2006 4:16:13 PM
* from 'C:\WINDOWS\system32\Crystl32.ocx'<P>
* Generated using com2java Version 2.6 Copyright (c) Intrinsyc Software International, Inc.
* See  <A HREF="http://j-integra.intrinsyc.com/">http://j-integra.intrinsyc.com/</A><P>
* Description '<B>Crystal Report Control</B>'
* Generator Options:
*   AwtForOcxs = True
*   PromptForTypeLibraries = False
*   RetryOnReject = False
*   IDispatchOnly = False
*   GenBeanInfo = False
*   LowerCaseMemberNames = True
*   TreatInStarAsIn = False
*   ArraysAsObjects = False
*   OmitRestrictedMethods = False
*   ClashPrefix = zz_
*   ImplementConflictingInterfaces = False
*   DontRenameSameMethods = False
*   RenameConflictingInterfaceMethods = False
*   ReuseMethods = False
* Command Line Only Options:
*   MakeClsidsPublic = False
*   DontOverwrite = False
public class CrystalReport extends com.linar.jintegra.Ocx implements com.linar.jintegra.RemoteObjRef, crystal.CrystalCtrl {
  private static final String CLSID = "00025601-0000-0000-c000-000000000046";
  protected String getJintegraVersion() { return "2.6"; }
  // Interface delegates
  private crystal.CrystalCtrlProxy d_CrystalCtrlProxy = null;
  /** Access this COM class's crystal.CrystalCtrl interface */
  public crystal.CrystalCtrl getAsCrystalCtrl() { return d_CrystalCtrlProxy; }
  /** Compare this object with another */
  public boolean equals(Object o) {
     if(java.beans.Beans.isDesignTime()) return super.equals(o);
     else return getJintegraDispatch() == null ? false : getJintegraDispatch().equals(o);
  /** J-Integra for COM internal method */
  public com.linar.jintegra.Dispatch getJintegraDispatch() {  return d_CrystalCtrlProxy; }
   * addCrystalReportEventsListener.  Listen to events generated by this class.
   * @param    theListener An object that implements the crystal.CrystalReportEvents interface.
   * @exception java.io.IOException If there are communications problems.
  public void addCrystalReportEventsListener(crystal.CrystalReportEvents theListener) throws java.io.IOException {
    if(d_CrystalCtrlProxy == null) {
      queuedListeners.addElement(new Object[] { "00025603-0000-0000-c000-000000000046", theListener });
    } else {
      d_CrystalCtrlProxy.addListener("00025603-0000-0000-c000-000000000046", theListener, this);
   * removeCrystalReportEventsListener.  Stop listening to events generated by this class.
   * @param    theListener An object that implements the crystal.CrystalReportEvents interface.
   * @exception java.io.IOException If there are communications problems.
  public void removeCrystalReportEventsListener(crystal.CrystalReportEvents theListener) throws java.io.IOException {
    d_CrystalCtrlProxy.removeListener("00025603-0000-0000-c000-000000000046", theListener);
   * Constructs a CrystalReport.
  public CrystalReport() {
    super(CLSID);
    try {
      if (super.getObjRef() == null) {
        return;
      d_CrystalCtrlProxy = new crystal.CrystalCtrlProxy(super.getObjRef());
    } catch(java.io.IOException ioe) {
      throw new RuntimeException("Unexpected: " + ioe);
   * Constructs a CrystalReport.
  public CrystalReport(Object o) {
    super(CLSID, o);
    try {
      if (super.getObjRef() == null) {
        return;
      d_CrystalCtrlProxy = new crystal.CrystalCtrlProxy(super.getObjRef());
    } catch(java.io.IOException ioe) {
      throw new RuntimeException("Unexpected: " + ioe);
  private java.util.Vector queuedListeners = new java.util.Vector();
  public void addNotify() {
    super.addNotify();
    try {
      if (super.getObjRef() == null) {
        return;
      if (d_CrystalCtrlProxy != null) {
        return;
      d_CrystalCtrlProxy = new crystal.CrystalCtrlProxy(super.getObjRef());
      zz_doQueuedSets("d_CrystalCtrlProxy", d_CrystalCtrlProxy);
      for(java.util.Enumeration e = queuedListeners.elements(); e.hasMoreElements(); ) {
        Object[] l = (Object[])e.nextElement();
        d_CrystalCtrlProxy.addListener(l[0] + "", l[1], this);
      queuedListeners.setSize(0);
    } catch(java.io.IOException ioe) {
      throw new RuntimeException("Unexpected: " + ioe);
   * Release a CrystalReport.
  public void release() {
    com.linar.jintegra.Cleaner.release(d_CrystalCtrlProxy);
   * getPropertyByName. Get the value of a property dynamically at run-time, based on its name
   * @return    The value of the property.
   * @param     name The name of the property to get.
   * @exception java.lang.NoSuchFieldException If the property does not exit.
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public Object getPropertyByName(String name) throws NoSuchFieldException, java.io.IOException, com.linar.jintegra.AutomationException {
    try {
      return d_CrystalCtrlProxy.getPropertyByName(name);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
    } catch(NoSuchFieldException noSuchFieldException) {
      noSuchFieldException.fillInStackTrace();
      throw noSuchFieldException;
   * getPropertyByName. Get the value of a property dynamically at run-time, based on its name and a parameter
   * @return    The value of the property.
   * @param     name The name of the property to get.
   * @param     rhs A parameter used when getting the proxy.
   * @exception java.lang.NoSuchFieldException If the property does not exit.
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public Object getPropertyByName(String name, Object rhs) throws NoSuchFieldException, java.io.IOException, com.linar.jintegra.AutomationException {
    try {
      return d_CrystalCtrlProxy.getPropertyByName(name, rhs);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
    } catch(NoSuchFieldException noSuchFieldException) {
      noSuchFieldException.fillInStackTrace();
      throw noSuchFieldException;
   * invokeMethodByName. Invoke a method dynamically at run-time
   * @return    The value returned by the method (null if none).
   * @param     name The name of the method to be invoked.
   * @param     parameters One element for each parameter. Use primitive type wrappers.
   *            to pass primitive types (eg Integer to pass an int).
   * @exception java.lang.NoSuchMethodException If the method does not exit.
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public Object invokeMethodByName(String name, Object[] parameters) throws NoSuchMethodException, java.io.IOException, com.linar.jintegra.AutomationException {
    return d_CrystalCtrlProxy.invokeMethodByName(name, parameters);
   * invokeMethodByName. Invoke a method dynamically at run-time
   * @return    The value returned by the method (null if none).
   * @param     name The name of the method to be invoked.
   * @exception java.lang.NoSuchMethodException If the method does not exit.
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public Object invokeMethodByName(String name) throws NoSuchMethodException, java.io.IOException, com.linar.jintegra.AutomationException {
    return d_CrystalCtrlProxy.invokeMethodByName(name, new Object[]{});
   * getReportFileName. The filename of the report to be printed
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public String getReportFileName  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      String[] retVal = new String[1];
      zz_get("ReportFileName", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getReportFileName();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setReportFileName. The filename of the report to be printed
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setReportFileName  (
              String px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setReportFileName", (String)px);
      return;
    try {
      d_CrystalCtrlProxy.setReportFileName(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getWindowLeft. The coordinate of the left side of the print window, relative to its parent window
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public short getWindowLeft  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      short[] retVal = new short[1];
      zz_get("WindowLeft", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getWindowLeft();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowLeft. The coordinate of the left side of the print window, relative to its parent window
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowLeft  (
              short px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowLeft", (short)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowLeft(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getWindowTop. The coordinate of the top of the print window, relative to its parent window
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public short getWindowTop  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      short[] retVal = new short[1];
      zz_get("WindowTop", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getWindowTop();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowTop. The coordinate of the top of the print window, relative to its parent window
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowTop  (
              short px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowTop", (short)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowTop(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getWindowWidth. The width of the print window
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public short getWindowWidth  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      short[] retVal = new short[1];
      zz_get("WindowWidth", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getWindowWidth();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowWidth. The width of the print window
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowWidth  (
              short px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowWidth", (short)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowWidth(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getWindowHeight. The height of the print window
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public short getWindowHeight  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      short[] retVal = new short[1];
      zz_get("WindowHeight", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getWindowHeight();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowHeight. The height of the print window
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowHeight  (
              short px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowHeight", (short)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowHeight(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getWindowTitle. The title of the print window
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public String getWindowTitle  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      String[] retVal = new String[1];
      zz_get("WindowTitle", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getWindowTitle();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowTitle. The title of the print window
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowTitle  (
              String px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowTitle", (String)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowTitle(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * isWindowControlBox. If set to TRUE, the print window will have a control box
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public boolean isWindowControlBox  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      boolean[] retVal = new boolean[1];
      zz_get("WindowControlBox", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.isWindowControlBox();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowControlBox. If set to TRUE, the print window will have a control box
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowControlBox  (
              boolean px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowControlBox", (boolean)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowControlBox(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * isWindowMaxButton. If set to TRUE, the print window will have a maximize button
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public boolean isWindowMaxButton  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      boolean[] retVal = new boolean[1];
      zz_get("WindowMaxButton", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.isWindowMaxButton();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowMaxButton. If set to TRUE, the print window will have a maximize button
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowMaxButton  (
              boolean px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowMaxButton", (boolean)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowMaxButton(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * isWindowMinButton. If set to TRUE, the print window will have a minimize button
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public boolean isWindowMinButton  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      boolean[] retVal = new boolean[1];
      zz_get("WindowMinButton", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.isWindowMinButton();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setWindowMinButton. If set to TRUE, the print window will have a minimize button
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setWindowMinButton  (
              boolean px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setWindowMinButton", (boolean)px);
      return;
    try {
      d_CrystalCtrlProxy.setWindowMinButton(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * getPrintFileName. The filename for output when printing to file
   * @return    The px
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public String getPrintFileName  () throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      String[] retVal = new String[1];
      zz_get("PrintFileName", retVal);
      return retVal[0];
    try {
      return d_CrystalCtrlProxy.getPrintFileName();
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
   * setPrintFileName. The filename for output when printing to file
   * @param     px The px (in)
   * @exception java.io.IOException If there are communications problems.
   * @exception com.linar.jintegra.AutomationException If the remote server throws an exception.
  public void setPrintFileName  (
              String px) throws java.io.IOException, com.linar.jintegra.AutomationException {
    if(d_CrystalCtrlProxy == null) {
      zz_queueSet("d_CrystalCtrlProxy", "setPrintFileName", (String)px);
      return;
    try {
      d_CrystalCtrlProxy.setPrintFileName(px);
    } catch(com.linar.jintegra.AutomationException automationException) {
      automationException.fillInStackTrace();
      throw automationException;
  }

Similar Messages

  • My recirculating pump in sub vi simulation link doesnt work in the second iteration .It opens for maybe half a second whereas i gave the time delay for 5 secs..plz help very urgent

    Hi,
         I have attached my simulation loop.In the model attached i hav eone main pump with constant rpm which drives the 5 smaller pumps and fills the tank at the same time.As soon as the tanks reach their 90% level,the valves of the five pumps close(SP1,SP2,SP3,Sp4,Sp5).After that the recirculating pumps opens for 5 secs of the first tank.As soon as the recirculation finishes,the drain valve(SV1) for tank 1 open and the volume goes to interim storage.This happens for all the remaining tanks.
    My simulation works the first time,but when the second time the loop starts,it skips the recirculation pump even though i gave a time delay for 5 secs.Plz help ..I have attached the simulation.
    Thanks,
    Rami
    Attachments:
    Spatial Logic_2_Final.vi ‏223 KB

    Rami,
    I suspect that you have a race condition. The widespread use of local variables frequently leads to race conditions. Your subVI (Spatial Logic Sub_2.vi was not included) so I cannot run the VI. You have no way of knowing whether the subVI or the inner case structure will execute first, because there is no data dependency between them.
    I think a shift register or a few and some dataflow thinking would allow you to eliminate the inner case structure, the local variables, and, probably, most of your problems.
    Some of the SPi are indicators and some are controls. How are they used?
    The last case of the inner loop retursn to Case 1. Would case 0 be better?
    As for the second time through issue, it may be related to the Elapsed time function Auto Reset. From the help file: "Resets the start time to the value in Present (s) when the Express VI reaches the Time Target (s)." If more than 5 seconds elapses between the first time you use this and the next, it will exit immediately on the subsequent calls.
    Lynn

  • How to get the icon type of a JTree node, very urgent

    hi,
    i need to get the type of a JTree node but don't know how. this is quite an emergency. please help. thank you all.
    -joey

    there are several icons defined in the DefaultTreeCellRenderer class, such as closedIcon, leafIcon, openIcon. i was wondering if there is any way to get the icon type of a node. thanks for your reply.
    -joey

  • How much is the N81 8GB in Australia,plz help

    is it 400dollars or 300 plz tell me quickly

    Check with online Australian retailers to see the latest prices. This is a support forum, not a price check site.

  • HT201441 i lost the ID and password so plz help me urgent

    plz give me the real ID and password becous i lost this ID and password

    Hello John,
    Thank you for the question.  Use the steps in the following link to find an Apple ID:
    Apple ID: How to find your Apple ID
    http://support.apple.com/kb/HT5625
    Use this article if you forgot the password:
    Apple ID: If you forget your password
    http://support.apple.com/kb/HT5787
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How to improve the performance of this code

    Hi gurus
    code is given below with LDB
    this code look big but most of lines are commented
    plz help its urgent
    thanks in advance
    *& Report  ZSALES_RECON
    REPORT  ZSALES_RECON.
    TYPE-POOLS : SLIS.
    nodes: bseg , bkpf.
    data : begin of zbseg occurs 0,
    kunnr like bseg-kunnr,
    *lifnr like bseg-lifnr,
    dmbtr like bseg-dmbtr,
    *shkzg like bseg-shkzg,
    *gsber like bseg-gsber,
    bschl like bseg-bschl,
    *sgtxt like bseg-sgtxt,
    total like bseg-dmbtr,
    hkont like bseg-hkont,
    BUDAT LIKE Bkpf-BUDAT,
    belnr LIKE BSEG-belnr,
    cash like bseg-dmbtr,
    credit like bseg-dmbtr,
    abn_voucher like bseg-dmbtr,
    barista_voucher like bseg-dmbtr,
    accor like bseg-dmbtr,
    sodexho like bseg-dmbtr,
    gift like bseg-dmbtr,
    corp like bseg-dmbtr,
    card like bseg-dmbtr,
    miscellaneous like bseg-dmbtr,
    werks like bseg-werks,
    gjahr like bseg-gjahr,
    SR_NO TYPE I,
    shkzg like bseg-shkzg,
          end of zbseg,
          TP_TBL_DATA like ZBSEG.
        DATA  : idx TYPE sy-tabix.
    Report data to be shown.
    data: it_data like ZBSEG.
    Heading of the report.
    data: t_heading type slis_t_listheader.
    AT SELECTION-SCREEN.
    get bkpf.
    START-OF-SELECTION.
    data : sum_mis like bseg-dmbtr,
           sum_abn like bseg-dmbtr,
           sum_cash like bseg-dmbtr,
           sum_credit like bseg-dmbtr,
           sum_card like bseg-dmbtr,
           sum_barista_voucher like bseg-dmbtr,
           sum_accor like bseg-dmbtr,
           sum_sodexho like bseg-dmbtr,
           sum_gift like bseg-dmbtr,
           sum_corp like bseg-dmbtr.
    data : wa1_total like bseg-dmbtr.
    data : wa_belnr like bseg-belnr,
           wa_kunnr like bseg-kunnr,
           wa_werks like bseg-werks,
           belnr1 like bseg-belnr,
           wa_sr_no type i.
    GET BSEG.
    data : wa like line of zbseg.
    data : count type i,
           count1 type i.
    move-corresponding bseg to zbseg.
    *idx = sy-tabix.
    on change of zbseg-belnr.
    wa_kunnr = zbseg-kunnr.
    wa_kunnr = wa_kunnr+6(4).
    select single werks into wa_werks from bseg where belnr = zbseg-belnr
    and kunnr = '' and gjahr = zbseg-gjahr.
    if wa_kunnr = wa_werks.
    if zbseg-bschl <> '01'.
    clear: sum_mis,wa1_total,sum_abn,sum_cash,sum_credit,sum_card,
    sum_barista_voucher,sum_accor,sum_sodexho,sum_gift,sum_corp.
    wa-BUDAT = BKPF-BUDAT.
    wa-bschl = zbseg-bschl.
    wa-hkont = zbseg-hkont.
    wa-belnr = zbseg-belnr.
    wa_belnr = wa-belnr.
    wa-shkzg = zbseg-shkzg.
    wa-kunnr = zbseg-kunnr.
    count = wa-sr_no.
    *wa-sr_no = count + 1.
    idx = idx + 1.
    append wa to zbseg.
    **count = wa-sr_no.
    *wa-sr_no = wa-sr_no + 1.
    clear wa-total.
    endif.
    endif.
    endon.
    *clear : wa1_total.
    if wa_belnr = zbseg-belnr.
    loop at zbseg into wa.
    wa-total = wa1_total.
    wa-bschl = zbseg-bschl.
    wa-hkont = zbseg-hkont.
    count = sy-tabix.
    wa-sr_no = count.
    count1 = count.
    *wa_sr_no = count.
    modify zbseg from wa transporting sr_no.
    IF wa-bschl eq  '40' and wa-hkont eq '0024013020'.
    if sy-tabix = 1.
    wa-cash  = zbseg-dmbtr.
    sum_cash = sum_cash + wa-cash.
    wa-cash = sum_cash.
    modify zbseg index idx from wa transporting cash.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060010'.
       if sy-tabix = 1.
    wa-credit  = zbseg-dmbtr.
    sum_credit = sum_credit + wa-credit.
    wa-credit = sum_credit.
    modify zbseg index idx from wa transporting credit.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060015'.
    if sy-tabix = 1.
    wa-abn_voucher  = zbseg-dmbtr.
    sum_abn = sum_abn + wa-abn_voucher.
    wa-abn_voucher = sum_abn.
    modify zbseg index idx from wa transporting abn_voucher.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060017'.
    if sy-tabix = 1.
    wa-barista_voucher  = zbseg-dmbtr.
    sum_barista_voucher = sum_barista_voucher + wa-barista_voucher.
    wa-barista_voucher = sum_barista_voucher.
    modify zbseg  index idx from wa transporting barista_voucher.
    endif.
    endif.
    IF wa-bschl eq  '40' and wa-hkont eq '0026060020'.
    if sy-tabix = 1.
    wa-sodexho  = zbseg-dmbtr.
    sum_sodexho = sum_sodexho + wa-sodexho.
    wa-sodexho = sum_sodexho.
    modify zbseg index idx from wa transporting sodexho.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060030'.
    if sy-tabix = 1.
    wa-accor  = zbseg-dmbtr.
    sum_accor = sum_accor + wa-accor.
    wa-accor = sum_accor.
    modify zbseg  index idx from wa transporting accor.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026070040'.
    if sy-tabix = 1.
    wa-gift  = zbseg-dmbtr.
    sum_gift = sum_gift + wa-gift.
    wa-gift = sum_gift.
    modify zbseg index idx from wa transporting gift.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060070'.
    if sy-tabix = 1.
    wa-card  = zbseg-dmbtr.
    sum_card = sum_card + wa-card.
    wa-card = sum_card.
    modify zbseg index idx from wa transporting card.
    endif.
    endif.
    IF wa-bschl eq  '40' AND  wa-hkont eq '0026060018'.
    if sy-tabix = 1.
    wa-corp  = zbseg-dmbtr.
    sum_corp = sum_corp + wa-corp.
    wa-corp = sum_corp.
    modify zbseg index idx from wa transporting corp.
    endif.
    endif.
    *IF wa-bschl eq  '11' .
    *wa-total  = zbseg-dmbtr.
    *modify zbseg index idx from wa transporting total.
    *endif.
    IF wa-bschl EQ  '40'  or wa-bschl = '01' .
    if sy-tabix = 1.
    wa-total = zbseg-dmbtr.
    wa1_total = wa1_total + wa-total.
    wa-total = wa1_total.
    *if idx = 2.
    *modify zbseg index 1 from wa transporting total.
    *else.
    modify zbseg  index idx from wa transporting total.
    *endif.
    endif.
    endif.
    *IF zbseg-TOTAL NE zbseg-DMBTR.
    IF wa-BSCHL NE '11' AND wa-BSCHL NE '40'. "AND wa-BSCHL NE '01'.
    if sy-tabix = 1.
    if wa-shkzg = 'S'.
    wa-miscellaneous = - wa-miscellaneous.
    endif.
    wa-miscellaneous =  ZBSEG-DMBTR.
    sum_mis = sum_mis + wa-miscellaneous.
    wa-miscellaneous = sum_mis.
    modify zbseg index idx from wa transporting miscellaneous.
    endif.
    ENDIF.
    *wa1-miscellaneous = wa-miscellaneous.
    *modify zbseg index idx from wa.
    *ENDIF.
    *append wa to zbseg.
    *clear:zbseg-dmbtr.
    endloop.
    endif.
    *****endif.
    *****endon.
    *ENDFORM.
    *append zbseg.
    *endloop.
    End-of-selection.
      perform build_alv using zbseg t_heading.
    *&      Form  build_alv
          Builds and display the ALV Grid.
    form build_alv using t_data
    *tp_tbl_data
                         t_heading  type slis_t_listheader.
    ALV required data objects.
    data: w_title   type lvc_title,
          w_repid   type syrepid,
          w_comm    type slis_formname,
          w_status  type slis_formname,
          x_layout  type slis_layout_alv,
          t_event    type slis_t_event,
          t_fieldcat type slis_t_fieldcat_alv,
          t_sort     type slis_t_sortinfo_alv.
    refresh t_fieldcat.
    refresh t_event.
    refresh t_sort.
    clear x_layout.
    clear w_title.
    Field Catalog
      perform set_fieldcat2 using:
    1 'SR_NO' 'SR_NO' 'BKPF' '5' space  space  'SR NO'  space  space space
    space space space space space t_fieldcat ,
    2 'BELNR' 'BELNR' 'BKPF' '10' space  space  'Document No'  space  space
    space space space space space space t_fieldcat ,
    3 'BUDAT' 'BUDAT' 'BKPF' '10' space  space  'Document Date'  space
    space space space space space space space t_fieldcat ,
    4 'KUNNR' space space  space space  space  'Site'  space  space
    space space space space space space t_fieldcat ,
    5 'TOTAL' space 'BSEG' space space  space  'Total'  space  space space
    space space space space 'X' t_fieldcat ,
    6 'CASH' 'CASH' 'BSEG' space space  space  'Cash Sales'
      space  space space space space space space 'X' t_fieldcat ,
    7 'CREDIT' 'CREDIT' 'BSEG' space space  space  'Credit Card'
    space space space space space space space 'X' t_fieldcat ,
    8 'ABN_VOUCHER' space 'BSEG' space space  space  'ABN Voucher'  space
    space
    space space space space space 'X' t_fieldcat ,
    9 'BARISTA_VOUCHER' space 'BSEG' '15' space  space  'BARISTA Voucher'
    space  space
    space space space space space 'X' t_fieldcat ,
    10 'CORP' 'CORP' 'BSEG' space space  space  'ABN Corp'  space  space
    space space space space space 'X' t_fieldcat ,
    11 'SODEXHO' 'SODEXHO' 'BSEG' space space  space  'Sodexho'  space
    space space space space space space 'X' t_fieldcat ,
    12 'ACCOR' 'ACCOR' 'BSEG' space space  space  'Accor'
    space  space space space space space space 'X' t_fieldcat ,
    13 'GIFT' 'GIFT' 'BSEG' space space  space  'Gift Coupon'
    space  space space space space space space 'X' t_fieldcat ,
    14 'CARD' 'CARD' 'BSEG' space space  space  'Diners Card'  space
    space space space space space space 'X' t_fieldcat ,
    15 'MISCELLANEOUS' space 'BKPF' '18' space  space
    'Miscellaneous Income' space space space space space space space 'X'
    t_fieldcat .
    *14 'KBETR' 'KBETR' 'KONP' '10' space  space  'Tax %age'  space  space
    *space space space space space space t_fieldcat ,
    *15 'MWSKZ1' 'MWSKZ1' 'RBKP' space space  space  'Tax Type'  space
    *space
    space space space space space space t_fieldcat ,
    *16 'AMT' 'AMT' 'RBKP' space space  space  'Amount Payable'  space
    *space
    space space space space space 'X' t_fieldcat ,
    *17 'WERKS' 'SITE' 'RSEG' space space  space  'State'  space  space
    *space space space space space space t_fieldcat .
    *18 'GSBER' 'GSBER' 'RBKP' space space  space  'Business Area'  space
    *space space space space space space space t_fieldcat .
    Layout
    x_layout-zebra = 'X'.
    Top of page heading
      perform set_top_page_heading using t_heading t_event.
    Events
      perform set_events using t_event.
    GUI Status
      w_status = ''.
      w_repid = sy-repid.
    Title
    w_title = <<If you want to set a title for
                the ALV, please, uncomment and edit this line>>.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = w_repid
          it_fieldcat              = t_fieldcat
          is_layout                = x_layout
          it_sort                  = t_sort
          i_callback_pf_status_set = w_status
          i_callback_user_command  = w_comm
          i_save                   = 'X'
          it_events                = t_event
          i_grid_title             = w_title
        tables
          t_outtab                 = zbseg
         t_data
        exceptions
          program_error            = 1
          others                   = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    form set_top_page_heading using t_heading type slis_t_listheader
                                    t_events  type slis_t_event.
    data: x_heading type slis_listheader,
          x_event   type line of slis_t_event.
    Report title
      clear t_heading[].
      clear x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'SALES RECONCILIATION REPORT'(001).
      append x_heading to t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      append x_event to t_events.
    endform.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    form set_events using t_events type slis_t_event.
    data: x_event   type line of slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    endform.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
                         t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-up = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
       p_colpos: Column position.
       p_fieldname: Field of internal table which is being described by
    *            this record of the field catalog.
       p_ref_fieldname: (Optional) Table field / data element which
    *                describes the properties of the field.
    *                If this field is not given, it is copied from
    *                the fieldname.
       p_ref_tabname: (Optional) Table which holds the field referenced
    *              by <<p_ref_fieldname>>.
                      If this is not given, the parameter
                      <<p_ref_fieldname>> references a data element.
       p_outputlen: (Optional) Column width.
       p_noout: (Optional) If set to 'X', states that the field is not
    *           showed initially. If so, the field has to be
                included in the report at runtime using the display
                options.
       p_seltext_m: (Optional) Medium label to be used as column header.
       p_seltext_l: (Optional) Long label to be used as column header.
       p_seltext_s: (Optional) Small label to be used as column header.
       p_reptext_ddic: (Optional) Extra small (heading) label to be
    *                used as column header.
       p_ddictxt: (Optional) Set to 'L', 'M', 'S' or 'R' to select
                  whether to use SELTEXT_L, SELTEXT_M, SELTEXT_S,
                  or REPTEXT_DDIC as text for column header.
       p_hotspot: (Optional) If set to 'X', this field will be used
    *             as a hotspot area for cursor, alolowing the user
    *          to click on the field.
       p_showasicon: (Optional) If set to 'X', this field will be shown
                     as an icon and the contents of the field will set
    *             which icon to show.
       p_checkbox: (Optional) If set to 'X', this field will be shown
                   as a checkbox.
       p_edit: (Optional) If set to 'X', this field will be editable.
       p_dosum: (Optional) If set to 'X', this field will be summed
                (aggregation function) according to the grouping set
                by the order functions.
       t_fieldcat: Table which contains the whole fieldcat.
    FORM set_fieldcat2 USING
          p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-hotspot = p_hotspot.
      wa_fieldcat-checkbox = p_checkbox.
      wa_fieldcat-icon = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given
       is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a
       field of a table.
    In case ref_fieldname is not given,
       it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF NOT p_edit IS INITIAL.
        wa_fieldcat-input     = 'X'.
        wa_fieldcat-edit     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    ======================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
        i_logo             = <<If you want to set a logo, please,
                             uncomment and edit this line>>
          it_list_commentary = t_heading.
    endform.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    form user_command using r_ucomm     like sy-ucomm
                            rs_selfield type slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_selfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    endform.                    "user_command
    *********************************ldb code start from here *************************************************************
         DATABASE PROGRAM OF LOGICAL DATABASE ZBRM_3
      top-include and nxxx-include are generated automatically
      Do NOT change their names manually!!!
    *include DBZBRM_3TOP . " header
    *include DBZBRM_3NXXX . " all system routines
    include DBZBRM_3F001 . " user defined include
    PROGRAM SAPDBZBRM_3 DEFINING DATABASE ZBRM_3.
    TABLES:
        BKPF,
        BSEG.
    Hilfsfelder
    DATA:
       BR_SBUKRS LIKE BKPF-BUKRS,
        BR_SBELNR LIKE BKPF-BELNR,
        BR_SGJAHR LIKE BKPF-GJAHR,
        BR_SBUDAT LIKE BKPF-BUDAT,
        BR_SGSBER LIKE BSEG-GSBER.
       BR_SBUZEI LIKE BSEG-BUZEI,
       BR_SEBELN LIKE BSEG-EBELN,
       BR_SEBELP LIKE BSEG-EBELP,
       BR_SZEKKN LIKE BSEG-ZEKKN.
    working areas for the authority check                     "n435991
    for the company code                                      "n435991
    *TYPES : BEGIN OF STYPE_BUKRS,                               "n435991
             BUKRS              LIKE  T001-BUKRS,              "n435991
             WAERS              LIKE  T001-WAERS,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_BUKRS.                                 "n435991
                                                               "n435991
    *DATA : G_S_BUKRS             TYPE  STYPE_BUKRS,             "n435991
          G_T_BUKRS             TYPE  STYPE_BUKRS   OCCURS 0.  "n435991
                                                               "n435991
    for the document type                                     "n435991
    *TYPES : BEGIN OF STYPE_BLART,                               "n435991
             BLART              LIKE  BKPF-BLART,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_BLART.                                 "n435991
                                                               "n435991
    *DATA : G_S_BLART             TYPE  STYPE_BLART,             "n435991
          G_T_BLART             TYPE  STYPE_BLART   OCCURS 0.  "n435991
                                                               "n435991
    for the business area                                     "n435991
    *TYPES : BEGIN OF STYPE_GSBER,                               "n435991
             GSBER              LIKE  BSEG-GSBER,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_GSBER.                                 "n435991
                                                               "n435991
    *DATA : G_S_GSBER             TYPE  STYPE_GSBER,             "n435991
          G_T_GSBER             TYPE  STYPE_GSBER   OCCURS 0.  "n435991
                                                               "n435991
    for the purchasing organization                           "n435991
    *TYPES : BEGIN OF STYPE_EKORG,                               "n435991
             EKORG              LIKE  EKKO-EKORG,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_EKORG.                                 "n435991
                                                               "n435991
    *DATA : G_S_EKORG             TYPE  STYPE_EKORG,             "n435991
          G_T_EKORG             TYPE  STYPE_EKORG   OCCURS 0.  "n435991
                                                               "n435991
    for the plant                                             "n435991
    *TYPES : BEGIN OF STYPE_WERKS,                               "n435991
             WERKS              LIKE  EKPO-WERKS,              "n435991
             RETCODE            TYPE  N,                       "n435991
           END OF STYPE_WERKS.                                 "n435991
                                                               "n435991
    *DATA : G_S_WERKS             TYPE  STYPE_WERKS,             "n435991
          G_T_WERKS             TYPE  STYPE_WERKS   OCCURS 0.  "n435991
                                                               "n435991
    *DATA : G_F_TABIX             LIKE   SY-TABIX.               "n435991
                                                               "n435991
    working tables for array database access                  "n934526
    *types : begin of stype_key,                                 "n934526
             bukrs              type  bkpf-bukrs,              "n934526
             belnr              type  bkpf-belnr,              "n934526
             gjahr              type  bkpf-gjahr,              "n934526
           end of stype_key,                                   "n934526
                                                               "n934526
           stab_key             type  standard table of        "n934526
                                      stype_key                "n934526
                                      with default key.        "n934526
    Initialwerte setzen
    FORM INIT.
    ENDFORM.
    Selection Screen: Process before output
    FORM PBO.
    ENDFORM.
    Selection Screen: Process after input
    FORM PAI USING FNAME MARK.
      CHECK MARK = SPACE.
    ENDFORM.
    Lesen BKPF und Uebergabe an den Selektionsreport
    FORM PUT_BKPF.
    define locla working areas                                "n934526
    data : l_t_key             type  stab_key,                "n934526
            l_t_key_block       type  stab_key,                "n934526
            l_t_bkpf            type  standard table of bkpf.  "n934526
                                                               "n934526
    ----------------------------------------------------------"n934526
                                                                "n934526
    database seletion improved                                "n934526
    at first read all FI doc keys into a lean table           "n934526
    data: wa like bkpf-belnr.
      SELECT * FROM BKPF
    where budat in br_budat
          AND GJAHR EQ BR_GJAHR-LOW
          AND BLART = 'RV'.
         AND BLART IN BR_BLAR                               "n934526
                                                                "n934526
    check sy-subrc is initial.                                "n934526
                                                               "n934526
    then process the found FI doc keys in small blocks        "n934526
    do.                                                       "n934526
       if  l_t_key[] is initial.                               "n934526
         exit.        " no more keys -> leave this DO loop     "n934526
       endif.                                                  "n934526
                                                               "n934526
      form small blocks with 100 FI docs each                 "n934526
       refresh                  l_t_key_block.                 "n934526
       append lines of l_t_key  from 1 to 100                  "n934526
                                to  l_t_key_block.             "n934526
       delete l_t_key           from 1 to 100.                 "n934526
                                                               "n934526
      read the complete FI doc headers for the block          "n934526
       SELECT *                 FROM BKPF                      "n934526
         into  corresponding fields of table l_t_bkpf          "n934526
           for all entries in l_t_key_block                    "n934526
             WHERE BUKRS = l_t_key_block-BUKRS                 "n934526
               AND BELNR = l_t_key_block-BELNR                 "n934526
               AND GJAHR = l_t_key_block-GJAHR.                "n934526
                                                               "n934526
      provide the complete structure for the PUT              "n934526
       loop at l_t_bkpf         into  bkpf.                    "n934526
        process this company code  : authority and read T001  "n934526
         PERFORM                F1000_COMPANY_CODE.            "n934526
                                                               "n934526
        go on if the first authority check was successful     "n934526
         CHECK : G_S_BUKRS-RETCODE IS INITIAL.                 "n934526
                                                               "n934526
        set the currency key and save the keys                "n934526
         MOVE : G_S_BUKRS-WAERS TO  T001-WAERS,                "n934526
                BKPF-BUKRS      TO  BR_SBUKRS,                 "n934526
               MOVE  BKPF-BELNR       TO  BR_SBELNR.
               MOVE  BKPF-GJAHR      TO  BR_SGJAHR .               "n934526
                BKPF-GJAHR      TO  BR_SGJAHR.                 "n934526
          PUT                    BKPF.                          "n934526
       endloop.                                                "n934526
    enddo.                                                    "n934526
    ENDSELECT.
    ENDFORM.
    Lesen BSEG und Uebergabe an den Selektionsreport
    FORM PUT_BSEG.
    define local working areas                                "n934526
      data : l_t_bseg            type  standard table of bseg.  "n934526
                                                                "n934526
    ----------------------------------------------------------"n934526
    BR_SGSBER = BR_GSBER-LOW.
                                                                "n934526
      SELECT * FROM BSEG                                        "n934526
          WHERE  BELNR EQ BR_SBELNR
          AND GJAHR EQ BR_SGJAHR
          AND GSBER EQ BR_SGSBER.
    check sy-subrc is initial.                                "n934526
                                                                "n934526
    loop at l_t_bseg           into  bseg.                    "n934526
       MOVE BSEG-BUZEI TO BR_SBUZEI.
       MOVE BSEG-EBELN TO BR_SEBELN.
       MOVE BSEG-EBELP TO BR_SEBELP.
       MOVE BSEG-ZEKKN TO BR_SZEKKN.
        PUT BSEG.
      endSELECT.                                                  "n934526
    ENDFORM.
    "n435991
          FORM AUTHORITYCHECK_BKPF                            "n435991
    "n435991
                                                                "n435991
    *FORM AUTHORITYCHECK_BKPF.                                   "n435991
                                                                "n435991
    the authority-check for the company code was successful;  "n435991
    check authority for the document type here                "n435991
                                                                "n435991
    does the buffer contain this document type ?              "n435991
    READ  TABLE  G_T_BLART     INTO  G_S_BLART                "n435991
            WITH  KEY  BLART = BKPF-BLART  BINARY SEARCH.      "n435991
                                                               "n435991
    CASE  SY-SUBRC.                                           "n435991
       WHEN  0.       "document type is known                  "n435991
                                                               "n435991
       WHEN  4.       "docment type is new --> insert          "n435991
         MOVE  SY-TABIX         TO  G_F_TABIX.                 "n435991
         PERFORM                F1200_CREATE_BLART_ENTRY.      "n435991
         INSERT  G_S_BLART      INTO  G_T_BLART                "n435991
                                INDEX  G_F_TABIX.              "n435991
                                                               "n435991
       WHEN  8.       "document type is new --> append         "n435991
         PERFORM                F1200_CREATE_BLART_ENTRY.      "n435991
         APPEND  G_S_BLART      TO  G_T_BLART.                 "n435991
    ENDCASE.                                                  "n435991
                                                               "n435991
    set the return code                                       "n435991
    MOVE  G_S_BLART-RETCODE    TO  SY-SUBRC.                  "n435991
                                                               "n435991
    *ENDFORM.                     "authoritycheck_bkpf           "n435991
                                                               "n435991
    "n435991
          FORM AUTHORITYCHECK_BSEG                            "n435991
    "n435991
                                                                "n435991
    *FORM AUTHORITYCHECK_BSEG.                                   "n435991
                                                               "n435991
    does the buffer contain this document type ?              "n435991
    READ  TABLE  G_T_GSBER     INTO  G_S_GSBER                "n435991
            WITH  KEY  GSBER = BSEG-GSBER  BINARY SEARCH.      "n435991
                                                               "n435991
    CASE  SY-SUBRC.                                           "n435991
       WHEN  0.       "business area is known                  "n435991
                                                               "n435991
       WHEN  4.       "business area is new --> insert         "n435991
         MOVE  SY-TABIX         TO  G_F_TABIX.                 "n435991
         PERFORM                F1300_CREATE_GSBER_ENTRY.      "n435991
         INSERT  G_S_GSBER      INTO  G_T_GSBER                "n435991
                                INDEX  G_F_TABIX.              "n435991
                                                               "n435991
       WHEN  8.       "business area is new --> append         "n435991
         PERFORM                F1300_CREATE_GSBER_ENTRY.      "n435991
         APPEND  G_S_GSBER      TO  G_T_GSBER.                 "n435991
    ENDCASE.                                                  "n435991
                                                               "n435991
    set the return code                                       "n435991
    MOVE  G_S_GSBER-RETCODE    TO  SY-SUBRC.                  "n435991
                                                               "n435991
    *ENDFORM.                     "authoritycheck_bseg           "n435991
                                                               "n435991

    ABAP provides few tools to analyse the perfomance of the objects, which was developed by us.
    Run time analysis transaction SE30
    This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
    SQL Trace transaction ST05
    by using this tool we can analyse the perfomance issues related to DATABASE calls.
    Perfomance Techniques for improve the perfomance of the object.
    1) ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
    2) Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out.
    3) Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
    4) Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
    5) Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
    6) Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space.
    Use as many table keys as possible in the WHERE part of your select statements.
    7)Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
    8) Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
    9) Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
    10) Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
    11) Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
    12) If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
    13) Know how to use the 'collect' command. It can be very efficient.
    14) Use the SELECT SINGLE command whenever possible.
    15) Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
    Some tips:
    1) Use joins where possible as redundant data is not fetched.
    2) Use select single where ever possible.
    3) Calling methods of a global class is faster than calling function modules.
    4) Use constants instead of literals
    5) Use WHILE instead of a DO-EXIT-ENDDO.
    6) Unnecessary MOVEs should be avoided by using the explicit work area operations
    see the follwing links for a brief insifght into performance tuning,
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
    1. Debuggerhttp://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    2. Run Time Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    3. SQL trace
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    4. CATT - Computer Aided Testing Too
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    5. Test Workbench
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    6. Coverage Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    7. Runtime Monitor
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    8. Memory Inspector
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    9. ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Performance tuning for Data Selection Statement
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm

  • How to change the text Transport id code in sus

    Hi,
    How to change the text Transport id code in sus while creating ASN
    Please advise.
    Regards,
    manu

    SE80---> BSP APPLICATION with SRMSUS ---> views -->asn > detail_edit.inc.->
    On the right hand side in the details ---> search for
    BBP_SUS_UI/ASN_TRANSPORT_IDENTIFICATION
    replace the above with the following
    BBP_SUS_UI/INVOICE_DOCUMENT_NUMBER
    BBP_SUS_UI/INVOICE.
    there is no entry available for invoice number , only the above two are available.
    save the changes
    activate the changes
    REWARD POINTS IF USEFULL

  • How to nullify the GR/IR  account

    Hi,
    *Po raised  - 100 qty (ME21N) . Against  that Po  I have received  IR qty  100 (MIRO), vendor unable supply Full qty   GRN received only - 50 qty(MIRO) .   How to nullify The GR/IR account Against that PO .
    Regards ,
    Raj u

    I am giving some clear explanation
    credit note affect the vendor account . But account entries like below
    MIGO  ( 2nd entry ) As per my scenario                                                                       MIRO (1 st entry) As per my scenario .
    Material a/c      50 qty                                                          GAR/IR account  a/c      - 100 qty
    TO GAR/IR a/c  50  qty                                                             To vendor account   - 100 qty
    In this scenario GA/IR account shows  difference 50 qty . How to nullify the GR/IR  account

  • How to Extend the count of item code in IC_ITEM_MST table

    Hi Friends.
    Recently we used 10 count of IC_ITEM_MST table . But we want to extend the count 15. How to define pls help me.
    Regards
    Babu.J

    Duplicate post -- How to Extend the count of item code in IC_ITEM_MST table

  • I forgot my icloud id and password. i want to delete the id. i forgot the password. if i try to delete the account its asking for password. i cannot find how to delete the account. Please anyone can help me out???

    I forgot my icloud id and password. i want to delete the id. i forgot the password. if i try to delete the account its asking for password. i cannot find how to delete the account. Please anyone can help me out???

    You aren't going to be able to delete it without the correct password.  If it's your ID, you can reset the password as explained here: http://support.apple.com/kb/HT5625.  If it isn't your ID, you will have to get the password for the person who owns the ID.  There's no way around this and no one else can help.

  • Hi, I followed the instructions to apply for the Made For iPhone Program. After submission of the necessary documents and information, I have not heard back from Apple. How to track the application progress? Can someone help?

    Hi, I followed the instructions from Apple MFI website, to apply for the Made For iPhone Program. After submission of the necessary documents and information, I have not heard back from Apple for couple weeks. How to track the application progress? Can someone help? < Edited by Host >
    Thank you.
    Best Regards,
    Gerald

    Hi Gerald
    This is a user-to-user forum, and your message will not be received by Apple. You will need to sign into your Developer/MFI account, and contact Apple that way. This can be done here.
    P.S Please do not post your e-mail address here.
    Taylor

  • HT1338 I connected a HDMI cord to my macbook from my TV and I mirrored it so I can see my macbook on my TV but the sound wont transfer to my TV, How can I do make this happen? PLZ help, Thank you

    I connected a HDMI cord to my macbook from my TV and I mirrored it so I can see my macbook on my TV but the sound wont transfer to my TV, How can I do make this happen? PLZ help, Thank you

    What model and year is your MacBook?  Some older MacBooks don't support Audio out via miniport/HDMI (the display miniport is video only).

  • I Forgot My Rescue Email , But I Don't Know How To Find The Rescue Email Address! Please Help!

    I Forgot My Rescue Email , But I Don't Know How To Find The Rescue Email Address! Please Help!

    See the "more like this" section on the right side of this page

  • I had backup my iphone .. and it started but later it showed no space .. so i had gone to preference device and deleted the backup.. but still my iphone shows the availabilty as zero..plz help

    i had backup my iphone .. and it started but later it showed no space.. so i had to stop the backup..and had gone to preference>device and deleted the backup.. but still my iphone shows the availabilty as zero..plz help.. how to get the available space that was before..

    rabidrabbit wrote:
    Can I back up my iPhone 4S to my ipad 3 (64 gb)?
    no
    rabidrabbit wrote:
    However, now I don't have enough space in iCloud to backup either device. Why not?
    iCloud only give so much space for free storage, then if you exceed the limit of 5gb you have to pay for additional storage.

  • Please i need help very urgent !!! after deleting my exchange account because the company changed the password , I lost 150 200 contacts and i need to get them back very soon ! please help

    Please i need help very urgent !!! after deleting my exchange account because the company changed the password , I lost 150 200 contacts and i need to get them back very soon !  i never backed up on itunes ..please help

    No. The contacts are "owned" by the Exchange server.
    The Exchange server is owned by the company.
    Everything on the Exchange server is owned by the company.
    If you quit or were terminated, and your access to the system has been revoked, then there is nothing you and do at this point. Once you deleted the account from your phone, all of the associated data was deleted.
    NEVER store personal information on company systems.

Maybe you are looking for

  • How can I decode Japanese character using java from JavaScript escape() function

    Hi: I have an application which supports Japanese character. I am using JavaScript escape() function to encode the text field before I posted it through web server and then I will just convert it into hex number to decode it through an Integer. It wo

  • Buying Adobe Muse CC off a South African Account

    Hi there my name is jason and i have a huge problem. I need to use adobe muse for a major year end project, i am currently studying Graphic design and i need this softwear to complete my task. After log in i proceed to download muse and it adds it to

  • Help with restoring files from back-up to external hard-drive

    My laptop died. Took it to Best Buy for evaluation. They had to send it out; but (for $150) were able to back up the laptop's data on an external hard drive. I have tried to restore my files to the new laptop, but can't figure out how...except to cop

  • Mail crashes on launch

    On my macbook pro, mail crashes before it has fully started up. Same problem if another user tries to launch mail. Moving the mail folder from my library or moving com.apple.mail.plist from preferences doesn't help. A copy of mail.app taken from anot

  • Database size versus table data size

    I ran the below query that queries all tables in the database and the total size for reserved space is 17GB. The database size is 294GB. Why is there such a big difference in size. I would expect the database to be a little bigger but not 277GB bigge