Inconsistent Execution of Code

The following class works fine when called from the testclass but shows no graphics when called from another class in my project.
import java.awt.*;
import java.applet.*;
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import javax.imageio.*;
import java.util.*;
import java.awt.image.*;
public class ExpScreen{
     int[] expN={0,0,200,500,800,1200,1800,2500,3000,4000,5000,5500,6000,6750,7500,8750,10000,12000,14000,16700,18500,20000,22222,25000,30000,35000,40000,50000,60000,75000,100000,150000,200000,250000,300000,350000,500000,1000000};
     public ExpScreen(Stats play,int HPn,int MPn, int exp,int curLvl,int curExp){
          System.out.println(play);
          System.out.println(HPn);
          System.out.println(MPn);
          System.out.println(exp);
          System.out.println(curLvl);
          System.out.println(curExp);
          JFrame fr=new JFrame("You earned " + exp + " experience!");
          Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
          fr.setSize(d.width,d.height);
          fr.setResizable(false);
          JLabel hp=new JLabel("HP  "+ play.getCurHP()+ "/" + play.getHP());
          JLabel BLANK=new JLabel(" ");
          JLabel mp=new JLabel("MP  "+ play.getCurMP()+ "/" + play.getMP());
          JLabel lvl=new JLabel("You are currently level " + curLvl);
          JLabel Exp=new JLabel("Experience  "+ curExp+ "/" + expN[curLvl]);
          JProgressBar HP=new JProgressBar(0,100);
          JProgressBar MP=new JProgressBar(0,100);
          JProgressBar EXP=new JProgressBar(0,100);
          HP.setValue(100);
          MP.setValue(100);
          EXP.setValue(100);
          fr.getContentPane().setLayout(new GridLayout(4,2));
          fr.getContentPane().add(lvl);
          fr.getContentPane().add(BLANK);
          fr.getContentPane().add(hp);
          fr.getContentPane().add(HP);
          fr.getContentPane().add(mp);
          fr.getContentPane().add(MP);
          fr.getContentPane().add(Exp);
          fr.getContentPane().add(EXP);
          HP.setValue((int)((play.getCurHP())/play.getHP()*100));
          MP.setValue((int)((play.getCurMP())/play.getMP()*100));
          HP.setVisible(true);
          HP.setStringPainted(true);
          MP.setStringPainted(true);
          fr.setVisible(true);
          if(expN[curLvl]>0)
               EXP.setValue((int)(((curExp-expN[curLvl-1])/(expN[curLvl]-expN[curLvl-1]))*100));
          else
               EXP.setValue((int)(curExp/2));
          for(int x=0;x<HPn;x++){
               System.gc();
               if(play.getCurHP()!=play.getHP()){
                    //System.out.println("1");
                    play.setCurHP(play.getCurHP()+1);
                    HP.setValue((int)(((double)play.getCurHP())/(double)play.getHP()*100));
                    hp.setText("HP  "+ play.getCurHP() + "/" + play.getHP());
               else
                    x=HPn;
          //fr.setVisible(true);
          for(int x=0;x<MPn;x++){
               System.gc();
               if(play.getCurMP()!=play.getMP()){
                    //System.out.println("2");
                    play.setCurMP(play.getCurMP()+1);
                    MP.setValue((int)(((double)play.getCurMP())/(double)play.getMP()*100));
                    mp.setText("MP  "+ play.getCurMP() + "/" + play.getMP());
               else
                    x=MPn;
          //fr.setVisible(true);
          for(int x=0;x<exp;x++){
               System.gc();
               curExp++;
               Exp.setText("Experience  "+ curExp+ "/" + expN[curLvl]);
               if(expN[curLvl]>0)
                    EXP.setValue((int)(((double)(curExp-expN[curLvl-1])/(double)(expN[curLvl]-expN[curLvl-1]))*100));
               else
                    EXP.setValue((int)(curExp/2));
               if(curExp==expN[curLvl]){
                    curLvl++;
                    play.setLevel(curLvl);
                    lvl.setText("You are currently level " + curLvl);
                    JOptionPane.showMessageDialog(null,"LEVEL UP");
                    Exp.setText("Experience  "+ curExp+ "/" + expN[curLvl]);
                    EXP.setValue((int)(((curExp-expN[curLvl-1])/(expN[curLvl]-expN[curLvl-1]))*100));
          try{
               Thread.sleep(2000);
          catch(Exception e){
          //fr.setVisible(true);
          play.setExp(play.getExp()+exp);
          fr.setVisible(false);     
class testclass{
     public static void main(String args[]){
          ExpScreen ex = new ExpScreen(new Stats(1,500,500,1,1,1,1,1,1,100,false,100),99,100,50,2,199);
}Here is stats:
public class Stats{
     private int level;
     private int HP;
     private int MP;
     private int curHP;
     private int curMP;
     private int str;
     private int mag;
     private int def;
     private int mDef;
     private int eva;
     private int dex;
     private int lim;
     private boolean death;
     private int exp;
     public Stats(int LEVEL,int hp, int mp, int STR, int MAG,int DEF, int MDEF, int EVA, int DEX, int LIM,boolean DEATH){
          level=LEVEL;
          HP=hp;
          MP=mp;
          curHP=hp;
          curMP=mp;
          str=STR;
          mag=MAG;
          def=DEF;
          mDef=MDEF;
          eva=EVA;
          dex=DEX;
          lim=LIM;
          death=DEATH;
          exp=0;
     public String toString(){
          return level+" "+HP+" "+MP+" "+curHP+" "+curMP+" "+mag+" "+death;
     public Stats(int LEVEL,int hp, int mp, int STR, int MAG,int DEF, int MDEF, int EVA, int DEX, int LIM,boolean DEATH,int EXP){
          level=LEVEL;
          HP=hp;
          MP=mp;
          curHP=hp;
          curMP=mp;
          str=STR;
          mag=MAG;
          def=DEF;
          mDef=MDEF;
          eva=EVA;
          dex=DEX;
          lim=LIM;
          death=DEATH;
          exp=EXP;
     public int getExp(){
          return exp;
     public void setExp(int EXP){
          exp=EXP;
     public boolean death(){
          return death;
     public int getCurHP(){
          return curHP;
     public int getLimit(){
          return lim;
     public int getCurMP(){
          return curMP;
     public void setLimit(int num){
          lim=num;
     public void setCurHP(int num){
          curHP=num;
     public void setCurMP(int num){
          curMP=num;
     public int getHP(){
          return HP;
     public int getMP(){
          return MP;
     public int getLevel(){
          return level;
     public void setLevel(int a){
          level=a;
     public int getStr(){
          return str;
     public int getMag(){
          return mag;
     public int getDef(){
          return def;
     public int getMDef(){
          return mDef;
     public int getEva(){
          return eva;
     public int getDex(){
          return dex;
}

It's amazing that such cleatr code would act inconsistently.
Note that your posted code will create a 'memory leak' because you never call dispose on the Frame.
You are also calling System.gc() which is generally not a good idea and you have two loops that look very similar if not identical.
Other than that, I have no idea without seeing how you call it from the other method. Of course, with all those constructor parameters, I doubt I'd seee the problem then either.

Similar Messages

  • During file extraction, "Error during execution, error code =4"

    from Oracle® Fusion Middleware Getting Started With Installation for Oracle WebLogic Server
    11g Release 1 (10.3.1)
    http://download.oracle.com/docs/cd/E12839_01/web.1111/e13751/toc.htm#CIHCJJIA
    > said "instead of installing the JRockit JDK that is included, Oracle strongly recommends that you download and install the latest available JRockit version separately."
    selected "Oracle JRockit Mission Control 4.0, for Java version 6"
    > got file named: http://download.oracle.com/otn/bea/jrockit/jrmc-4.0.0-1.6.0-linux-ia32.bin
    Set permissions to *.bin installer:
    chmod a+x file_name.bin ./file_name.bin
    During file extraction (as 'oracle' user/owner) got: "Error during execution, error code =4"
    Please advise.
    thank you.

    hi,
    i ran into teh same problem and just figured out that my CPU is too old (AMD Athlon 3000+). This processor doesnt support SSE2, as required, see
    http://download.oracle.com/docs/cd/E15289_01/doc.40/e15066/suppconfigchanges.htm#CHDDFHJF
    does your machine have all the relevant features?

  • Execution of code in an improper schema

    We are running 10.2.0.4 Oracle database on Sun Solaris. Due to the nature of this question, I am inclined to place it here under 'Database - General' section rather than the SQL/PLSQL section.
    Our development database say DEV1 has 4 schemas - SCHEMA1, SCHEMA2, SCHEMA3, SCHEMA4
    All schemas are exactly alike in terms of all objects and their DDLs. However, there are data differences
    between some of the tables between the schemas as different project teams use them.
    SCHEMA1 owns a table say TABLE1 that has a column called SELECTSTMT
    which has the value set as
    SQL> SELECT SELECTSTMT FROM TABLE1 WHERE GRUP = 'CSC';
    SELECTSTMT
    BEGIN PACKAGE4.LoadSchemaClient; END;
    SCENARIO:
    SCHEMA1 is executing a procedure called pmGetData that exists in the package PACKAGE4(that SCHEMA1 owns).
    In the procedure pmGetData, following lines are present :
    cStatement     TABLE1.SELECTSTMT%TYPE;
    SELECT SOURCE,SELECTSTMT INTO cSOURCE,cStatement FROM TABLE1 WHERE GRUP=cGrup;
    EXECUTE IMMEDIATE cStatement;
    At the end of the execution, SCHEMA1 get an error (an application error perhaps caused by a data issue)
    PROBLEM :
    After some debugging, we found that during the EXECUTE IMMEDIATE, the cStatement that is being executed (which is the BEGIN -
    END block) as mentioned above in the SELECT statement result is using the LoadSchemaClient procedure that belongs to SCHEMA4 !!
    I ran several queries to further troubleshoot by querying grants, checking synonyms , etc. All looks okay to me. However, clearly , I am missing something . Any suggestions would be great (though I may have already tried it)
    I fail to understand this strange cross-connection between SCHEMA1 and SCHEMA4.
    Each of the schemas are not supposed to touch other schemas.
    I then, (in SCHEMA1) updated the SELECTSTMT column to hard-code the schema name to the value :
    SQL> SELECT SELECTSTMT FROM TABLE1 WHERE GRUP = 'CSC';
    SELECTSTMT
    BEGIN SCHEMA1.PACKAGE4.LoadSchemaClient; END;
    This worked with no errors. However, this is not the solution I am looking for. The reason is that the table TABLE1 is one of our standard static table (kind of like an admin lookup table). INSERT or UPDATE to this table goes only by build deploys. The same build deploy is supposed to work in every schemas without modifications.
    I need to find out what is causing this behavior and fix the root cause.
    Thanks

    Looked in metalink and found something as close as :
    BUG 8210889
    BUG 7191744
    The above bugs have some good information in them. If I can take any other suggestions from Metalink, I will take it.
    Is there anything else I can try out of the box ? (ofcourse besides the SR )
    Thanks

  • Improve the execution of code

    hi,
    i given my program. can any one tell me how to improve the execution speed of this program. it is working very slow in quality system.
    *& Report  ZQMRSMNMWIPRPT                                              *
    REPORT  zqmrsmnmwiprpt   LINE-SIZE 328.
    TABLES : mbew, mver, mseg, mara, mkpf, makt, zqmtsmnm,keko,ckis,marc.
    DATA: PLANT TYPE mard-werks.
    DATA : BEGIN OF it_mbew OCCURS 0,
             bwkey TYPE bwkey,
             bklas LIKE mbew-bklas,
             matnr LIKE mbew-matnr,
             salk3 LIKE mbew-salk3,
             lbkum TYPE p DECIMALS 2,
             stprs LIKE mbew-stprs,
             maktx LIKE makt-maktx,
             werks LIKE mver-werks,
             gjahr LIKE mver-gjahr,
             perkz LIKE mver-perkz,
             meins LIKE mara-meins,
             EKGRP LIKE MARC-EKGRP,
             LABST TYPE p DECIMALS 2,
             EINME LIKE MARD-EINME,
             LABST1 type p DECIMALS 2,
             EINME1 LIKE MARD-EINME,
             TOTUR type p DECIMALS 2,
             SALK1 LIKE MBEW-SALK3,
             SALK2 LIKE MBEW-SALK3,
             letztzug TYPE s032-letztzug,
             letztabg TYPE s032-letztabg,
             letztver TYPE s032-letztver,
             letztbew TYPE s032-letztbew,
             tot_1  TYPE p DECIMALS 2,
             tot_11  TYPE p DECIMALS 2,
             tot_12 TYPE p DECIMALS 2,
             menge LIKE mseg-menge,
             w_lbkum TYPE p DECIMALS 2,
             tot_2  TYPE p DECIMALS 2,
              tot_21  TYPE p DECIMALS 2,
             TOT_3  TYPE P DECIMALS 2,
              TOT_31  TYPE P DECIMALS 2,
            w_consm type p decimals 2,
             w_days  TYPE p,
             erfmg TYPE p DECIMALS 2,
             erfme LIKE mseg-erfme,
             cur_rate LIKE mbew-stprs,
             w_value TYPE i,
              w_value01 TYPE i,
             w_value1 TYPE i,
             w_value11 TYPE i,
    added by mohan on 20/08/2007
             w_value2 type i,
             w_value21 type i,
    --end of addition----
          END OF it_mbew.
    DATA: BEGIN OF it_mard OCCURS 0,
            matnr TYPE mard-matnr,
            werks TYPE mard-werks,
            labst TYPE p DECIMALS 2,
            einme TYPE mard-einme,
            labst1 TYPE p DECIMALS 2,
            einme1 TYPE mard-einme,
           END OF it_mard.
    DATA : BEGIN OF it_mver OCCURS 0,
             werks LIKE mver-werks,
             gjahr LIKE mver-gjahr,
             matnr LIKE mver-matnr,
             perkz LIKE mver-perkz,
             gsv01 LIKE mver-gsv01,
             gsv02 LIKE mver-gsv02,
             gsv03 LIKE mver-gsv03,
             gsv04 LIKE mver-gsv04,
             gsv05 LIKE mver-gsv05,
             gsv06 LIKE mver-gsv06,
             gsv07 LIKE mver-gsv07,
             gsv08 LIKE mver-gsv08,
             gsv09 LIKE mver-gsv09,
             gsv10 LIKE mver-gsv10,
             gsv11 LIKE mver-gsv11,
             gsv12 LIKE mver-gsv12,
             curr_dt(08) TYPE c,
             currdt(2) TYPE n,
             tot_1 LIKE mver-gsv01,
             tot_2 LIKE mver-gsv01,
           END OF it_mver.
    DATA: BEGIN OF it_s032 OCCURS 0,
            matnr TYPE s032-matnr,
            letztzug TYPE s032-letztzug,
            letztabg TYPE s032-letztabg,
            letztver TYPE s032-letztver,
            letztbew TYPE s032-letztbew,
            werks TYPE s032-werks,
          END OF it_s032.
    DATA: it_mbew1 LIKE it_mbew OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF dt OCCURS 0,
             currdt(2) TYPE n,
             curryr(4) TYPE N,
             curryr1(4) TYPE N,
           END OF dt.
    DATA : currdate LIKE sy-datum,
           newdate  LIKE sy-datum.
    DATA : tot_12 LIKE mver-gsv01,
           tot_1  LIKE mver-gsv01,
           tot_2  LIKE mver-gsv01,
         TOT_3  LIKE MVER-GSV01.
    DATA :    abc TYPE p,
    w_mjahr LIKE mseg-mjahr,
           w_bwart LIKE mseg-bwart.
    DATA : w_lbkum TYPE p,
               w_101menge  TYPE P DECIMALS 2,
              w_102menge TYPE P DECIMALS 2.
    DATA : BEGIN OF it_mkpf OCCURS 0,
             budat LIKE mkpf-budat,
             mblnr LIKE mkpf-mblnr,
             MJAHR like mkpf-MJAHR,
           END OF it_mkpf.
    DATA : BEGIN OF it_mseg OCCURS 0,
             bwart LIKE mseg-bwart,
             menge TYPE P DECIMALS 2,
             mjahr LIKE mseg-mjahr,
             mblnr LIKE mseg-mblnr,
             erfmg TYPE p DECIMALS 2,
             erfme LIKE mseg-erfme,
             werks LIKE mseg-werks,
             matnr LIKE mseg-matnr,
            END OF it_mseg.
    *data: it_mseg like table of mseg with header line.
    DATA : BEGIN OF it_mseg1 OCCURS 0,
             w_diffmenge TYPE P DECIMALS 2,
           END OF it_mseg1.
    DATA : w_srno TYPE i,                  " Serial number.
           w_pagectr TYPE i,               " Page counter.
           w_linectr TYPE i.               " Line counter
    DATA: w_pos LIKE ckis-wrtfw_pos,
          w_pfx LIKE ckis-wrtfw_pfx,
          w_pos1 LIKE ckis-wrtfw_pos,
          w_pfx1 LIKE ckis-wrtfw_pfx,
          w_cost LIKE ckis-wrtfw_pos.
    data : curryr2(4) type n,
    curryr3(4) type n.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : BWKEY1 FOR  PLANT .
    *NO DATABASE SELECTION.
    PARAMETERS : p_kadky LIKE keko-kadky OBLIGATORY.
    *----ADDED BY MOHAN ON 20/08/2007--
    SELECT-OPTIONS : BKLAS FOR MBEW-BKLAS.
    SELECT-OPTIONS : EKGRP FOR MARC-EKGRP.
    SELECT-OPTIONS : MATNR FOR MBEW-MATNR.
    --END OF MODIFICATION--
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-001.
    PARAMETERS: p_summ AS CHECKBOX.
    PARAMETERS : SUMMARY RADIOBUTTON GROUP G1,
                 DETAILS RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECT F~bwkey
           F~bklas
           F~matnr
           F~salk3
           F~lbkum
           F~STPRS
           E~EKGRP
           INTO CORRESPONDING FIELDS OF TABLE it_mbew
                  FROM mbew AS F INNER JOIN MARC AS E
                  ON FBWKEY = EWERKS AND FMATNR = EMATNR
                  WHERE F~BKLAS IN BKLAS AND
                        F~BWKEY in BWKEY1 AND
                        F~MATNR IN MATNR AND
                        E~EKGRP IN EKGRP .
    *REFRESH it_mbew.
    *IF it_mbew IS INITIAL.
    *FREE it_mbew.
    *ENDIF.
    SELECT matnr
           werks
           labst
           einme  INTO CORRESPONDING FIELDS OF TABLE IT_MARD
                   FROM MARD
                   FOR ALL ENTRIES IN IT_MBEW
                  WHERE WERKS IN BWKEY1 AND
                        MATNR IN MATNR.
                   WHERE WERKS = IT_MBEW-BWKEY AND
                         MATNR = IT_MBEW-MATNR .
    SELECT werks
           matnr
           letztzug
           letztabg
           letztver
           letztbew
           INTO CORRESPONDING FIELDS OF TABLE IT_S032
           FROM S032
           FOR ALL ENTRIES IN IT_MBEW
           WHERE MATNR = IT_MBEW-MATNR and
                 WERKS = IT_MBEW-BWKEY.
    LOOP AT it_mbew.
      IF it_mbew-lbkum = 0 .
        DELETE it_mbew INDEX sy-tabix.
      ELSE.
      ENDIF.
    ENDLOOP.
    loop at it_mard.
      move it_mard-labst to it_mard-labst1.
      move it_mard-einme to it_mard-einme1.
      collect it_mard.
    endloop.
    CLEAR IT_MARD.
    LOOP AT IT_MARD.
    DELETE ADJACENT DUPLICATES FROM IT_MARD.
    MODIFY IT_MARD.
    ENDLOOP.
    CLEAR IT_MARD.
    *------MODIFIED BY MOHAN ON 21/10/2007
    LOOP AT IT_MBEW.
    READ TABLE IT_MARD  WITH KEY MATNR = IT_MBEW-MATNR
                                 WERKS = IT_MBEW-BWKEY.
      IT_MBEW-LABST = IT_MARD-LABST.
      IT_MBEW-EINME = IT_MARD-EINME.
    MODIFY IT_MBEW.
    ENDLOOP.
    --added by mohan 29/10/2007--
    SORT IT_S032 BY MATNR letztzug descending.
    read table it_s032 index 1.
    LOOP AT IT_MBEW.
      READ TABLE IT_S032 WITH KEY MATNR = IT_MBEW-MATNR
                                 WERKS = IT_MBEW-BWKEY.
      IT_MBEW-LETZTZUG = IT_S032-LETZTZUG.
      MODIFY IT_MBEW.
      clear it_s032.
    ENDLOOP.
    SORT IT_S032 BY MATNR letztabg descending.
    read table it_s032 index 1.
    LOOP AT IT_MBEW.
      READ TABLE IT_S032 WITH KEY MATNR = IT_MBEW-MATNR
                                 WERKS = IT_MBEW-BWKEY.
      IT_MBEW-letztabg = IT_S032-letztabg.
      MODIFY IT_MBEW.
      clear it_s032.
    ENDLOOP.
    SORT IT_S032 BY matnr letztver descending.
    read table it_s032 index 1.
    LOOP AT IT_MBEW.
      READ TABLE IT_S032 WITH KEY MATNR = IT_MBEW-MATNR
                                  WERKS = IT_MBEW-BWKEY.
      IT_MBEW-letztver = IT_S032-letztver.
      MODIFY IT_MBEW.
      clear it_s032.
    ENDLOOP.
    SORT IT_S032 BY letztbew descending.
    read table it_s032 index 1.
    LOOP AT IT_MBEW.
      READ TABLE IT_S032 WITH KEY MATNR = IT_MBEW-MATNR
                                  WERKS = IT_MBEW-BWKEY.
      IT_MBEW-letztbew = IT_S032-letztbew.
      MODIFY IT_MBEW.
      clear it_s032.
    ENDLOOP.
    SORT it_mbew BY matnr.
    LOOP AT it_mbew.
      SELECT SINGLE werks gjahr perkz INTO (mver-werks, mver-gjahr,
                                            mver-perkz)
                                            FROM mver
                                            WHERE matnr = it_mbew-matnr AND
                                            werks IN bwkey1.
      SELECT SINGLE meins INTO mara-meins
                          FROM mara
                          WHERE matnr = it_mbew-matnr.
      SELECT SINGLE maktx INTO makt-maktx
                          FROM makt
                          WHERE matnr = it_mbew-matnr.
      it_mbew-werks = mver-werks.
      it_mbew-gjahr = mver-gjahr.
      it_mbew-perkz = mver-perkz.
      it_mbew-meins = mara-meins.
      it_mbew-maktx = makt-maktx.
      MODIFY it_mbew.
    ENDLOOP.
    **DATA INTO INTERNAL TABLE OF IT_MVER.
    **LOGIC FOR GETTING PREVIOUS 6 MONTHS DATA.
    *ADDED BY MOHAN ON 20/08/2007
    SORT it_mbew BY matnr werks gjahr.
    LOOP AT it_mbew.
      dt-curryr = p_kadky+0(4).
      APPEND dt.
      SELECT  * INTO  CORRESPONDING FIELDS OF TABLE it_mver FROM mver
                        WHERE matnr = it_mbew-matnr AND
                              werks = it_mbew-werks
                              AND
                              perkz = 'P'.
    **LOGIC FOR GETTING PREVIOUS 6 MONTHS DATA.
      LOOP AT it_mver.
        if p_kadky+4(2) = '01'.
          dt-currdt = '10'.
          APPEND dt.
        elseif p_kadky+4(2) = '02'.
          dt-currdt = '11'.
          APPEND dt.
        elseif p_kadky+4(2) = '03'.
          dt-currdt = 12.
          APPEND dt.
        elseif p_kadky+4(2) = '04'.
          dt-currdt = '01'.
          APPEND dt.
        elseif p_kadky+4(2) = '05'.
          dt-currdt = '02'.
          APPEND dt.
        elseif p_kadky+4(2) = '06'.
          dt-currdt = '03'.
          APPEND dt.
        elseif p_kadky+4(2) = '07'.
          dt-currdt = '04'.
          APPEND dt.
        elseif p_kadky+4(2) = '08'.
          dt-currdt = '05'.
          APPEND dt.
        elseif p_kadky+4(2) = '09'.
          dt-currdt = '06'.
          APPEND dt.
        elseif p_kadky+4(2) = '10'.
          dt-currdt = '07'.
          APPEND dt.
        elseif p_kadky+4(2) = '11'.
          dt-currdt = '08'.
          APPEND dt.
        elseif p_kadky+4(2) = '12'.
          dt-currdt = '09'.
          APPEND dt.
        endif.
        IF dt-currdt EQ '01'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_3 = it_mver-gsv10 + it_mver-gsv11 + it_mver-gsv12 +
    it_mver-gsv07  +  it_mver-gsv08  + it_mver-gsv09.
          endif.
        ELSEIF dt-currdt EQ '02'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_3 = it_mver-gsv10
                 +  it_mver-gsv11 + it_mver-gsv12 + it_mver-gsv08  +
               it_mver-gsv09 .
          endif.
           if it_mver-gjahr = dt-curryr .
            tot_3 =   tot_3 + it_mver-gsv01.
          endif.
        ELSEIF dt-currdt EQ '03'.
          dt-curryr1 = dt-curryr - 1.
                if it_mver-gjahr = dt-curryr1.
            tot_3 =  it_mver-gsv10 + it_mver-gsv11 +
    it_mver-gsv12 + it_mver-gsv09.
          endif.
          if it_mver-gjahr = dt-curryr .
            tot_3 = tot_3 + it_mver-gsv01 + it_mver-gsv02.
          endif.
        ELSEIF dt-currdt EQ '04'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_3 = it_mver-gsv10 + it_mver-gsv11 + it_mver-gsv12.
          endif.
          if it_mver-gjahr = dt-curryr .
            tot_3 =  tot_3 + it_mver-gsv01 + it_mver-gsv02 + it_mver-gsv03.
          endif.
        ELSEIF dt-currdt EQ '05'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_3 =  it_mver-gsv11 + it_mver-gsv12.
          endif.
          if it_mver-gjahr = dt-curryr .
            tot_3 =  tot_3 + it_mver-gsv01 +
                it_mver-gsv02 + it_mver-gsv03 + it_mver-gsv04.
          endif.
        ELSEIF dt-currdt EQ '06'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_3 = it_mver-gsv12 .
          endif.
           if it_mver-gjahr = dt-curryr .
            tot_3 = tot_3 +  it_mver-gsv01 + it_mver-gsv02
                    + it_mver-gsv03 + it_mver-gsv04 + it_mver-gsv05.
          endif.
        ELSEIF dt-currdt EQ '07'.
         if it_mver-gjahr = dt-curryr .
          tot_3 = it_mver-gsv01 + it_mver-gsv02 + it_mver-gsv03
                  + it_mver-gsv04 + it_mver-gsv05 + it_mver-gsv06.
            endif.
        ELSEIF dt-currdt EQ '08'.
         if it_mver-gjahr = dt-curryr .
          tot_3 = it_mver-gsv02 + it_mver-gsv03 + it_mver-gsv04
                  + it_mver-gsv05 + it_mver-gsv06 + it_mver-gsv07.
           endif.
        ELSEIF dt-currdt EQ '09'.
         if it_mver-gjahr = dt-curryr .
          tot_3 = it_mver-gsv03 + it_mver-gsv04 + it_mver-gsv05
                  + it_mver-gsv06 + it_mver-gsv07 + it_mver-gsv08.
                 endif.
        ELSEIF dt-currdt EQ '10'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1 .
            tot_3 = it_mver-gsv04 + it_mver-gsv05 + it_mver-gsv06
                    + it_mver-gsv07 + it_mver-gsv08 + it_mver-gsv09.
          endif.
        ELSEIF dt-currdt EQ '11'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1 .
            tot_3 = it_mver-gsv05 + it_mver-gsv06 + it_mver-gsv07
                    + it_mver-gsv08 + it_mver-gsv09 + + it_mver-gsv10.
          endif.
        ELSEIF dt-currdt EQ '12'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1 .
            tot_3 =   it_mver-gsv06 + it_mver-gsv07 + it_mver-gsv08
                      + it_mver-gsv09 + it_mver-gsv10 + it_mver-gsv11 .
          endif.
        ENDIF.
    **MODIFYING THE VARIABLE TOT_1.
        it_mbew-tot_3 = tot_3.
        MODIFY it_mbew TRANSPORTING tot_3.
         IF dt-currdt EQ '01'.
    dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_1 = it_mver-gsv10 + it_mver-gsv11 + it_mver-gsv12.
          endif.
        ELSEIF dt-currdt EQ '02'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_1 = it_mver-gsv11 + it_mver-gsv12 .
          endif.
           if it_mver-gjahr = dt-curryr .
            tot_1 = tot_1 + it_mver-gsv01.
          endif.
        ELSEIF dt-currdt EQ '03'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_1 =  it_mver-gsv12.
          endif.
           if it_mver-gjahr = dt-curryr .
            tot_1 = tot_1 + it_mver-gsv01 + it_mver-gsv02.
          endif.
        ELSEIF dt-currdt EQ '04'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_1 = it_mver-gsv01 + it_mver-gsv02 + it_mver-gsv03.
          endif.
        ELSEIF dt-currdt EQ '05'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_1 =  it_mver-gsv01 +
                it_mver-gsv02 + it_mver-gsv03 + it_mver-gsv04.
          endif.
        ELSEIF dt-currdt EQ '06'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_1 = it_mver-gsv03 + it_mver-gsv04 + it_mver-gsv05.
          endif.
        ELSEIF dt-currdt EQ '07'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1 .
            tot_1 =  it_mver-gsv04 + it_mver-gsv05 + it_mver-gsv06.
          endif.
        ELSEIF dt-currdt EQ '08'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_1 = it_mver-gsv05 + it_mver-gsv06 + it_mver-gsv07.
          endif.
        ELSEIF dt-currdt EQ '09'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_1 = it_mver-gsv06 + it_mver-gsv07 + it_mver-gsv08.
          endif.
        ELSEIF dt-currdt EQ '10'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_1 = it_mver-gsv07 + it_mver-gsv08 + it_mver-gsv09.
          endif.
        ELSEIF dt-currdt EQ '11'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
                    tot_1 = it_mver-gsv08 + it_mver-gsv09 +  it_mver-gsv10.
          endif.
        ELSEIF dt-currdt EQ '12'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_1 = it_mver-gsv09 + it_mver-gsv10 + it_mver-gsv11.
          endif.
        ENDIF.
        it_mbew-tot_1 = tot_1.
        MODIFY it_mbew TRANSPORTING tot_1.
         if p_kadky+4(2) = '01'.
          dt-currdt = '10'.
          APPEND dt.
        elseif p_kadky+4(2) = '02'.
          dt-currdt = '11'.
          APPEND dt.
        elseif p_kadky+4(2) = '03'.
          dt-currdt = 12.
          APPEND dt.
        elseif p_kadky+4(2) = '04'.
          dt-currdt = '01'.
          APPEND dt.
        elseif p_kadky+4(2) = '05'.
          dt-currdt = '02'.
          APPEND dt.
        elseif p_kadky+4(2) = '06'.
          dt-currdt = '03'.
          APPEND dt.
        elseif p_kadky+4(2) = '07'.
          dt-currdt = '04'.
          APPEND dt.
        elseif p_kadky+4(2) = '08'.
          dt-currdt = '05'.
          APPEND dt.
        elseif p_kadky+4(2) = '09'.
          dt-currdt = '06'.
          APPEND dt.
        elseif p_kadky+4(2) = '10'.
          dt-currdt = '07'.
          APPEND dt.
        elseif p_kadky+4(2) = '11'.
          dt-currdt = '08'.
          APPEND dt.
        elseif p_kadky+4(2) = '12'.
          dt-currdt = '09'.
          APPEND dt.
        endif.
        IF dt-currdt EQ '01'.
    dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_2 = it_mver-gsv12 .
          endif.
        ELSEIF dt-currdt EQ '02'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 = it_mver-gsv01.
          endif.
        ELSEIF dt-currdt EQ '03'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 =  it_mver-gsv02.
          endif.
        ELSEIF dt-currdt EQ '04'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 = it_mver-gsv03.
          endif.
        ELSEIF dt-currdt EQ '05'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 =  it_mver-gsv04.
          endif.
        ELSEIF dt-currdt EQ '06'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 = it_mver-gsv05.
          endif.
        ELSEIF dt-currdt EQ '07'.
          dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
            tot_2 =  it_mver-gsv06.
          endif.
        ELSEIF dt-currdt EQ '08'.
         dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr.
          tot_2 = it_mver-gsv07.
          endif.
        ELSEIF dt-currdt EQ '09'.
         dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr .
          tot_2 = it_mver-gsv08.
          endif.
        ELSEIF dt-currdt EQ '10'.
          if it_mver-gjahr = dt-curryr1.
            tot_2 = it_mver-gsv09.
          endif.
        ELSEIF dt-currdt EQ '11'.
          dt-curryr1 = dt-curryr - 1.
         if it_mver-gjahr = dt-curryr1.
            tot_2 = it_mver-gsv10.
          endif.
        ELSEIF dt-currdt EQ '12'.
              dt-curryr1 = dt-curryr - 1.
          if it_mver-gjahr = dt-curryr1.
            tot_2 = it_mver-gsv11.
          endif.
        ENDIF.
    *****MODIFYING THE VARIABLE TOT_2.
        it_mbew-tot_2 = tot_2.
        MODIFY it_mbew TRANSPORTING tot_2.
    ENDLOOP.
    SELECT SINGLE RATE FROM ZPPTMB5L INTO W_COST
      WHERE BWKEY = IT_MBEW-BWKEY AND
            MATNR = IT_MBEW-MATNR.
        it_mbew-cur_rate = w_cost.
        MODIFY it_mbew.
        CLEAR: w_cost,marc-losgr,w_pos1,w_pfx1.
    ENDIF.
    it_mbew-w_value = it_mbew-cur_rate * it_mbew-tot_1.
      MODIFY it_mbew .
      it_mbew-w_value1 = it_mbew-cur_rate * it_mbew-tot_2.
      MODIFY it_mbew .
    --added by mohan on 20/08/2007--
      it_mbew-w_value2 = it_mbew-cur_rate * it_mbew-tot_3.
      MODIFY it_mbew .
      IT_MBEW-SALK1  = IT_MBEW-LBKUM * IT_MBEW-cur_rate.
      IT_MBEW-TOTUR  = IT_MBEW-LABST + IT_MBEW-EINME.
      IT_MBEW-SALK2  = IT_MBEW-TOTUR * IT_MBEW-cur_rate.
      MODIFY IT_MBEW.
       currdate = sy-datum.
      CALL FUNCTION 'CCM_GO_BACK_MONTHS'
        EXPORTING
          currdate   = currdate
          backmonths = '3'
        IMPORTING
          newdate    = newdate.
    curryr2 = currdate+0(4).
    curryr3 = newdate+0(4).
      SELECT matnr menge mblnr mjahr bwart werks erfmg erfme
                   INTO  CORRESPONDING FIELDS OF table it_mseg FROM mseg
                                        WHERE
                                            matnr in matnr
                                             matnr = it_mbew-matnr
                                             AND
                                             mjahr le curryr2 and
                                             mjahr ge curryr3
                                              AND
                                            bwart IN ('101','102') and
                                           mblnr = it_mkpf-mblnr.
    *change by 5-10-2007
                                            werks = it_mbew-BWKEY.
        SELECT mblnr budat mjahr INTO CORRESPONDING FIELDS OF TABLE
                     it_mkpf FROM mkpf  WHERE budat GE newdate
                                 AND
                              budat LE currdate
                              AND
                                             mjahr le curryr2 and
                                             mjahr ge curryr3.
      loop at it_mseg.
      loop at it_mkpf.
      IF it_mseg-bwart = '101' and it_mseg-mblnr = it_mkpf-mblnr.
          w_101menge = w_101menge + it_mseg-menge.
        ELSEIF it_mseg-bwart = '102' and  it_mseg-mblnr = it_mkpf-mblnr.
          w_102menge = w_102menge + it_mseg-menge.
    endif.
          it_mseg1-w_diffmenge = w_101menge - w_102menge.
      ENDLOOP.
    endloop.
      clear : w_102menge,w_101menge.
      it_mbew-erfmg = it_mseg1-w_diffmenge.
      it_mbew-erfme = it_mseg-erfme.
      MODIFY it_mbew TRANSPORTING erfmg erfme.
      IF it_mbew-tot_1 = 0.
      ELSE.
        it_mbew-w_days = it_mbew-lbkum / ( it_mbew-tot_1 / 90 ).
      ENDIF.
    it_mbew-w_days = w_days.
      MODIFY it_mbew TRANSPORTING w_days.
    ENDLOOP.
    clear  IT_MARD[].
    clear  IT_S032[].
    clear  IT_S032[].
    clear it_mard[].
    clear: it_mver,it_mver[].
    CLEAR : it_mseg1[], it_mseg1.
    clear : it_mkpf[], it_mkpf.
    clear  IT_MARD[].
    clear  IT_S032[].
    clear  IT_S032[].
    clear it_mard.
    clear : it_mseg[],it_mseg, it_mkpf[], it_mkpf.
    free : it_mseg[],it_mseg, it_mkpf[], it_mkpf.
      SORT it_mbew BY bwkey.
      LOOP AT it_mbew.
      IF p_summ = 'X'.
        MOVE it_mbew-bwkey TO it_mbew1-bwkey.
        it_mbew1-tot_1 = it_mbew-tot_1.
        it_mbew1-tot_2 = it_mbew-tot_2.
        it_mbew1-tot_3 = it_mbew-tot_3.
        it_mbew1-w_value  = it_mbew-w_value.
        it_mbew1-w_value1 = it_mbew-w_value1.
        it_mbew1-w_value2 = it_MBEW-W_VALUE2.
        COLLECT it_mbew1.
    elseif summary = 'X'.
        AT FIRST.
          w_pagectr = 1.
          PERFORM header.
        ENDAT.
        FORMAT COLOR 2 ON INTENSIFIED.
        WRITE : /01 sy-vline,
                     02 it_mbew-bwkey,                      10 sy-vline,
                     11 it_mbew-bklas,                      20 sy-vline,
                     21 IT_MBEW-EKGRP,                      27 SY-VLINE,
                     28 it_mbew-matnr+11(7),                39 sy-vline,
                     40 it_mbew-maktx,                      80 sy-vline,
                     81 it_mbew-cur_rate  CENTERED,         91 sy-vline,
                     92(13) it_mbew-lbkum right-justified,  105 sy-vline,
                    106 it_mbew-meins,                     111 sy-vline,
                    112 IT_MBEW-SALK1 left-justified,      126 SY-VLINE,
                    127(13) IT_MBEW-TOTUR right-justified,  141 SY-VLINE,
                    142 IT_MBEW-SALK2 left-justified,      156 SY-VLINE,
                   157(10) IT_MBEW-TOT_3 right-justified,  170 SY-VLINE,
                    171 IT_MBEW-W_VALUE2 left-justified,   184 SY-VLINE,
                   185(10) it_mbew-tot_1 right-justified,   198 sy-vline,
                    199 it_mbew-w_value left-justified,    212 sy-vline,
                    213 it_mbew-w_days CENTERED,           223 sy-vline,
                   224(10) it_mbew-tot_2 right-justified,      237 sy-vline,
                   238 it_mbew-w_value1 left-justified,        251 sy-vline.
        FORMAT COLOR 2 OFF INTENSIFIED.
    ENDLOOP.
      ULINE (251).
    elseif details = 'X'.
    LOOP AT it_mbew.
        AT FIRST.
          w_pagectr = 1.
          PERFORM header1.
        ENDAT.
        FORMAT COLOR 2 ON INTENSIFIED.
        WRITE : /01 sy-vline,
                     02 it_mbew-bwkey,                        10 sy-vline,
                     11 it_mbew-bklas,                        20 sy-vline,
                     21 IT_MBEW-EKGRP,                        27 SY-VLINE,
                     28 it_mbew-matnr+11(7),                  39 sy-vline,
                     40 it_mbew-maktx,                        80 sy-vline,
                  81(10) it_mbew-erfmg   right-justified,   93 sy-vline
                  94(10) it_mbew-erfme  right-justified,    104 sy-vline,
                    105 it_mbew-letztzug,                     117 sy-vline,
                    118 it_mbew-letztabg ,                     129 sy-vline,
                    130 it_mbew-letztver,                     141 sy-vline,
                    142 it_mbew-letztbew,                     153 sy-vline.
        FORMAT COLOR 2 OFF INTENSIFIED.
      ULINE /(153).
    ENDIF.
      ENDLOOP.
    LOOP AT it_mbew1.
        AT FIRST.
          w_pagectr = 1.
          PERFORM summary.
        ENDAT.
    ************************by ganesh
        it_mbew1-tot_31 = it_mbew1-tot_31 + it_mbew1-tot_3.
        it_mbew1-tot_21 = it_mbew1-tot_21 + it_mbew1-tot_2.
        it_mbew1-tot_11 = it_mbew1-tot_11 + it_mbew1-tot_1.
        it_mbew1-w_value01 = it_mbew1-w_value01 + it_mbew1-w_value.
        it_mbew1-w_value11 = it_mbew1-w_value11 + it_mbew1-w_value1.
        it_mbew1-w_value21 = it_mbew1-w_value21 + it_mbew1-w_value2.
        WRITE: /01 sy-vline,
                10 sy-vline,
                26 sy-vline,
                44 sy-vline,
                63 sy-vline,
                82 sy-vline,
                101 sy-vline,
                119 sy-vline.
        WRITE: 02 it_mbew1-bwkey  COLOR 4    , 10 sy-vline.
        WRITE: 01 sy-vline,
              11   it_mbew-tot_3    centered  color 7, 26 sy-vline,
                11   it_mbew1-tot_31    centered  color 7, 26 sy-vline,
              27 it_mbew1-tot_1    CENTERED COLOR 7,  44 sy-vline,
                27   it_mbew1-tot_11    CENTERED COLOR 7,  44 sy-vline,
              45 it_mbew1-tot_2    CENTERED COLOR 7, 63 sy-vline,
                45   it_mbew1-tot_21      CENTERED COLOR 7, 63 sy-vline,
               64 it_mbew1-w_value21  centered color 7, 82 sy-vline,
               83 it_mbew1-w_value01  CENTERED COLOR 7, 101 sy-vline ,
              102 it_mbew1-w_value11 CENTERED COLOR 7, 119 sy-vline.
      ENDLOOP.
      CLEAR : it_mbew1[] , it_mbew1.
      free : it_mbew1[] , it_mbew1.
    ULINE /(119).
    clear : it_mseg[],it_mseg, it_mkpf[], it_mkpf, IT_MBEW, IT_MBEW[].
    free: it_mseg[],it_mseg, it_mkpf[], it_mkpf, IT_MBEW, IT_MBEW[].
    *&      Form  header
          text
    -->  p1        text
    <--  p2        text
    FORM header .
      WRITE :  AT 110 'Page : ', w_pagectr COLOR 7.
      WRITE : /50 ' KANSAI NEROLAC PAINTS LIMITED' COLOR 7.
      WRITE : /50 '----
      WRITE : /50 'INTERMEDIATE INVENTORY REPORT' COLOR 7. " ADDED BY
      WRITE : /2  'DATE', sy-datum COLOR 6 INVERSE ON.   "AMRITANSHU
      FORMAT COLOR 7.
      ULINE /(251).
      FORMAT COLOR 4  ON INTENSIFIED.
      WRITE : /01 sy-vline,
               02 'FACTORY',                   10 sy-vline,
               11 'VALUATION',                 20 sy-vline,
               21 'PURCH',                     27 SY-VLINE,
               28 'MATERIAL',                  39 sy-vline,
               40 'MATERIAL DESCRIPTION',      80 sy-vline,
               81 'RATE',                      91 sy-vline,
               92 'TOTAL STOCK',              105 sy-vline,
              106  'UOM' ,                    111 SY-VLINE,
              112 'TOTAL VALUE',              126 sy-vline,
              127 'TOT UNRES & RES',          141 SY-VLINE,
              142 'TOT UNRES & RES' ,         156 SY-VLINE,
              157 'QUANTITY',                 170 sy-vline,
              171 'VALUE CONSUMP',            184 sy-vline,
              185 'QUANTITY',                 198 sy-vline,
              199 'VALUE CONSUMP',            212 sy-vline,
              213 'NO.OF DAYS',               223 sy-vline,
              224 'QUANTITY',                 237 sy-vline,
              238 'VALUE CONSUMP',            251 sy-vline.
      FORMAT COLOR 4 OFF INTENSIFIED.
      WRITE:  /01 sy-vline,
              10 sy-vline ,
              11 'CLASS'       COLOR 4,
              20 sy-vline,
              21 'GROUP' COLOR 4,
              27 sy-vline,
              39 sy-vline,
              80 sy-vline,
              91 SY-VLINE,
              105 SY-VLINE,
              111 SY-VLINE,
              112 '(INR)' COLOR 4,
              126 SY-VLINE,
              127 '  STOCK  ' COLOR 4,
              141 SY-VLINE,
              142 '(INR)' COLOR 4,
              156 SY-VLINE,
              157 'IN 6 MNTHS' COLOR 4,
              170 SY-VLINE,
              171 'IN 6 MNTHS' COLOR 4,
              184 SY-VLINE,
              185 'IN 3 MNTHS' COLOR 4,
              198 SY-VLINE,
              199 'IN 3 MNTHS' COLOR 4,
              212 SY-VLINE,
              213 '(INVENTORY)' COLOR 4,
              223 sy-vline,
              224 'IN 1 MNTHS' COLOR 4,
              237 SY-VLINE,
              238 'IN 1 MNTHS' COLOR 4,
              251 SY-VLINE.
      ULINE (251).
    ENDFORM.                    " header
    *&      Form  summary
          text
    FORM summary.
      WRITE :  AT 110 'Page : ', w_pagectr COLOR 7.
      WRITE : /50 ' KANSAI NEROLAC PAINTS LIMITED' COLOR 7.
      WRITE : /50 '----
      WRITE : /50 'INTERMEDIATE INVENTORY SUM REPORT' COLOR 7. " ADDED BY
      WRITE : /2  'DATE' , sy-datum COLOR 6 INVERSE ON.    "AMRITANSHU
      FORMAT COLOR 7.
      ULINE /(119).
      FORMAT COLOR 4  ON INTENSIFIED.
      WRITE : /01 sy-vline,
               02 'FACTORY' ,                   10 sy-vline,
               11 '  QUANTITY',                 26 sy-vline,
               27 '   QUANTITY'    ,            44 sy-vline,
               45 '   QUANTITY   ' ,             63 SY-VLINE,
               64 '  Value CONSUMP',             82 sy-vline,
               83 '  Value CONSUMP' ,            101 sy-vline,
               102 '  Value CONSUMP ',           119 sy-vline.
      FORMAT COLOR 4 OFF INTENSIFIED.
      WRITE:  /01 sy-vline,
               10 sy-vline,
               11 ' IN 6 MNTHS    ' COLOR 4,
               26 sy-vline,
               27 ' IN 3 MNTHS    ' COLOR 4,
               44 sy-vline,
               45 '  IN 1 MNTHS   ' COLOR 4,
               63 sy-vline,
               64 '   IN 6 MNTHS  ' COLOR 4,
               82 sy-vline,
               83 '   IN 3 MNTHS  ' COLOR 4,
               101 sy-vline,
               102 '   IN 1 MNTHS ' COLOR 4,
               119 sy-vline.
      ULINE /(119).
    ENDFORM.                    "summary
    *&      Form  header1
          text
    -->  p1        text
    <--  p2        text
    form header1 .
      WRITE :  AT 110 'Page : ', w_pagectr COLOR 7.
      WRITE : /50 ' KANSAI NEROLAC PAINTS LIMITED' COLOR 7.
      WRITE : /50 '----
      WRITE : /50 'INTERMEDIATE INVENTORY REPORT' COLOR 7. " ADDED BY
      WRITE : /2  'DATE', sy-datum COLOR 6 INVERSE ON.   "AMRITANSHU
      FORMAT COLOR 7.
      ULINE /(153).
      FORMAT COLOR 4  ON INTENSIFIED.
      WRITE : /01 sy-vline,

    HI
    and see these points which are very usefull for improve performance of a program
    Ways of Performance Tuning
    1.     Selection Criteria
    2.     Select Statements
    •     Select Queries
    •     SQL Interface
    •     Aggregate Functions
    •     For all Entries
    Select Over more than one Internal table
    Selection Criteria
    1.     Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement. 
    2.     Select with selection list.
    Points # 1/2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Select Statements   Select Queries
    1.     Avoid nested selects
    2.     Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
    3.     When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
    4.     For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit. 
    5.     Use Select Single if all primary key fields are supplied in the Where condition .
    Point # 1
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops  only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
    Point # 2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Point # 3
    To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
    Point # 4
    SELECT * FROM SBOOK INTO SBOOK_WA
      UP TO 1 ROWS
      WHERE CARRID = 'LH'.
    ENDSELECT.
    The above code is more optimized as compared to the code mentioned below for testing existence of a record.
    SELECT * FROM SBOOK INTO SBOOK_WA
        WHERE CARRID = 'LH'.
      EXIT.
    ENDSELECT.
    Point # 5
    If all primary key fields are supplied in the Where condition you can even use Select Single.
    Select Single requires one communication with the database system, whereas Select-Endselect needs two.
    Select Statements           contd..  SQL Interface
    1.     Use column updates instead of single-row updates
    to update your database tables.
    2.     For all frequently used Select statements, try to use an index.
    3.     Using buffered tables improves the performance considerably.
    Point # 1
    SELECT * FROM SFLIGHT INTO SFLIGHT_WA.
      SFLIGHT_WA-SEATSOCC =
        SFLIGHT_WA-SEATSOCC - 1.
      UPDATE SFLIGHT FROM SFLIGHT_WA.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    UPDATE SFLIGHT
           SET SEATSOCC = SEATSOCC - 1.
    Point # 2
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE MANDT IN ( SELECT MANDT FROM T000 )
        AND CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    Point # 3
    Bypassing the buffer increases the network considerably
    SELECT SINGLE * FROM T100 INTO T100_WA
      BYPASSING BUFFER
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    The above mentioned code can be more optimized by using the following code
    SELECT SINGLE * FROM T100  INTO T100_WA
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    Select Statements       contd…           Aggregate Functions
    •     If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates yourself.
    Some of the Aggregate functions allowed in SAP are  MAX, MIN, AVG, SUM, COUNT, COUNT( * )
    Consider the following extract.
                Maxno = 0.
                Select * from zflight where airln = ‘LF’ and cntry = ‘IN’.
                 Check zflight-fligh > maxno.
                 Maxno = zflight-fligh.
                Endselect.
    The  above mentioned code can be much more optimized by using the following code.
    Select max( fligh ) from zflight into maxno where airln = ‘LF’ and cntry = ‘IN’.
    Select Statements    contd…For All Entries
    •     The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
         The plus
    •     Large amount of data
    •     Mixing processing and reading of data
    •     Fast internal reprocessing of data
    •     Fast
         The Minus
    •     Difficult to program/understand
    •     Memory could be critical (use FREE or PACKAGE size)
    Points to be must considered FOR ALL ENTRIES
    •     Check that data is present in the driver table
    •     Sorting the driver table
    •     Removing duplicates from the driver table
    Consider the following piece of extract
    Loop at int_cntry.
           Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
    Endloop.
    The above mentioned can be more optimized by using the following code.
    Sort int_cntry by cntry.
    Delete adjacent duplicates from int_cntry.
    If NOT int_cntry[] is INITIAL.
                Select * from zfligh appending table int_fligh
                For all entries in int_cntry
                Where cntry = int_cntry-cntry.
    Endif.
    Select Statements    contd…  Select Over more than one Internal table
    1.     Its better to use a views instead of nested Select statements.
    2.     To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.
    3.     Instead of using nested Select loops it is often better to use subqueries.
    Point # 1
    SELECT * FROM DD01L INTO DD01L_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND AS4LOCAL = 'A'.
      SELECT SINGLE * FROM DD01T INTO DD01T_WA
        WHERE   DOMNAME    = DD01L_WA-DOMNAME
            AND AS4LOCAL   = 'A'
            AND AS4VERS    = DD01L_WA-AS4VERS
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT.
    The above code can be more optimized by extracting all the data from view DD01V_WA
    SELECT * FROM DD01V INTO  DD01V_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT
    Point # 2
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Point # 3
    SELECT * FROM SPFLI
      INTO TABLE T_SPFLI
      WHERE CITYFROM = 'FRANKFURT'
        AND CITYTO = 'NEW YORK'.
    SELECT * FROM SFLIGHT AS F
        INTO SFLIGHT_WA
        FOR ALL ENTRIES IN T_SPFLI
        WHERE SEATSOCC < F~SEATSMAX
          AND CARRID = T_SPFLI-CARRID
          AND CONNID = T_SPFLI-CONNID
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    The above mentioned code can be even more optimized by using subqueries instead of for all entries.
    SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA
        WHERE SEATSOCC < F~SEATSMAX
          AND EXISTS ( SELECT * FROM SPFLI
                         WHERE CARRID = F~CARRID
                           AND CONNID = F~CONNID
                           AND CITYFROM = 'FRANKFURT'
                           AND CITYTO = 'NEW YORK' )
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    1.     Table operations should be done using explicit work areas rather than via header lines.
    2.     Always try to use binary search instead of linear search. But don’t forget to sort your internal table before that.
    3.     A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime.
    4.     A binary search using secondary index takes considerably less time.
    5.     LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally.
    6.     Modifying selected components using “ MODIFY itab …TRANSPORTING f1 f2.. “ accelerates the task of updating  a line of an internal table.
    Point # 2
    READ TABLE ITAB INTO WA WITH KEY K = 'X‘ BINARY SEARCH.
    IS MUCH FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY K = 'X'.
    If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).
    Point # 3
    READ TABLE ITAB INTO WA WITH KEY K = 'X'. IS FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY (NAME) = 'X'.
    Point # 5
    LOOP AT ITAB INTO WA WHERE K = 'X'.
    ENDLOOP.
    The above code is much faster than using
    LOOP AT ITAB INTO WA.
      CHECK WA-K = 'X'.
    ENDLOOP.
    Point # 6
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1 TRANSPORTING DATE.
    The above code is more optimized as compared to
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1.
    7.     Accessing the table entries directly in a "LOOP ... ASSIGNING ..." accelerates the task of updating a set of lines of an internal table considerably
    8.    If collect semantics is required, it is always better to use to COLLECT rather than READ BINARY and then ADD.
    9.    "APPEND LINES OF itab1 TO itab2" accelerates the task of appending a table to another table considerably as compared to “ LOOP-APPEND-ENDLOOP.”
    10.   “DELETE ADJACENT DUPLICATES“ accelerates the task of deleting duplicate entries considerably as compared to “ READ-LOOP-DELETE-ENDLOOP”.
    11.   "DELETE itab FROM ... TO ..." accelerates the task of deleting a sequence of lines considerably as compared to “  DO -DELETE-ENDDO”.
    Point # 7
    Modifying selected components only makes the program faster as compared to Modifying all lines completely.
    e.g,
    LOOP AT ITAB ASSIGNING <WA>.
      I = SY-TABIX MOD 2.
      IF I = 0.
        <WA>-FLAG = 'X'.
      ENDIF.
    ENDLOOP.
    The above code works faster as compared to
    LOOP AT ITAB INTO WA.
      I = SY-TABIX MOD 2.
      IF I = 0.
        WA-FLAG = 'X'.
        MODIFY ITAB FROM WA.
      ENDIF.
    ENDLOOP.
    Point # 8
    LOOP AT ITAB1 INTO WA1.
      READ TABLE ITAB2 INTO WA2 WITH KEY K = WA1-K BINARY SEARCH.
      IF SY-SUBRC = 0.
        ADD: WA1-VAL1 TO WA2-VAL1,
             WA1-VAL2 TO WA2-VAL2.
        MODIFY ITAB2 FROM WA2 INDEX SY-TABIX TRANSPORTING VAL1 VAL2.
      ELSE.
        INSERT WA1 INTO ITAB2 INDEX SY-TABIX.
      ENDIF.
    ENDLOOP.
    The above code uses BINARY SEARCH for collect semantics. READ BINARY runs in O( log2(n) ) time. The above piece of code can be more optimized by
    LOOP AT ITAB1 INTO WA.
      COLLECT WA INTO ITAB2.
    ENDLOOP.
    SORT ITAB2 BY K.
    COLLECT, however, uses a hash algorithm and is therefore independent
    of the number of entries (i.e. O(1)) .
    Point # 9
    APPEND LINES OF ITAB1 TO ITAB2.
    This is more optimized as compared to
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 10
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING K.
    This is much more optimized as compared to
    READ TABLE ITAB INDEX 1 INTO PREV_LINE.
    LOOP AT ITAB FROM 2 INTO WA.
      IF WA = PREV_LINE.
        DELETE ITAB.
      ELSE.
        PREV_LINE = WA.
      ENDIF.
    ENDLOOP.
    Point # 11
    DELETE ITAB FROM 450 TO 550.
    This is much more optimized as compared to
    DO 101 TIMES.
      DELETE ITAB INDEX 450.
    ENDDO.
    12.   Copying internal tables by using “ITAB2[ ] = ITAB1[ ]” as compared to “LOOP-APPEND-ENDLOOP”.
    13.   Specify the sort key as restrictively as possible to run the program faster.
    Point # 12
    ITAB2[] = ITAB1[].
    This is much more optimized as compared to
    REFRESH ITAB2.
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 13
    “SORT ITAB BY K.” makes the program runs faster as compared to “SORT ITAB.”
    Internal Tables         contd…
    Hashed and Sorted tables
    1.     For single read access hashed tables are more optimized as compared to sorted tables.
    2.      For partial sequential access sorted tables are more optimized as compared to hashed tables
    Hashed And Sorted Tables
    Point # 1
    Consider the following example where HTAB is a hashed table and STAB is a sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE HTAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    This runs faster for single read access as compared to the following same code for sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE STAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    Point # 2
    Similarly for Partial Sequential access the STAB runs faster as compared to HTAB
    LOOP AT STAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.
    This runs faster as compared to
    LOOP AT HTAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.
    <b>Reward if usefull</b>

  • Inconsistent Behavior : error code 20 - attribute or value exists

         We are getting "error code 20 - attribute or value exists" randomly when we try to create a new user in the LDAP system. This error is thrown so randomly that it is really driving us crazy. With same values for all other mandatory fields and with just a different userId, this error is thrown for some cases and not for others. The entry is also NOT getting created in LDAP. We are able to create the same entry directly at the LDAP through jXxplorer.
    Stack Trace:
    Caused By: javax.naming.directory.AttributeInUseException: [LDAP: error code 20 - Attribute Or Value Exists]; remaining name 'cn=sdoc,cn=Users,dc=xxx,dc=xxx'
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3051)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3013)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2820)
        at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(LdapCtx.java:791)
        at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:319)
        at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248)
        at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236)
        at javax.naming.directory.InitialDirContext.createSubcontext(InitialDirContext.java:178)
    Is is a bug in rt.jar? We are using JRE1.6.45. Is there anyway we can increase the logging at the rt.jar?
    Is there anyway we can bypass this error?
    Your help is highly appreciated.

    I found out the reason already. The schema was not configured properly :)

  • Load plan execution return code

    We want to call the LoadPlan via external scheduler.
    The call looks like this:
    ./startloadplan.sh <MYLOADPLAN> GLOBAL "-AGENT_URL=<MYAGENT>"
    The odiagent.log shows me that the loadplan failed. But the Shell Script Return value seems to be always 0.
    Is there a way to create a wrapper script for checking whether the loadplan is actually failed.
    Can anyone please reply

    You should probably follow the topic just below this one : ./startloadplan.sh return code always 0 ;)
    Stefan S has maybe developed his own solution.

  • Help on SPAM: xpra execution, tp buffer inconsistency 008

    I'm trying to ask to this forum, I've never received any kind of suggestion.
    On a Win2k3/mssql 2000/sap 4.7x200 installation, using SPAM 6.20/19 I've encountered an error in XPRA execution (is a tp buffer inconsistency with return code 0008) while I was upgrading basis from KB62042 to KB62046, "Packages in the queue don't exist in the tp buffer". I know for sure the problem is the SPAM version (I avoid this problem on another installation using spam 6.20/20), but now I can't proceed and I don't know absolutely what to do to fix the problem. Can I remove the queue in any way to update the spam and launch again the KB update? And then how can i check the consistency of the system?
    kernel 640 level 155, not unicode. For any other info about configurationm please write!

    Hi Juan,
    I've found 2 files, but the date is old (the newest has 12/02/07). PLEASE NOTE: I've found a MCOD install, the name of db is SVI. However, the file you mentioned (slog0707.svi) contains:
    START CMDIMPORT            SVI L      20070212115248              SVIADM       sapts 20070212115247     
    STOP  CMDIMPORT            SVI L      20070212115250              SVIADM       sapts 20070212115247     
    START imp all              SVI        20070212115251              SVIADM       sapts 20070212115251     
    INFO: event SAP_IMPORT_START triggered successfully
    START DD IMPORT            SVI H      20070212115252              SVIADM       sapts 20070212115251     
    STOP  DD IMPORT            SVI H      20070212115306              SVIADM       sapts 20070212115251     
    START DD ACTIVATION        SVI A      20070212115307              SVIADM       sapts 20070212115251     
    START tp_getprots          SVI J      20070212115307              SVIADM       sapts 20070212115251     
    STOP  tp_getprots          SVI J      20070212115403              SVIADM       sapts 20070212115251     
    STOP  DD ACTIVATION        SVI A      20070212115403              SVIADM       sapts 20070212115251     
    START DISTRIBUTION OF DD-O SVI S      20070212115403              SVIADM       sapts 20070212115251     
    START tp_getprots          SVI S      20070212115403              SVIADM       sapts 20070212115251     
    STOP  tp_getprots          SVI S      20070212115406              SVIADM       sapts 20070212115251     
    STOP  DISTRIBUTION OF DD-O SVI S      20070212115406              SVIADM       sapts 20070212115251     
    INFO  TBATG CONVERSION OF  SVI N      not needed                  SVIADM       sapts 20070212115251     
    START MOVE NAMETABS        SVI 6      20070212115406              SVIADM       sapts 20070212115251     
    START tp_getprots          SVI P      20070212115406              SVIADM       sapts 20070212115251     
    STOP  tp_getprots          SVI P      20070212115428              SVIADM       sapts 20070212115251     
    STOP  MOVE NAMETABS        SVI 6      20070212115428              SVIADM       sapts 20070212115251     
    START MAIN IMPORT          SVI I      20070212115428              SVIADM       sapts 20070212115251     
    STOP  MAIN IMPORT          SVI I      20070212115502              SVIADM       sapts 20070212115251     
    START TBATG CREATION OF EN SVI n      20070212115502              SVIADM       sapts 20070212115251     
    START tp_getprots          SVI Y      20070212115502              SVIADM       sapts 20070212115251     
    STOP  tp_getprots          SVI Y      20070212115509              SVIADM       sapts 20070212115251     
    STOP  TBATG CREATION OF EN SVI n      20070212115509              SVIADM       sapts 20070212115251     
    START EXECUTION OF REPORTS SVI R      20070212115509              SVIADM       sapts 20070212115251     
    START tp_getprots          SVI R      20070212115509              SVIADM       sapts 20070212115251     
    STOP  tp_getprots          SVI R      20070212115515              SVIADM       sapts 20070212115251     
    STOP  EXECUTION OF REPORTS SVI R      20070212115515              SVIADM       sapts 20070212115251     
    INFO: event SAP_IMPORT_STOP triggered successfully
    STOP  imp all              SVI   0004 20070212115515              SVIADM       sapts 20070212115251     
    START CMDIMPORT            SVI L      20070212115708              SVIADM       sapts 20070212115707     
    STOP  CMDIMPORT            SVI L      20070212115729              SVIADM       sapts 20070212115707     
    START DD IMPORT            SVI H      20070212121423              SVIADM       sapts 20070212121423     
    STOP  DD IMPORT            SVI H      20070212121522              SVIADM       sapts 20070212121423     
    START DD ACTIVATION        SVI A      20070212121524              SVIADM       sapts                    
    START tp_getprots          SVI J      20070212121524              SVIADM       sapts                    
    STOP  tp_getprots          SVI J      20070212122051              SVIADM       sapts                    
    STOP  DD ACTIVATION        SVI A      20070212122051              SVIADM       sapts                    
    START imp all              SVI        20070212122053              SVIADM       sapts 20070212122052     
    INFO: event SAP_IMPORT_START triggered successfully
    START DISTRIBUTION OF DD-O SVI S      20070212122053              SVIADM       sapts 20070212122052     
    START tp_getprots          SVI S      20070212122053              SVIADM       sapts 20070212122052     
    STOP  tp_getprots          SVI S      20070212122159              SVIADM       sapts 20070212122052     
    STOP  DISTRIBUTION OF DD-O SVI S      20070212122159              SVIADM       sapts 20070212122052     
    START TBATG CONVERSION OF  SVI N      20070212122159              SVIADM       sapts 20070212122052     
    START tp_getprots          SVI N      20070212122159              SVIADM       sapts 20070212122052     
    STOP  tp_getprots          SVI N      20070212122205              SVIADM       sapts 20070212122052     
    STOP  TBATG CONVERSION OF  SVI N      20070212122205              SVIADM       sapts 20070212122052     
    START MOVE NAMETABS        SVI 6      20070212122205              SVIADM       sapts 20070212122052     
    START tp_getprots          SVI P      20070212122205              SVIADM       sapts 20070212122052     
    STOP  tp_getprots          SVI P      20070212122421              SVIADM       sapts 20070212122052     
    STOP  MOVE NAMETABS        SVI 6      20070212122421              SVIADM       sapts 20070212122052     
    START MAIN IMPORT          SVI I      20070212122421              SVIADM       sapts 20070212122052     
    STOP  MAIN IMPORT          SVI I      20070212124135              SVIADM       sapts 20070212122052     
    START TBATG CREATION OF EN SVI n      20070212124135              SVIADM       sapts 20070212122052     
    START tp_getprots          SVI Y      20070212124136              SVIADM       sapts 20070212122052     
    STOP  tp_getprots          SVI Y      20070212124204              SVIADM       sapts 20070212122052     
    STOP  TBATG CREATION OF EN SVI n      20070212124204              SVIADM       sapts 20070212122052     
    INFO: event SAP_IMPORT_STOP triggered successfully
    STOP  imp all              SVI   0004 20070212124204              SVIADM       sapts 20070212122052     
    START imp all              SVI        20070212125052              SVIADM       sapts 20070212125051     
    INFO: event SAP_IMPORT_START triggered successfully
    INFO  TBATG CONVERSION OF  SVI N      not needed                  SVIADM       sapts 20070212125051     
    START MOVE NAMETABS        SVI 6      20070212125052              SVIADM       sapts 20070212125051     
    START tp_getprots          SVI P      20070212125052              SVIADM       sapts 20070212125051     
    STOP  tp_getprots          SVI P      20070212125053              SVIADM       sapts 20070212125051     
    STOP  MOVE NAMETABS        SVI 6      20070212125053              SVIADM       sapts 20070212125051     
    INFO  TBATG CREATION OF EN SVI n      not needed                  SVIADM       sapts 20070212125051     
    INFO: event SAP_IMPORT_STOP triggered successfully
    STOP  imp all              SVI   0000 20070212125053              SVIADM       sapts 20070212125051     
    START EXECUTION OF REPORTS SVI R      20070212125111              SVIADM       sapts                    
    START tp_getprots          SVI R      20070212125111              SVIADM       sapts                    
    STOP  tp_getprots          SVI R      20070212125637              SVIADM       sapts                    
    STOP  EXECUTION OF REPORTS SVI R      20070212125637              SVIADM       sapts                    
    START CMDIMPORT            SVI L      20070212125901              SVIADM       sapts 20070212125900     
    STOP  CMDIMPORT            SVI L      20070212125910              SVIADM       sapts 20070212125900     
    START DD IMPORT            SVI H      20070212125959              SVIADM       sapts 20070212125959     
    STOP  DD IMPORT            SVI H      20070212130033              SVIADM       sapts 20070212125959     
    START DD ACTIVATION        SVI A      20070212130035              SVIADM       sapts                    
    START tp_getprots          SVI J      20070212130035              SVIADM       sapts                    
    STOP  tp_getprots          SVI J      20070212130221              SVIADM       sapts                    
    STOP  DD ACTIVATION        SVI A      20070212130221              SVIADM       sapts                    
    START imp all              SVI        20070212130223              SVIADM       sapts 20070212130222     
    INFO: event SAP_IMPORT_START triggered successfully
    START DISTRIBUTION OF DD-O SVI S      20070212130223              SVIADM       sapts 20070212130222     
    START tp_getprots          SVI S      20070212130223              SVIADM       sapts 20070212130222     
    STOP  tp_getprots          SVI S      20070212130259              SVIADM       sapts 20070212130222     
    STOP  DISTRIBUTION OF DD-O SVI S      20070212130259              SVIADM       sapts 20070212130222     
    START TBATG CONVERSION OF  SVI N      20070212130259              SVIADM       sapts 20070212130222     
    START tp_getprots          SVI N      20070212130259              SVIADM       sapts 20070212130222     
    STOP  tp_getprots          SVI N      20070212130303              SVIADM       sapts 20070212130222     
    STOP  TBATG CONVERSION OF  SVI N      20070212130303              SVIADM       sapts 20070212130222     
    START MOVE NAMETABS        SVI 6      20070212130303              SVIADM       sapts 20070212130222     
    START tp_getprots          SVI P      20070212130303              SVIADM       sapts 20070212130222     
    STOP  tp_getprots          SVI P      20070212130348              SVIADM       sapts 20070212130222     
    STOP  MOVE NAMETABS        SVI 6      20070212130348              SVIADM       sapts 20070212130222     
    START MAIN IMPORT          SVI I      20070212130348              SVIADM       sapts 20070212130222     
    STOP  MAIN IMPORT          SVI I      20070212130621              SVIADM       sapts 20070212130222     
    START TBATG CREATION OF EN SVI n      20070212130621              SVIADM       sapts 20070212130222     
    START tp_getprots          SVI Y      20070212130621              SVIADM       sapts 20070212130222     
    STOP  tp_getprots          SVI Y      20070212130624              SVIADM       sapts 20070212130222     
    STOP  TBATG CREATION OF EN SVI n      20070212130624              SVIADM       sapts 20070212130222     
    INFO: event SAP_IMPORT_STOP triggered successfully
    STOP  imp all              SVI   0004 20070212130625              SVIADM       sapts 20070212130222     
    START EXECUTION OF REPORTS SVI R      20070212130644              SVIADM       sapts                    
    START tp_getprots          SVI R      20070212130644              SVIADM       sapts                    
    STOP  tp_getprots          SVI R      20070212130701              SVIADM       sapts                    
    STOP  EXECUTION OF REPORTS SVI R      20070212130701              SVIADM       sapts                    
    START CMDIMPORT            SVI L      20070212131803              SVIADM       sapts 20070212131803     
    STOP  CMDIMPORT            SVI L      20070212131840              SVIADM       sapts 20070212131803     
    START DD IMPORT            SVI H      20070212132204              SVIADM       sapts 20070212132203     
    STOP  DD IMPORT            SVI H      20070212132614              SVIADM       sapts 20070212132203     
    START DD ACTIVATION        SVI A      20070212132620              SVIADM       sapts                    
    START tp_getprots          SVI J      20070212132620              SVIADM       sapts                    
    STOP  tp_getprots          SVI J      20070212134527              SVIADM       sapts                    
    STOP  DD ACTIVATION        SVI A      20070212134527              SVIADM       sapts                    
    START imp all              SVI        20070212134530              SVIADM       sapts 20070212134529     
    INFO: event SAP_IMPORT_START triggered successfully
    START DISTRIBUTION OF DD-O SVI S      20070212134530              SVIADM       sapts 20070212134529     
    START tp_getprots          SVI S      20070212134530              SVIADM       sapts 20070212134529     
    STOP  tp_getprots          SVI S      20070212134816              SVIADM       sapts 20070212134529     
    STOP  DISTRIBUTION OF DD-O SVI S      20070212134816              SVIADM       sapts 20070212134529     
    START TBATG CONVERSION OF  SVI N      20070212134816              SVIADM       sapts 20070212134529     
    START tp_getprots          SVI N      20070212134816              SVIADM       sapts 20070212134529     
    STOP  tp_getprots          SVI N      20070212134819              SVIADM       sapts 20070212134529     
    STOP  TBATG CONVERSION OF  SVI N      20070212134819              SVIADM       sapts 20070212134529     
    START MOVE NAMETABS        SVI 6      20070212134819              SVIADM       sapts 20070212134529     
    START tp_getprots          SVI P      20070212134819              SVIADM       sapts 20070212134529     
    STOP  tp_getprots          SVI P      20070212135545              SVIADM       sapts 20070212134529     
    STOP  MOVE NAMETABS        SVI 6      20070212135545              SVIADM       sapts 20070212134529     
    START MAIN IMPORT          SVI I      20070212135545              SVIADM       sapts 20070212134529     
    STOP  MAIN IMPORT          SVI I      20070212142717              SVIADM       sapts 20070212134529     
    START TBATG CREATION OF EN SVI n      20070212142717              SVIADM       sapts 20070212134529     
    START tp_getprots          SVI Y      20070212142717              SVIADM       sapts 20070212134529     
    STOP  tp_getprots          SVI Y      20070212142802              SVIADM       sapts 20070212134529     
    STOP  TBATG CREATION OF EN SVI n      20070212142802              SVIADM       sapts 20070212134529     
    INFO: event SAP_IMPORT_STOP triggered successfully
    STOP  imp all              SVI   0004 20070212142803              SVIADM       sapts 20070212134529     
    START EXECUTION OF REPORTS SVI R      20070212142816              SVIADM       sapts                    
    START tp_getprots          SVI R      20070212142817              SVIADM       sapts                    
    ERROR SAPKH47027           SVI R 0008 20070212143529 SAPUSER      SVIADM       sapts                    
    STOP  tp_getprots          SVI R      20070212143533              SVIADM       sapts                    
    STOP  EXECUTION OF REPORTS SVI R      20070212143533              SVIADM       sapts                    
    START EXECUTION OF REPORTS SVI R      20070212144220              SVIADM       sapts                    
    START tp_getprots          SVI R      20070212144220              SVIADM       sapts                    
    STOP  tp_getprots          SVI R      20070212144221              SVIADM       sapts                    
    STOP  EXECUTION OF REPORTS SVI R      20070212144221              SVIADM       sapts

  • Error patching basis - xpra execution

    I'm trying to patch a sap installation (Win2k3, mssql 2000, sap 4.7x200) but using SPAM 6.20/19 I've encountered an error in XPRA execution (seems to be a tp buffer inconsistency with return code 0008) while I was upgrading basis from KB62042 to KB62046, "Packages in the queue don't exist in the tp buffer". I know for sure the problem is the SPAM version (I avoid this problem on another installation using spam 6.20/20), but now I can't proceed and I don't know absolutely what to do to fix the problem. Does anyone can help me? Is it possible to rollback (but I don't think so) or, in any way, to update the spam and launch again the KB update? Obviously in SAP notes there's no solution. There are more than 4 months that I'm trying to fix this problem. Thank you

    Hi,
    there might be couple of reasons for the TP_STEP_FAILURE, it will occurs in different phase like import_proper and XPRA_EXECUTION phases, so there might be different issues but the errors are same. so please check the logs completely, so that you can get the proper idea of the error situation.
    Any wayz i believe kernel upgrade will resolve your issue. because if your tp and R3trans versions are different then you will get this type of issues.so pleas upgrade you kernel for the latest level.
    i think you can find this information in Note OCS: Known problems with Support Packages for Release 640.
    please have a look on the below link, its a beautiful page explain about all the error situations.
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/c6c2ad98a711d2b429006094b9ea64/content.htm
    -Srini

  • Regarding performance enhancement to reduce execution time

    Hi ,
    actually there is a following piece of code(a SELECT query) in my program,due to which TIME OUT dump occurs.plz help me to modify the code to reduce it's execution time.
    code is:
    DATA: at_seque_extref TYPE zprms_ord_ind OCCURS 0 WITH HEADER LINE.
                SELECT (sv_fields) FROM zprms_ord_ind
                  APPENDING CORRESPONDING FIELDS OF TABLE at_seque
                     UP TO lv_max_sequs ROWS
                      WHERE process_type    IN lr_process_type
                        AND   posting_date    IN lr_pos_date
                        AND   sol_date        IN lr_sol_date
                        AND   changed_at      IN lr_chg_date
                      AND   external_ref    NE space
                        AND  (ls_where)
                        AND   ib_comp_network IN lr_ibc_netw
                        AND   ib_comp_node    IN lr_ibc_node
                        AND   ib_comp_site    IN lr_ibc_site
                    ORDER BY (iv_order_by).
                CLEAR at_seque_extref.
                LOOP AT at_seque.
                  IF at_seque-external_ref CP is_bus_trans_search-external_ref  .
                    MOVE-CORRESPONDING  at_seque TO at_seque_extref.
                    APPEND at_seque_extref.
                  ENDIF.
                ENDLOOP.
                CLEAR at_seque[].
    *the table at_seque[]  type zprms_ord_ind
    Or plz suggest me check points to reduce it's execution time.

    DATA: at_seque_extref TYPE zprms_ord_ind OCCURS 0 WITH HEADER LINE.
    SELECT (sv_fields) FROM zprms_ord_ind
    <b>PACKAGE SIZE 100</b>
    APPENDING CORRESPONDING FIELDS OF TABLE at_seque
    UP TO lv_max_sequs ROWS
    WHERE process_type IN lr_process_type
    AND posting_date IN lr_pos_date
    AND sol_date IN lr_sol_date
    AND changed_at IN lr_chg_date
    AND external_ref NE space
    AND (ls_where)
    AND ib_comp_network IN lr_ibc_netw
    AND ib_comp_node IN lr_ibc_node
    AND ib_comp_site IN lr_ibc_site
    ORDER BY (iv_order_by).
    <b>ENDSELECT.</b>
    CLEAR at_seque_extref.
    LOOP AT at_seque.
    IF at_seque-external_ref CP is_bus_trans_search-external_ref .
    MOVE-CORRESPONDING at_seque TO at_seque_extref.
    APPEND at_seque_extref.
    ENDIF.
    ENDLOOP.
    CLEAR at_seque[].
    Make the necessary modifications.
    Copy paste the code.
    Regards,
    Pavan

  • How to force sql developer to prompt for user input for every execution ?

    Hi Folks,
    Environment: Oracle 11g (on Windows 7)
    SQL Developer: *3.1.07*
    I am executing a PL/SQL code off Sql Developer. The code uses substitution variables to prompt user for input. However,I am only prompted for the user input for the very first run of the code. For the subsequent executions, the code simply picks up the user input from the very first run. This behavior persists for all subsequent runs of the code.
    I have executed the same piece of code from SQL*PLUS and the behavior seems normal (i.e. I am prompted for fresh input for every execution)
    How can flush out the old user input so I can be prompted for new user input for every run of the code in sql developer?
    Thanks in advance
    rogers42

    Hi Rogers42,
    1/try
    undefine
    undefine fred
    select '&&fred' from dual;
    [run this multiple times]
    [prompts gere]
    old:select '&&fred' from dual
    new:select 'a' from dual
    'A'
    a
    [prompts here]
    old:select '&&fred' from dual
    new:select 'b' from dual
    'B'
    b
    2/try
    exit (requires recent version of sql developer: tools->preferences->Database->worksheet->Re-initialize on script exit command)
    select '&&fred' from dual;
    exit
    run this multiple times
    [prompts here]
    old:select '&&fred' from dual
    new:select 'x' from dual
    'X'
    x
    Commit
    [prompts here]
    old:select '&&fred' from dual
    new:select 'y' from dual
    'Y'
    y
    Commit
    3/use &fred instead of &&fred
    For background see
    http://totierne.blogspot.co.uk/2010/04/substitution-and-bind-variables.html
    -Turloch
    SQLDeveloper team

  • MIGO Transaction code debugging...

    Hi Friends,
    I want to display my material details by giving material number and year of the material. its working well for data which is present in database. but when i try to display archived data its showing that 'material Doesn't exist'.
    i have stored all the archived material details which is in internal table. i dont know where to pass this values while execution transaction code 'MIGO' for displaying archived material in MIGO screen.
    please help me on this..
    thanks and regards,
    Raja V.

    hi
    This is too peculiar... but upto my knowledge u should pass them into a BADI and show that the material is archeived one.. *(yet to face such a problem).
    check for any of the following  BADI which is flowing in MIGO as per ur req and
    MB_BATCH_MASTER     
    MB_RESERVATION_BADI 
    MB_QUAN_CHECK_BADI  
    MB_PHYSINV_INTERNAL 
    MB_MIGO_ITEM_BADI   
    MB_MIGO_BADI        
    MB_DOC_BADI_INTERNAL
    MB_DOCUMENT_UPDATE  
    MB_DOCUMENT_BADI    
    MB_CIN_MM07MFB7_QTY 
    MB_CIN_MM07MFB7     
    MB_CIN_LMBMBU04     
    MB_CHECK_LINE_BADI  
    ARC_MM_MATBEL_WRITE 
    ARC_MM_MATBEL_CHECK 
    check with a break-point whether u can bring those line items into this BADI. then it is possible to show an error or popup stating these materials are archeived.
    hope this might help u in some way...
    Regards,
    venkat.

  • Help with a simple pause-code function

    For a week I've been trying to figure out a simple pause-code
    function fror AS 3.0. I need something that pauses AS code for set
    amounts of time. People have tried to help me on this forum, but
    I've still not been able to make the code work.
    Here is what I have at the moment for pause-code (not
    working):
    var intID;
    intID = setInterval(delay, 3000); //this tells flash to wait
    3 seconds
    function delay(){
    clearInterval(intID);
    _root.gotoAndPlay(1); // or do something else...
    The person who supplied me with this code did not include the
    first line "var intID", but as a new flash user, I wasn't sure how
    else to declare intID. Could someone with some flash experience
    walk me through the steps of creating a pause-code function or add
    to the one I have already provided. When I use the above code in my
    flash document, the pause feature does not work at all. It
    essentially skips over the setInterval and clearInterval functions
    and plays the root clip in delay(). I need code meant for AS 3.0
    and I'm becoming increasingly desperate for a response.
    I hope this is understandable and thank you for taking a
    look,
    Sam

    Hello KGlad,
    Thankyou for that information. I had no idea lol. Could you
    please clarify and explain a little more about using the timer
    class to delay execution of code? Possibly provide an example? I
    would be very grateful.
    Thanks,
    Sam

  • Trigger -- if a procedure execution is successfuly

    hi,
    I have to execute a trigger if a procedure say P1 is completed successfully
    Please help me how to solve it
    Thanks in Advance
    Muniyandi

    hi,
    I have to execute a trigger if a procedure say P1 is
    completed successfullyTRIGGER is an indepenedent feature which execute itself for an event you cant execute TRIGGER at yours own disposal ,while procedure can be called or execute at yours own will.You can call procedure within trigger but cant execute trigger explicitly after any execution of code e.g sp,function etc.
    BTW why do you need to call a trigger after successful execution of procedure??
    Khurram

  • Invalid Connection remains connected on AQ by my JMS code while RAC switch

    Hello All,
    Greetings !!
    I am facing a issue with my JMS code which connect to AQ to dequeue the message. While RAC switch of DB instance my code remains with the invalid connection and seems like hung and need to be restart for fresh connection.
    My code works in thread implemented while creates the connection with AQ on initial start-up and keep on dequeue the message on subscription while infinite thread execution.
    Code also have reconnect login in case we face any DB disconnection or exception but here while RAC switch we are not able face any disconnection due to while my reconnect logic is not being called.
    So can anyone advice me how we can get notification in my code about the RAC switch, so that I can call my reconnect logic for fresh connection ??
    Thanks in advance for suggestions.
    BR//
    Sumit

    Sounds like you need to look at FAN (Fast Application Notification) and FCF (Fast Connection Failover):
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/apxracfan.htm#JJDBC28935
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/fstconfo.htm#JJDBC28823
    Not sure how these would be integrated in your application as I'm not a developer but these are the methods Oracle provide to breakout of stale / dead application connections when a RAC instance fails.
    Hope this helps,
    Paul

  • Stop and Pause Buttons and Estimated Execution Time

    I have more or less completed my programme (as attached).
    I am just left with two doubts - first: is it possible to let the user know the estimated time to finish executing the entire code/ running the entire experiment on my devices?
    I am currently trying to calculate this estimated time by using the arithmetic functions and time stamp. I tried putting on both the left and right sides of my case structure but it never runs - I tired running the code and after all other commands are executed, the estimated time is still not displayed. I suspect that even if the estimated time is displayed, it would only be displayed after all other commands are executed.
    I have tried looking up on timed structures but they don't seem to fit the job.
    Do you have any advice on this?
    Second: While loops could only be stopped (by pressing my 'STOP' button/Boolean that is linked to the loop condition) only after the first execution of the loop. How could I let my user stop the execution of code during the first run of the loop or should I wire my code differently using another structure?
    As for the 'Pause' button to pause the VI, I have read about the 'Wait for' function (http://zone.ni.com/reference/en-XX/help/371361H-01/glang/wait_for_front_panel_act/). I am not sure if this is the right function I am looking for and if this function enables the user to 'un-pause'/toggle the switch and enable the execution of the subsequent commands.
    This function seems useful but it does not solve the problem of the while loop having to execute at least once before I terminate it and it seems like this function acts like a 'Stop' function that exits the loop, terminating all commands instead of pausing the VI.
    What is your advice on this?
    Thank you so so much!

    Duplicate Post

Maybe you are looking for