Plan_hash_values changed
Hi All
i have query which is taking more than 2 ours it used to take 10 mins before. I saw the plan_hash_value is changed for that query.
how to fix this issues?
please tell me know to gather the stats/ how to proceed to fix and make sure it use the old hash value.
version :10.2.0.4
thanks
Ryan
Hi,
you can update statistics by using DBMS_STATS,
http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96612/d_stats.htm
http://www.oracle.com/technology/oramag/oracle/06-may/o36asktom.html
thanks
Similar Messages
-
Hi,
I'm trying to find plan changes in same sql statements (same hash_value).
Thinking about query on stats$sql_plan_usage table , but have no idea how to use analytics on that.
Tried some lag approach but no success.
Can You please point me in right direction ?
Basicaly I need report like:
snap_id, snap_time,plan_hash_value, hash_value
1|2009-01-01|12345678|34434343
8|2009-01-09|22222222|34434343
and so on.
Regards.
GrzegorzGot something like this:
select min(rn), min(snap_id), plan_hash_value, hash_value from (
select spu.snap_id,spu.plan_hash_value,spu.hash_value, text_subset,
row_number() over (partition by spu.plan_hash_value,spu.hash_value,spu.dbid, spu.instance_number order by spu.snap_id) rn
from perfstat.stats$sql_plan_usage spu
) group by plan_hash_value, hash_value ;
but I want rows with min 2 plan_hash_value changes , dont want with static plan_hash_value (only 1 record per hash_value).
So 2 or more changes should be reported.
Regards.
Grzegorz -
V$sqlarea and plan_hash_value
If I have a query with multiple child cursors, I can have more than 1 plan_hash_value for the same sql_id.
how does oracle decide which plan_hash_value to put into v$sqlarea which is a rollup to the sql_id level?Guess2 wrote:
If I have a query with multiple child cursors, I can have more than 1 plan_hash_value for the same sql_id.
how does oracle decide which plan_hash_value to put into v$sqlarea which is a rollup to the sql_id level?Let's try a bit of an experiment (in 11.2.0.2) to determine which child cursor's PLAN_HASH_VALUE appears in V$SQLAREA. First, we will create a test table with skewed data:
CREATE TABLE T1 AS
SELECT
ROWNUM C1,
DECODE(ROWNUM,1,1,0) C2,
LPAD('A',255,'A') C3
FROM
DUAL
CONNECT BY
LEVEL<=10000;
CREATE UNIQUE INDEX IND_T1_C1 ON T1(C1);
CREATE INDEX IND_T1_C2 ON T1(C2);
ALTER TABLE T1 MODIFY (C1 NOT NULL, C2 NOT NULL);
EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE,ESTIMATE_PERCENT=>100,METHOD_OPT=>'FOR ALL INDEXED COLUMNS SIZE 254')The initial test:
SET LINESIZE 120
SET PAGESIZE 1000
VARIABLE V1 NUMBER
EXEC :V1:=1
SELECT /*+ BIND_AWARE */
C1,
C2,
C3
FROM
T1
WHERE
C2=:V1;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'TYPICAL'));
SQL_ID 7p4yxrzwwuybt, child number 0
SELECT /*+ BIND_AWARE */ C1, C2, C3 FROM T1 WHERE C2=:V1
Plan hash value: 236868917
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
| 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 136 | 2 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("C2"=:V1)
SELECT
PLAN_HASH_VALUE
FROM
V$SQLAREA
WHERE
SQL_ID='7p4yxrzwwuybt';
PLAN_HASH_VALUE
236868917As shown above, the PLAN_HASH_VALUE was set to 236868917, which is the most recently executed child number.
Trying again with a different bind variable value:
EXEC :V1:=0
SELECT /*+ BIND_AWARE */
C1,
C2,
C3
FROM
T1
WHERE
C2=:V1;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'TYPICAL'));
SQL_ID 7p4yxrzwwuybt, child number 1
SELECT /*+ BIND_AWARE */ C1, C2, C3 FROM T1 WHERE C2=:V1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 33 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 9999 | 1327K| 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("C2"=:V1)
SELECT
PLAN_HASH_VALUE
FROM
V$SQLAREA
WHERE
SQL_ID='7p4yxrzwwuybt';
PLAN_HASH_VALUE
3617692013As shown above, the PLAN_HASH_VALUE changed to the value 3617692013, which is the most recently executed child number.
TRying again without changing the bind variable value:
SELECT /*+ BIND_AWARE */
C1,
C2,
C3
FROM
T1
WHERE
C2=:V1;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'TYPICAL'));
SQL_ID 7p4yxrzwwuybt, child number 1
SELECT /*+ BIND_AWARE */ C1, C2, C3 FROM T1 WHERE C2=:V1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 33 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 9999 | 1327K| 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter("C2"=:V1)
SELECT
PLAN_HASH_VALUE
FROM
V$SQLAREA
WHERE
SQL_ID='7p4yxrzwwuybt';
PLAN_HASH_VALUE
3617692013As shown above, the PLAN_HASH_VALUE remained at the value 3617692013, which is the most recently executed child number.
Switching back to the original bind variable value:
EXEC :V1:=1
SELECT /*+ BIND_AWARE */
C1,
C2,
C3
FROM
T1
WHERE
C2=:V1;
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'TYPICAL'));
SQL_ID 7p4yxrzwwuybt, child number 0
SELECT /*+ BIND_AWARE */ C1, C2, C3 FROM T1 WHERE C2=:V1
Plan hash value: 236868917
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
| 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 136 | 2 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("C2"=:V1)
SELECT
PLAN_HASH_VALUE
FROM
V$SQLAREA
WHERE
SQL_ID='7p4yxrzwwuybt';
PLAN_HASH_VALUE
236868917 As shown above, the PLAN_HASH_VALUE switched back to the original value.
In 11.2.0.2, V$SQLAREA is based on GV$SQLAREA, which is based on the X$KGLCURSOR_CHILD_SQLID structure. You can execute the following SQL statement to show the columns that are retrieved and the corresponding names of those columns in GV$SQLAREA:
SELECT
VIEW_DEFINITION
FROM
V$FIXED_VIEW_DEFINITION
WHERE
VIEW_NAME='GV$SQLAREA';
DESC GV$SQLAREAWe are able to confirm that the most recently executed child cursor number will appear in V$SQLAREA with the following SQL statement (I suggest not running this on a very busy database instance):
SET LINESIZE 120
SET PAGESIZE 1000
SELECT
X.KGLOBT03 SQL_ID,
X.KGLOBT30 PLAN_HASH_VALUE,
TO_CHAR(X.KGLOBCLA,'HH24:MI:SS') LAST_ACTIVE_TIME,
S.CHILD_NUMBER,
S.PLAN_HASH_VALUE S_PLAN_HASH_VALUE,
TO_CHAR(S.LAST_ACTIVE_TIME,'HH24:MI:SS') S_LAST_ACTIVE_TIME,
DECODE(X.KGLOBCLA,S.LAST_ACTIVE_TIME,NULL,'DIFFERENT') TIMESTAMP
FROM
X$KGLCURSOR_CHILD_SQLID X,
V$SQL S
WHERE
X.KGLOBT02 != 0
AND X.KGLOBT03=S.SQL_ID
ORDER BY
S.SQL_ID,
S.CHILD_NUMBER;
SQL_ID PLAN_HASH_VALUE LAST_ACT CHILD_NUMBER S_PLAN_HASH_VALUE S_LAST_A TIMESTAMP
fz2htd7p723p5 3775029212 13:01:24 0 3775029212 13:01:24
fzrshwabvtwc0 3637245398 13:21:28 0 3637245398 13:21:28
fzt8s1f6kmk5k 0 12:58:30 0 0 12:58:30
g00cj285jmgsw 315182377 13:06:24 0 315182377 12:58:30 DIFFERENT
g00cj285jmgsw 315182377 13:06:24 1 315182377 13:06:24
g3wrkmxkxzhf2 749386351 13:21:24 0 749386351 13:21:24
g3wrkmxkxzhf2 749386351 13:21:24 1 749386351 12:51:27 DIFFERENT
ga9j9xk5cy9s0 1697022209 13:01:24 0 1697022209 13:01:24
ga9j9xk5cy9s0 1697022209 13:01:24 1 1697022209 12:51:27 DIFFERENT
grwydz59pu6mc 3684871272 13:21:24 0 3684871272 13:21:24
grwydz59pu6mc 3684871272 13:21:24 1 3684871272 12:51:27 DIFFERENT
gx4mv66pvj3xz 2570921597 13:21:24 0 1932954096 12:51:27 DIFFERENT
gx4mv66pvj3xz 2570921597 13:21:24 1 2570921597 13:21:24
gzyt498gtbgt5 2826905927 12:51:23 0 2826905927 12:51:23As shown above, the child with the most recent LAST_ACTIVE_TIME timestamp appears in V$SQLAREA.
Charles Hooper
http://hoopercharles.wordpress.com/
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
Query to find SQL with changed plans
I am trying to find out which SQL statements have changed plans since they were first executed.
I'm trying to run this on all databases from 9i upwards and I am assuming that I have no licensed access to the AWR. However, Statspack is installed on all databases. (So querying things like STATS$SQL_PLAN is fine).
I am having difficulty understanding what HASH_VALUE, OLD_HASH_VALUE and PLAN_HASH_VALUE are, and how they can be used to help answer the problem. I am also trying not to use SQL_ID, since that column isn't there in 9i (I think), and I'd like something that is generically usable from 9i to 11g, if at all possible.
Any hints, please.
Edited by: Catfive Lander on May 14, 2012 12:01 AMHi Sakshi,
Try out this query if it can help you !
SELECT a.user_name, a.description, c.responsibility_name, c.creation_date as ASSIGNED_DATE>FROM apps.fnd_user a,
>apps.fnd_user_resp_groups b,
>apps.fnd_responsibility_vl c
>WHERE a.user_id = b.user_id
>AND b.responsibility_id = c.responsibility_id
>AND a.creation_date < = '01-JUN-07'
ORDER BY a.user_name;Thanks,
Anchorage :) -
SQL Tuning Advisor evaluates statement using wrong plan_hash_value
The execution plan for one of my SQL statements changed this morning. The statement is in a third-party package. The new plan runs worse than the old plan. I had the SQL tuning advisor evaluate the statement. I ran it three times. Each time it evaluated the original plan, not the new one. I can tell that because the plan_hash_value shown in the advisor's recommendations is the old plan's plan_hash_value. The old plan no longer appears in DBA_HIST_SQL_PLAN. I do not understand why the advisor is using the original plan, nor where it is getting it. It does not show up in Oracle Enterprise Manager either.
Has anyone see this before?
Do you have any suggestions how I can force the advisor to evaluate the new execution plan?
I am running Oracle Database Server 10gR2 Enterprise Edition.
Thanks,
BillFollowing advice given earlier, I ran the SQL Tuning Advisor by executing DBMS_SQLTUNE from within a SQL*Plus session instead of via Oracle Enterprise Manager. The problem I originally encountered in OEM also happened using DBMS_SQLTUNE. Using DBMS_SQLTUNE I specified plan_hash_value => '3657286666' but the results of running create_tuning_task shows that the utility used a different plan_hash_value. See below:
Based on this, I think the problem I originally blamed on OEM's creation of a SQL Tuning Advisor job was misdirected. I now believe that OEM supplied the proper information to the advisor, but the advisor did not correctly use what is was given.
Below is what I submitted when I ran create_tuning_task and execute_tuning_task. Note that the value assigned to plan_hash_value is 3657286666. Following the messages from execute_tuning_task, see the output produced by the execution of report_tuning_task. In EXPLAIN PLANS SECTION heading 1 - ORIGINAL, note that Plan Hash Value = 3541843898.
I submitted instructions to use plan_hash_value 3657286666 but instead it used 3541843898. Why did it do this??????
I have not found a published bug that describes this condition.
Thanks,
Bill
SQL> DECLARE
2 stmt_task VARCHAR2(64);
3 BEGIN
4 stmt_task:=dbms_sqltune.create_tuning_task(sql_id => 'ab30ujpshkur3', plan_hash_
value => '3657286666', time_limit => 3600, task_name => 'Tune_ab30ujpshkur3_3657286666'
, description => 'Task to tune sql_id ab30ujpshkur3 plan_hash_value 3657286666');
5 END;
6 /
PL/SQL procedure successfully completed.
SQL> EXECUTE dbms_sqltune.execute_tuning_task('Tune_ab30ujpshkur3_3657286666');
PL/SQL procedure successfully completed.
Here is the output produced by report_tuning_task:
SQL> SET linesize 200
SQL> SET LONG 999999999
SQL> SET pages 1000
SQL> SET longchunksize 20000
SQL> SELECT dbms_sqltune.report_tuning_task('Tune_ab30ujpshkur3_3657286666', 'TEXT', 'ALL') FROM dual;
SELECT dbms_sqltune.script_tuning_task('Tune_ab30ujpshkur3_3657286666', 'ALL')
FROM dual;
DBMS_SQLTUNE.REPORT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','TEXT','ALL')
GENERAL INFORMATION SECTION
Tuning Task Name : Tune_ab30ujpshkur3_3657286666
Tuning Task Owner : EXPTEST
Tuning Task ID : 110190
Scope : COMPREHENSIVE
Time Limit(seconds) : 3600
Completion Status : COMPLETED
Started at : 08/03/2012 14:47:45
Completed at : 08/03/2012 14:48:54
Number of Index Findings : 1
Schema Name: EXPTEST
SQL ID : ab30ujpshkur3
SQL Text : SELECT ATTACHED_ACC_ID FROM SERVICE_EVENTS WHERE TSERV_ID = :B4
AND EQ_NBR = :B3 AND ASSOC_EQ_NBR = :B2 AND (PERFORMED <= :B1 +
1/1440 AND PERFORMED >= :B1 - 1/1440)
FINDINGS SECTION (1 finding)
1- Index Finding (see explain plans section below)
The execution plan of this statement can be improved by creating one or more
indices.
Recommendation (estimated benefit: 100%)
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index EXPTEST.IDX$$_1AE6E0001 on
EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR');
Rationale
Creating the recommended indices significantly improves the execution plan
of this statement. However, it might be preferable to run "Access Advisor"
using a representative SQL workload as opposed to a single statement. This
will allow to get comprehensive index recommendations which takes into
account index maintenance overhead and additional space consumption.
EXPLAIN PLANS SECTION
1- Original
Plan hash value: 3541843898
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
Time |
| 0 | SELECT STATEMENT | | 1 | 32 | 4 (0)|
00:00:01 |
|* 1 | FILTER | | | | |
|
|* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 4 (0)|
00:00:01 |
|* 3 | INDEX RANGE SCAN | SEVENTS_PERFORMED | 18 | | 2 (0)|
00:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$1
2 - SEL$1 / SERVICE_EVENTS@SEL$1
3 - SEL$1 / SERVICE_EVENTS@SEL$1
Predicate Information (identified by operation id):
1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
444
44444444444444444444)
2 - filter("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2 AND "TSERV_ID"=:B4)
3 - access("PERFORMED">=:B1-.000694444444444444444444444444444444444444 AND
"PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
Column Projection Information (identified by operation id):
1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
3 - "SERVICE_EVENTS".ROWID[ROWID,10]
2- Using New Indices
Plan hash value: 2568062050
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| T
ime |
| 0 | SELECT STATEMENT | | 1 | 32 | 2 (0)| 0
0:00:01 |
|* 1 | FILTER | | | | |
|
|* 2 | TABLE ACCESS BY INDEX ROWID| SERVICE_EVENTS | 1 | 32 | 2 (0)| 0
0:00:01 |
|* 3 | INDEX RANGE SCAN | IDX$$_1AE6E0001 | 1 | | 2 (0)| 0
0:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$1
2 - SEL$1 / SERVICE_EVENTS@SEL$1
3 - SEL$1 / SERVICE_EVENTS@SEL$1
Predicate Information (identified by operation id):
1 - filter(:B1+.000694444444444444444444444444444444444444>=:B1-.0006944444444444444
4
4444444444444444444444)
2 - filter("TSERV_ID"=:B4 AND "PERFORMED">=:B1-.000694444444444444444444444444444444
4
44444 AND "PERFORMED"<=:B1+.000694444444444444444444444444444444444444)
3 - access("EQ_NBR"=:B3 AND "ASSOC_EQ_NBR"=:B2)
Column Projection Information (identified by operation id):
1 - "ATTACHED_ACC_ID"[VARCHAR2,12]
2 - "ATTACHED_ACC_ID"[VARCHAR2,12]
3 - "SERVICE_EVENTS".ROWID[ROWID,10]
SQL> 2
DBMS_SQLTUNE.SCRIPT_TUNING_TASK('TUNE_AB30UJPSHKUR3_3657286666','ALL')
-- Script generated by DBMS_SQLTUNE package, advisor framework --
-- Use this script to implement some of the recommendations --
-- made by the SQL tuning advisor. --
-- NOTE: this script may need to be edited for your system --
-- (index names, privileges, etc) before it is executed. --
create index EXPTEST.IDX$$_1AE6E0001 on EXPTEST.SERVICE_EVENTS('EQ_NBR','ASSOC_EQ_NBR')
; -
How to check query is getting reused after changing parametr cursor_sharing
Hello,
Oracle Version: 11g
OS Version: Windows 2003 64Bit
How to find if a particular query is getting reused after change in a cursor_sharing parameter from EXACT to SIMILAR.
Which set of Views/DD's should i query go get the relevant details.
Thanks in advance.
-Vijay.SQL> desc v$sqlarea
Name Null? Type
SQL_TEXT VARCHAR2(1000)
SQL_FULLTEXT CLOB
SQL_ID VARCHAR2(13)
SHARABLE_MEM NUMBER
PERSISTENT_MEM NUMBER
RUNTIME_MEM NUMBER
SORTS NUMBER
VERSION_COUNT NUMBER
LOADED_VERSIONS NUMBER
OPEN_VERSIONS NUMBER
USERS_OPENING NUMBER
FETCHES NUMBER
EXECUTIONS NUMBER
PX_SERVERS_EXECUTIONS NUMBER
END_OF_FETCH_COUNT NUMBER
USERS_EXECUTING NUMBER
LOADS NUMBER
FIRST_LOAD_TIME VARCHAR2(19)
INVALIDATIONS NUMBER
PARSE_CALLS NUMBER
DISK_READS NUMBER
DIRECT_WRITES NUMBER
BUFFER_GETS NUMBER
APPLICATION_WAIT_TIME NUMBER
CONCURRENCY_WAIT_TIME NUMBER
CLUSTER_WAIT_TIME NUMBER
USER_IO_WAIT_TIME NUMBER
PLSQL_EXEC_TIME NUMBER
JAVA_EXEC_TIME NUMBER
ROWS_PROCESSED NUMBER
COMMAND_TYPE NUMBER
OPTIMIZER_MODE VARCHAR2(10)
OPTIMIZER_COST NUMBER
OPTIMIZER_ENV RAW(797)
OPTIMIZER_ENV_HASH_VALUE NUMBER
PARSING_USER_ID NUMBER
PARSING_SCHEMA_ID NUMBER
PARSING_SCHEMA_NAME VARCHAR2(30)
KEPT_VERSIONS NUMBER
ADDRESS RAW(4)
HASH_VALUE NUMBER
OLD_HASH_VALUE NUMBER
PLAN_HASH_VALUE NUMBER
MODULE VARCHAR2(64)
MODULE_HASH NUMBER
ACTION VARCHAR2(64)
ACTION_HASH NUMBER
SERIALIZABLE_ABORTS NUMBER
OUTLINE_CATEGORY VARCHAR2(64)
CPU_TIME NUMBER
ELAPSED_TIME NUMBER
OUTLINE_SID VARCHAR2(40)
LAST_ACTIVE_CHILD_ADDRESS RAW(4)
REMOTE VARCHAR2(1)
OBJECT_STATUS VARCHAR2(19)
LITERAL_HASH_VALUE NUMBER
LAST_LOAD_TIME DATE
IS_OBSOLETE VARCHAR2(1)
CHILD_LATCH NUMBER
SQL_PROFILE VARCHAR2(64)
PROGRAM_ID NUMBER
PROGRAM_LINE# NUMBER
EXACT_MATCHING_SIGNATURE NUMBER
FORCE_MATCHING_SIGNATURE NUMBER
LAST_ACTIVE_TIME DATE
BIND_DATA RAW(2000) -
BADI for changing fields during Creation of BP in CRM
Hello to everyone,
I need to find a BADI (or other way) to default several fields during BP creation in CRM (4.0 SR1 SP9). The fields I will like to set are TAX TYPE, TAX NUMBER, TAX CATEGORY, etc.. I have found the BADI BUPA_TAX_UPDATE but i dont see any suitable parameters (structures) to changes these fields. Please advice and thanks in advance.Hi
If you use function BUPA_NUMBERS_GET then your BP number will already be buffered and you can avoid a DB read. It may also be that the BP is not in the DB yet anyway.
You can only pass one GUID in at a time - loop through IT_CHANGED_INSTANCES into a variable of type BU_PARTNER_GUID and pass that into the function as input parameter IV_PARTNER_GUID.
Cheers
Dom -
How to restrict manual changing of free goods in sales order
Hi ,
Goodmorning ,
We have some requirement : In sales order free goods quantity determination by system should not be allowed to change manually , where can we do this ?
Looking for your inputs
Thanks and regards
VenkatAs per SAP Standard, when the main Item quantity is changed, the Free Goods are redetermined. In this case any manual changes to Free Goods Quantities are lost.
But your requirement is for restricting the Chages of the Quantity of Free Goods Correct?
I believe there is no SAP standard solution for this. You will have to apply a User Exit, which will check the Item category of each LIne item & if it is free goods (TANN) then changes are not permitted.
Hope this helps.
Thanks,
Jignesh Mehta -
Sy-tabix value has changed...
Hi Gurus,
I am using a code like dis...this is not the actual code m using instad m sendin u a sample program so that u can understand the problem
There is a selecvtion for Customer.
sort itab by kunnr.
loop at itab.
on change of itab-kunnr.
wkunnr = itab-kunnr.
read table zitab with key kunnr = itab-kunnr.
endon.
if itab-kunnr = wkunnr.
wdmbtr = wdmbtr + itab-dmbtr.
endif.
at end of kunnr.
ftab-kunnr = wkunnr.
ftab-dmbtr = wdmbtr.
append ftab.
endat.
endloop.
Now my problem is that AT END OF Kunnr is working fine for the first customer or say for single customer but when there are multiple customers AT END OF kunnr is triggring for each entry.......
In debug MOdei can see that as soon as read table syntax is used the tabix value is changed....
So Can anyone suggest what is the solution....
Regards,
RamanThis is the Declaration
DATA: BEGIN OF ITAB OCCURS 0,
KUNNR LIKE BSID-KUNNR,
BELNR LIKE BSID-BELNR,
BUKRS LIKE BSID-BUKRS,
GJAHR LIKE BSID-GJAHR,
BUZEI LIKE BSID-BUZEI,
SHKZG LIKE BSID-SHKZG,
VALUT LIKE BSID-ZFBDT,
SGTXT(70) TYPE C,
ZFBDT LIKE BSID-ZFBDT,
ZBD1T TYPE BSID-ZBD1T,
ZBD2T TYPE BSID-ZBD2T,
ZBD3T TYPE BSID-ZBD3T,
REBZG TYPE BSID-REBZG,
NETDT TYPE BSID-BUDAT,
ZUONR LIKE BSID-ZUONR,
BLART LIKE BSID-BLART,
DMBTR LIKE BSID-DMBTR,
SPART TYPE VBRK-SPART,
DAY TYPE RFPOSX-VERZN,
FLAG TYPE C,
CITY TYPE KNA1-ORT01,
NAME1 TYPE LFA1-NAME1,
CR_DR1(4) TYPE C,
PSWSL LIKE BSID-PSWSL,
ZTERM LIKE BSID-ZTERM,
VBELN LIKE BSID-VBELN,
UMSKZ LIKE BSID-UMSKZ,
KLIMK LIKE KNKK-KLIMK,
VTEXT LIKE TVZBT-VTEXT,
ADV LIKE BSID-DMBTR,
REBZT TYPE BSID-REBZT,
XBLNR LIKE BSID-XBLNR,
VTEXT1(70) TYPE C,
FKLIMK LIKE KNKK-KLIMK,
ABC(4) TYPE C,
AGRO(4) TYPE C,
BIO(4) TYPE C,
SKFOR LIKE KNKK-SKFOR,
SSOBL LIKE KNKK-SSOBL,
CTLPC LIKE KNKK-CTLPC,
OEIKW LIKE S066-OEIKW,
OLIKW LIKE S067-OLIKW,
OFAKW LIKE S067-OFAKW,
NAME1 LIKE LFA1-NAME1,
BUDAT LIKE BKPF-BUDAT,
D_DMBTR LIKE BSID-DMBTR,
S_DMBTR LIKE BSID-DMBTR,
VORGN LIKE BSEG-VORGN,
WERKS LIKE BSEG-WERKS,
NAMESO LIKE KNA1-NAME1,
NAMEAM LIKE KNA1-NAME1,
NAMERM LIKE KNA1-NAME1,
NAMEDR LIKE KNA1-NAME1,
END OF ITAB. -
ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS
Dear Guru's,
I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
Hope to get reply soon.
Regards,
Himanshu RangappaHi,
There is no system Fields for it.
But your requirement can be done with 'AT NEW' and 'AT END' statement.
Refer this sample example,
loop at otab.
at new module.
move otab-module to otab2-module.
ENDAT.
at END OF effort.
sum. "Do your calculations here
move otab-count to otab2-count.
append otab2.
endat.
endloop. -
How to change SSO Partner Application Login_url and Logout_url
As part of a deployment in a different data centre, we needed to change the domain name of an application using SSO for authentication. We have gone through the process of re-registering the SSO server but this does not update the domain name
By using diagnostic tools from Oracle we have discovered that the file 'osso.conf' in $ORACLE_HOME/Apache/Apache/conf/osso contains incorrect entries for login_url and logout_url.
These settings are of the form:
login_url=http://www.ourolddomain.com/pls/orasso/orasso.wwsso_app_admin.ls_login
logout_url=http://www.ourolddomain.com/pls/orasso/orasso.wwsso_app_admin.ls_logout
Please can anyone tell me how these settings can be changed.Hi,
[Solved] SSO fails to show success page you can find some information on re registering mod_osso.
Hope it helps. -
Battery , time , signal strength bar is not getting displayed in home screen , these will be displayed only when i click on any app. Can u let me know the setting change ?
Did you check the Zoom setting?
Have you tried a reset (reboot)? Hold HOME and SLEEP until an Apple logo appears.
If it isn't Zoom and a reboot doesn't help try Settings/General/Reset - Reset all settings -
Email address change--how does this affect laptop and nook?
I use my Adobe ID only to authorize my laptop and Nook. I need to change my email address which seems easy on the FAQs, but how do I then reauthorize my laptop and Nook? And, if I do this, are all my existing library books unreadable since they were downloaded by what the Nook thinks is a different user? I'm almost sure I won't be able to return any books in ADE on my laptop, but I can live with that if I can still read the books on the Nook.
Thanks in advance.The sync process with iTunes transfers the email account settings (for your chosen accounts via your iPhone sync preferences) from the Mail application on your Mac to the iPhone's email application.
The iPhone is running OS X and the iPhone's email client can be considered a mobile version of the Mail application. -
when i contol click on the downloads icon in the dock i get the gris view . I thought if you control click, you are able to change the view to fan or list. am I doing something wrong.? Icheck to make sure the contol key is working by doing a screenshot and it works there. What am I doing wrong?
Needs to be a Stack ?
-
If I chose the wrong folder as defaulf for downloads to go to, how can I change it?
I use download manager. I hit '''yes''' when asked if I wanted to make the folder shown as the default for future downloads of that type. I did not mean to do that. How can I change the default folder?
Hi belladonna82,
You should take a look at the [[Downloads window]] and [[Options window - General panel]] Knowledge Base articles. They will give you all the details you need. Unless you are talking about the default action and not the actual download folder? If so, you should look at [[Options window - Applications panel]].
Hopefully this helps!
Maybe you are looking for
-
I downloaded software updates and now I can't get online with airport
Hello! This morning, I got asked by my software update on my Mac (which automatically asks me every week) to install some software updates. I stupidly did not think much about it and clicked ok. The software updates that I installed were: 1.) Java fo
-
MSA 4.0 SP8 : "Read-Only" Tile ? (cannot modify data)
Hello In the Campaign Status tile set (MSACAMcamStatus), I have modified the Campaign tile (camcshort2a) to add a combo engine representing the Campaign Status Profile (BOCAMPAIGN property is 'Stsma') I made it the same as the Status Profile combo en
-
Rearranging the icons on the homescreen
Probably a stupid question, but how do you rearrange the icons on the homescreen? I did it once by accident and now can't figure out how to do it again!
-
Sending idoc from 800client to 000 clinet
Hi .....I am very new to ABAP and trying to send MATMAS05 from client 800 to 000 from quite some time. I have gone through all the threads......and able to get the procedure. But still somewhere somehow missing. If somebody have screen shot for this
-
Dynamic Columns in Workflow Inbox
Hi, We are seeing some eratic behaviour with regards to the Dynamic Columns assignment in the Layout Variant of SAP INBOX. We have assigned the Dynamic Columns, but altough the Customisation in SWL1 has the assignment they are still not visble in the