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

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?

  • PL/SQL web service code in 1013 is schema-specific

    When I generate a Web Service from a pl/sql package in 1013 (ea3), the code will only run against the schema that owns any user-defined SQL types that the package references. These types have synonyms on the database, but to get the code to execute against another schema I have to modify the generated type classes and add the owning schema name into the literals in several different places.
    Is there a way I can get the wizards to do this for me?

    Yes, we tried with databse adapter with out any problem. we want specifically with the PL/SQL Web service using the web service wizard.
    Thanks in advance.

  • 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>

  • Preventing JAXB xjc from re-generating java code of import ed schemas...

    Hi, I am using XJC to generate java code from xsd.
    However the xsd I run it on often has imports to another xsd that will be in a jar along with its java classes already existing.
    This jar is on the calsspath too.
    XJC however not only generates java code for existing xsd, but also for every import it has.
    And also for every import each of those imported xsd's might have.
    So if it were a long import chain A->B->C->D it generates code for all.
    How can i get it to generate code for only A and assume all the remaing code can be found on the jars in the classpath.
    The A.xsd also has a catalog file associated with it that has every namespace reference pointing to the correct xsd locations within jars.
    So it even has B->C mapping and C->D mapping. This was needed or else XJC didnt even generate anything at all and complained it could not reach C from B and so on.
    Catalog file solved that problem but not the fact that it keeps regnerating code.
    Thanks
    Edited by: Priyajeet on Dec 9, 2008 1:36 PM

    Problem solved.
    The xjc compiler reads file name in a case-sensitive fashion, even on windows.
    So, common.xsd and Common.xsd are seen as two distinct files.
    This was the cause of the compilation errors, since feature1 imported the schema using the filename Common.xsd, whereas the other schemas imported common using common.xsd
    I hope this could help.
    Salvatore

  • OTT code fused to specific schema

    Hi,
    OTT generates code with referral to types prefixed by a schema name. This makes configuration management and testing very difficult topics using the technology as one have to resort to changing source code to run the programs against different schemas. Typically we have multiple developers each using their own schemas and code gets booked into CVS with a specific schema generated in them which does create a number of predicaments. Does Oracle plan to change this behaviour in a future version ?

    we plan to address this in future releases.

  • 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.

  • 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.

  • Code Color Scheme

    Is there an easy way to change the code color scheme to a
    black background in Dreamweaver MX 2004?
    I would like to code in a color scheme much like gVim with
    the darkblue color scheme.

    Gryphon4200 wrote:
    > That doesn't work since there isn't a color scheme
    template there for color on
    > black background. I can change the background manually
    but then I would have to
    > change each individual highlighting color to suit the
    background. I was
    > wondering if there was a template, plugin, or anything
    that would do it
    > automaticly.
    >
    AFAIK, there is no template available. If having it on a
    black
    background is what you want, you'll need to make the changes
    manually.
    If you think that the ability to choose colour schemes would
    be a useful
    addition to Dreamweaver, file an enhancement request directly
    to the
    development team:
    www.macromedia.com/go/wish
    David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    http://foundationphp.com/

  • Supressing the JAXB code for Extended Schemas using JWSDP

    Hi,
    Im trying to generate the JAXB code for the XML Schema using JWSDP using ANT build tool.
    Q : My schema(eg., Schema01.xsd) extends other two schemas(Schema02.xsd, Schema03.xsd).Here using JWSDP package using ANT Build tool, i want to Generate the JAXB java classes only for Schema01.xsd not for other two schemas.
    Can somebody help in this regard.
    Note : By default using JWSDP, Ant build tool, in "Build.xml" it expects schema name(eg. Schema01.xsd"). when i generate the java code, it generates code for the Schema and as well as its all exetended schemas.
    Q : how can supress generating the java code for the extended schemas.
    Regards
    Madhu

    Hi, no I didn't notice this, tried it now and got
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#"><artist-list offset="0" count="1"><artist type="Group" id="ccd4879c-5e88-4385-b131-bf65296bf245" ext:score="100" xmlns:ext="http://musicbrainz.org/ns/ext#"><name>Echo & The Bunnymen</name><sort-name>Echo & The Bunnymen</sort-name><life-span begin="1978"/></artist></artist-list></metadata>is this right, its different to what I was originally trying to get

  • How can I deal with negative marking in a quiz marking scheme?

    I wonder if anyone can help me with a problem I have in developing the 'code' for a marking scheme for an exam in Captivate 8. I would be very grateful for pointers towards a viable solution. At the moment I am just thrashing around.
    My background is in C++ and I think part of my problem is in trying to find analogues of functions I would use in that environment. My experience with Captivate is limited to developing fairly simple training courses but now I need to put an existing exam on line, maintaining its relatively complicated marking scheme, which is as follows:
    The paper is multiple choice, each question having four statements, one (or at the most two) of which is true. A completely correct answer gets 4 marks so where there are two correct statements each gets 2 marks. So far, so easy.
    The difficulty arises from an element of negative marking. If 3 or more statements are selected, the score is 0 marks. If there is a single correct statement and it and an incorrect statement are selected, the score is 2 marks. If there are 2 correct statements and one of them is selected, the score is 2 marks. If an incorrect statement is selected as well, the score is 1 mark.
    I had assumed I could use conditional logic and user variables on a slide-by-slide basis to provide a score value and then assign it to the appropriate system quiz variable, but it seems I can't assign values to variables in a quiz slide. That would have been too easy...
    So, can anybody advise me on an approach that keeps the advantages of using the quiz framework, including the use of the Review function?
    Any help very gratefully received.

    If you use SCORM 1.2 for reporting, negative scores will be converted to zero, because it doesn't allow negative score.
    If you want to keep to Review functionality, you need to stay with the default question slides. There are some tweaking possibilities but changing the score is not one of them.
    Question Question Slides in Captivate - Captivate blog
    Question Question Slides - Part 2 - Captivate blog
    I think the only possible way is to use JS, but then you'll not be able to keep the functionality of the Question slides, you are in custom question slides. Plenty of examples of custom questions can be found on my blog as well.

  • How to get all input columns of script components checked by default to use the same in code ?

    Hi ,
    I am working on BIML Script component, where I am taking data from OLEDB Source.
    In Script Component I want all the input columns to be checked by default as input.
    I have no idea how to proceed for the same.
    Below is my code :-
    <Biml
    xmlns="http://schemas.varigence.com/biml.xsd">
    <Container
    Name="Load Data Truncate Staging"
    ConstraintMode="Parallel"
    DelayValidation="true" >
    <Tasks>
    <Dataflow
    Name="Archive Data"
    DelayValidation="true" >
    <Transformations>
    <OleDbSource
    Name="Source"
    ConnectionName="DataStaging"
    ValidateExternalMetadata="false"
    LocaleId="None" >
    <VariableInput
    VariableName="User.V_Archivequery"
    />
    </OleDbSource>
    <RowCount
    Name="Count Source Records"
    VariableName="User.sourceRecords"/>-->
    <ScriptComponentTransformation
    ProjectCoreName="MMd5"
    Name="MD5_Checksum">
    <ScriptComponentProject>
    <ScriptComponentProject
    ProjectCoreName="SC_Example.csproj"
    Name="ExampleScriptComponent">
    <AssemblyReferences>
    <AssemblyReference
    AssemblyPath="Microsoft.SqlServer.DTSPipelineWrap"
    />
    <AssemblyReference
    AssemblyPath="Microsoft.SqlServer.DTSRuntimeWrap"
    />
    <AssemblyReference
    AssemblyPath="Microsoft.SqlServer.PipelineHost"
    />
    <AssemblyReference
    AssemblyPath="Microsoft.SqlServer.TxScript"
    />
    <AssemblyReference
    AssemblyPath="System.Windows.Forms.dll"
    />
    <AssemblyReference
    AssemblyPath="System.dll"
    />
    <AssemblyReference
    AssemblyPath="System.AddIn.dll"
    />
    <AssemblyReference
    AssemblyPath="System.Data.dll"
    />
    <AssemblyReference
    AssemblyPath="System.Xml.dll"
    />
    </AssemblyReferences>
    <Files>
    <File
    Path="Properties\AssemblyInfo.cs">
    using System.Reflection;
    using System.Runtime.CompilerServices;
    [assembly: AssemblyTitle("SC_Example.csproj")]
    [assembly: AssemblyDescription("")]
    [assembly: AssemblyConfiguration("")]
    [assembly: AssemblyCompany("Ciber Nederland")]
    [assembly: AssemblyProduct("SC_Example.csproj")]
    [assembly: AssemblyCopyright("Copyright @ Ciber Nederland 2012")]
    [assembly: AssemblyTrademark("")]
    [assembly: AssemblyCulture("")]
    [assembly: AssemblyVersion("1.0.*")]
    </File>
    <File
    Path="main.cs">
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using System.Security.Cryptography;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Reflection;
    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    public override void Input0_ProcessInputRow(Input0Buffer Row)
    string strColumnsValue = string.Empty;
    Type rowType = Row.GetType();
    PropertyInfo columnProperty;
    MD5 md5 = new MD5CryptoServiceProvider();
    Encoder enc = System.Text.Encoding.Unicode.GetEncoder();
    foreach(IDTSInputColumn100 Rw in this.ComponentMetaData.InputCollection[0].InputColumnCollection)
    columnProperty = rowType.GetProperty(Rw.Name);
    strColumnsValue += Convert.ToString(columnProperty.GetValue(Row,null));
    byte[] bbb = new byte[strColumnsValue.Length * 3];
    bbb = UnicodeEncoding.Unicode.GetBytes(strColumnsValue);
    byte[] hash = md5.ComputeHash(bbb);
    String strHash = Convert.ToBase64String(hash);
    Row.RowChecksum = strHash;
    </File>
    </Files>
    <InputBuffer
    Name="Input0">
    </InputBuffer>
    <OutputBuffers>
    <OutputBuffer
    Name="Output0">
    <Columns>
           <Column
    Name="RowChecksum"
    DataType="String"
    Length="1000"/>
    </Columns>
    </OutputBuffer>
    </OutputBuffers>
    </ScriptComponentProject>
    </ScriptComponentProject>
    </ScriptComponentTransformation>
    </Transformations>
    </Dataflow>
    </Tasks>
    </Container>
    </Tasks>
    </Package>
    </Packages>
    </Biml>
    Please suggest me where i am doing mistake.
    Regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    http://stackoverflow.com/questions/21440993/adding-a-script-task-using-biml
    http://stackoverflow.com/questions/22455000/automatically-generate-ssis-package-from-biml-script
    Both links have nothing to do with the question.
    @Vipin: what I did in one of my BIML scripts was looping over the columns using C# in the BIMLScript, and adding each column to the input using this code. Do you have the metadata of the columns somewhere?
    I don't have the scripts with me unfortunately.
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • Is there a way to bring the schema names forward when you deploy a mapping?

    Hi all,
    I am working in a database instance where there are objects in multiple schemas needed for a single mapping. Currently I have to create a grant statement and then create a synonym to get the deployed package to compile and run. Is there an option I can turn on where instead of it just bringing forward "<Table_name>" that it will generate "<Schema_name>"."<Table_name>"?
    This would remove the need for creating all of the synonyms I currently have to create.
    Any help would be appreciated.
    Thanks,
    Shaun

    So you need a different location for each schema, the 'masteruser' that can access all the schemas is used for authentication as below (so MASTERUSER has access to SCOTT and HR), see how MASTERUSER is provided for the user name and the specific schema (HR or SCOTT) provided for the schema:
    !http://blogs.oracle.com/warehousebuilder/schema_mapping_example1.JPG!
    Then when code is generated the schema is added to the table references:
    !http://blogs.oracle.com/warehousebuilder/schema_mapping_example2.JPG!
    Cheers
    David

  • Article Purchasing tax P8 calculation schema

    Please help with following situation:
    1 Purchasing Org for several Comp Codes
    Purchasing Org is not assigned to any of them
    Purchasing Info Records are created at Purchasing Org level
    When tax code P8 is entered for VAT, system issues following error no. 06388:
    ==========
    Not possible to set tax code without tax calculation schema
    Message no. 06388
    Diagnosis
    The system was not able to find an assignment of the entered tax code to a tax calculation schema, because either
    no company code has been maintained for the purchasing organization, or
    no tax calculation schema has been maintained for company code of the relevant plant.
    Procedure (system administrator):
    In the second case (no tax calculation schema maintained) define a calculation schema for the country of the company code via the Financial Accounting Customizing facility.
    ==========
    Of course, Tax calculation schema is assigned to country and tax code also is assigned to specific country.
    Is there any ways to fix this, except PIR creation at Plant level?

    You can create the Reg Info with the Plant and this message will not happens...

  • Error in sample code

    How come we have so many errors in Jdeveloper sample code for creating db schema.

    You will really have to provide more information (what errors, what are you trying to do), because no one will be able to do anything with this kind of limited information.

Maybe you are looking for

  • Xslt urgent problem

    when i use ampersand-hash13; as a special charachterin xsl when i do test xsl at design time and also at run time it shows & amp ;# 13;(no white spaces) any solution Edited by: user11082822 on Oct 17, 2009 12:45 AM Edited by: user11082822 on Oct 17,

  • NEF images loaded on iMAC into PSCC are distorted, but not on Preview or second iMAC or MacBook Air

    NEF images loaded onto one IMAC into PSCC are distorted but show normally in Preview.   Same NEF on second iMAC and MacBook Air are not distorted.   Questions 1.     Is there a setting in PSCC that needs to be tweaked 2.   Is the PSCC loaded on the i

  • So, what do you think I should do?

    So, I'm getting into computer graphics and 3D stuff. I have realized that the Radeon 9600 that is default in my Dual 2.3 G5 isn't the greatest for 3D design. I was @ the Apple store the other day and was trying out the different machines. I'm really

  • Can we do something like.....?

    1     Create Letter' button on the web page will invoke a word exe from the NT server (Assumed, the link between App server and NT server is available)      2     The customer details, operator details, template content needs to be passed runtime whi

  • Privacy settings data - is it safe to delete saved passwords and offline website data?

    As above. Privacy > settings > data - is it safe to delete saved passwords and offline website data? Or can this permanently delete my passwords and I won't be able to access the websites again?