Force use of an INDEX in ABAP
Is there a way to force the use of an index for a select statement in ABAP?
Is it possible ? Maybe with EXEC SQL . . .
Here find a trace
SELECT STATEMENT ( Estimated Costs = 28.747 , Estimated #Rows = 9 )
5 2 TABLE ACCESS BY INDEX ROWID EDIDC
( Estim. Costs = 28.747 , Estim. #Rows = 9 )
1 INDEX RANGE scan EDIDC~3
( Estim. Costs = 1.207 , Estim. #Rows = 269.667 )
As we can see sql optimizer choose index 3 but I though index 1 is better....
regards,
Hi Guys,
With reference to Indexes, the best way to use them is to check out all the fields that are available in the index and make your Select Query in such a way that :
(1) The fields in the index are present in your query.
(2) The fields are in the same order in the index and the query.
(3) OR conditions are avoided in the same line. E.g. Where ( matnr = '10000034' OR maktx = 'BB Prod.')
- Such statements are to be avoided.
If in a table there are many indexes SAP will decide by itself which index to use. This decision is based on a sampling percentage. This data is filled based on your configuration and can be viewed in ST05. In case the data has not been updated, you may find that SAP will use an index which you might not find suitable. Hence a situation may come up when you are required to force an index to be used in your SELECT query.
Similar Messages
-
We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
We have also reproduced the issue on the following stacks:
Oracle SE One 11.2.0.3 (with Spatial enabled)
Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
Microsoft Windows Server 2003R2 Standard x64 Edition
However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
Any help or advice would be much appreciated.
Kindest Regards,
KevinIn my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late. -
Effect of Force use of non-existing index in program
Hi,
What is the Effect of Force use of non-existing index in program?
We have forced the use of a custom index in our program, i want to know the effect in the program if in the future this index will be deleted or removed from the database?
Thanks a lot!Hi Freishz,
>
freishz wrote:
> What is the Effect of Force use of non-existing index in program?
> We have forced the use of a custom index in our program, i want to know the effect in the program if in the future this index will be deleted or removed from the database?
Hints note, it is a hint not a command, are ignored by the optimizer if they are not
syntactically and/or semantically correct. An index hint pointing to a non-exisitng index
is semantically not correct -> will be ignored. (A normal costing with the available indexes
is done).
Kind regards,
Hermann -
Hi Guys,
I have a problem with index. I created index on VBRK table with fieldsd VKORG & FKDAT and in selection query i am using only these two fields in where condition.
Most of the times the application is running perfectly. But some times it is running too long and giving a dump.
I checked with basis & dba team, they are saying it is running on different index when it is giving a dump i.e., it is executing on different index some times.
Can anybody give me a suggestion why it is taking a different index?
Or is there any chance to give a HINT in select statement in ABAP or specifically mension the index name in select statement?
regards,
shyleshHi,
this may occur when you are selecting on several different fields, not only those in the secondary index.
If too many fields are involved, the optimizer may not find the best index any more.
Possible reasons:
- table statistics are not up to date
- bug in the database software (Oracle 10 had some of those...)
- bad ABAP coding
Yes, you can use a hint to force the database to use a certain index, if you know what you're doing. But keep in mind that you are not database-independent any more with your code.
I have done this successfully with the BKPF table (90 million entries in our box...)
Greetings
Thomas -
Query don't use the right index when using bind variables
Hi people !
I need some help because I have an issue with a query that don t use the right Indexes as it should
First of all, I have mainly three tables :
ORDER : Table that contains description for each Order (approximately 1 000 000 Records)
ORDER_MVTS : Table that contains the tasks made (called movements) to set up each Orders
with quantity of packages prepared for each product (approximately 10 000 000 Records)
PRODUCT : Tables that contains the products (approximately 50 000 Records)
When I launch the query with hard coded values, it brings back response very fast
because it uses the right index (ORDER_DHR_VALID) which represent the date and hour of the order
(with format 'DD/MM/YYYY HH24:MI:SS'). The selectivity for this index is good.
NB 1: I have to use the trick " >= Trunc(date) and < trunc(date) +1 " to filter on a simple date because
the index contains hour and minutes (I know it wasn't probably a bright idea at conception time).
NB 2: The index on ORDER_MVTS.PRODUCT_CODE is'nt discriminating enough because there is'nt enough different products.
It's the same for index on CUSTOMER_CODE and on MVT_TYPE so only the index on ORDER.DHR_VALID is good.
Here is the correct explain plan when I execute the query with hard coded values :
SELECT SUM(ORDER_MVTS.NB_PACKAGE)
FROM ORDER_MVTS, PRODUCT, ORDER
WHERE ORDER.DHR_VALID >= TRUNC(to_date('14/11/2008 10:04:56','DD/MM/YYYY HH24:MI:SS'))
AND ORDER.DHR_VALID < TRUNC(to_date('14/11/2008 10:04:56','DD/MM/YYYY HH24:MI:SS')) + 1
AND ORDER_MVTS.MVT_TYPE = 'DELIVERY'
AND PRODUCT.CODE = ORDER_MVTS.PRODUCT_CODE
AND ORDER_MVTS.ORDER_CODE = ORDER.CODE
AND ORDER.CUSTOMER_CODE = 'ADIDAS'
AND PRODUCT.CODE = 1234
Rows Row Source Operation
1 SORT AGGREGATE
2 NESTED LOOPS
4 NESTED LOOPS
2 INDEX UNIQUE SCAN (object id 378548) --> PRODUCT_PK
4 TABLE ACCESS BY INDEX ROWID ORDER
777 INDEX RANGE SCAN (object id 378119) --> ORDER_DHR_VALID
2 TABLE ACCESS BY INDEX ROWID ORDER_MVTS
30 INDEX RANGE SCAN (object id 377784) --> ORDER_MVTS_ORDER_FK
Now the problem is when the query is used in a Cursor with bind variables.
It seems like Oracle don't use index on ORDER.DHR_VALID because he can't figure out that he have
to actually filter on a short period of time (only one day).
So Oracle uses the index on ORDER_MVTS.PRODUCT_CODE which is'nt a bright idea (it takes 10 secondes instead of just one)
Here is the bad explain plan :
Rows Row Source Operation
1 SORT AGGREGATE
2 NESTED LOOPS
722 NESTED LOOPS
2 INDEX UNIQUE SCAN (object id 378548) --> PRODUCT_PK
722 TABLE ACCESS BY INDEX ROWID ORDER_MVTS
1790 INDEX RANGE SCAN (object id 377777) --> ORDER_MVTS_PRODUCT_FK
2 TABLE ACCESS BY INDEX ROWID ORDER
1442 INDEX UNIQUE SCAN (object id 378439) --> ORDER_PK
Now I have found two solutions to this problem :
1) using a Hint to force the use of index on ORDER.DHR_VALID (with /*+ INDEX(ORDER ORDER_DHR_VALID) */ )
2) Using Dynamic SQL and keeping the date hard coded (but not the other values except mvt_type)
For example :
QUERY :=
'SELECT SUM(ORDER_MVTS.NB_PACKAGE)
FROM ORDER_MVTS, PRODUCT, ORDER
WHERE ORDER.DHR_VALID >= TRUNC(TO_DATE('''||To_char(P_DTE_VAL,'DD/MM/YYYY')||''',''DD/MM/YYYY'')) '||
AND ORDER.DHR_VALID < TRUNC(TO_DATE('''||To_char(P_DTE_VAL,'DD/MM/YYYY')||''',''DD/MM/YYYY'')) + 1 '||
AND ORDER_MVTS.MVT_TYPE = 'DELIVERY'
AND PRODUCT.CODE = ORDER_MVTS.PRODUCT_CODE
AND ORDER_MVTS.ORDER_CODE = ORDER.CODE
AND ORDER.CUSTOMER_CODE = :CUSTOMER
AND PRODUCT.CODE = :CODE ';
These two solutions work but Number 1 is bad in theory because it uses a Hint
and Number 2 may be difficult to code.
So my question is : Does someone knows another solution to force the use of index ORDER_DHR_VALID that can be simple and reliable.
Thank you very much for support
Edited by: remaï on Apr 1, 2009 4:08 PMWhat version of oracle you have? CBO work is different in 9i and 10g.
Usually cost based optimizer do not want to use index for >< condition with binding variables because optimizer can not use statistic to determine selectivity, and by default selectivity of <> operators is low.
(As I remember '>' selectivity by default is 5%, you have two conditions > and <, therefore resulting selectivity will be 0.05*0.05=0.0025 as two independent events, but selectivity of other conditions
ORDER_MVTS.MVT_TYPE = 'DELIVERY' or ORDER.CUSTOMER_CODE = 'ADIDAS' looks much better for CBO)
The best solution I see is do not use binding variables. Actually your query looks as searching query, which executes not so often, therefore you will not have perfomance win along of skipping execution plan creation.
Edited by: JustasVred on Apr 1, 2009 10:10 AM -
Unknown indexes in ABAP dictionary
Hi all,
can anyone help me with the procedure to handle unknown indexes in ABAP dictionary for a BW SAP_BW 350 Production system?
The list of some of the indexes are as follows :
/BI0/E0CCA_C11~P
/BI0/E0FIGL_C01~P
/BI0/E0OPA_C11~P
/BI0/E0PS_C04~P
/BIC/EIEFERC~P
Thanks a lot in advance ....Hello Varsha,
It seems that the index for these InfoProviders are missing.
Goto RSRV -> Elementary Test -> Database -> Database Indices of an InfoCube and Its Aggregates
It should be green. If its red there will be a correct button on the top just excute it
or You can use the following Function Module to check
RSDU_INFOCUBE_INDEXES_CHECK
To Repair
RSDU_INFOCUBE_INDEXES_REPAIR
Thanks
Chandran -
Missing Index there Unknown indexes in ABAP Dictionary in DB02
Dear All,
I am getting error in T-code DB02 >Missing Index there Unknown indexes in ABAP Dictionary.
Please find the following details.
Unknown indexes in ABAP Dictionary
DB indexes 11
MARA_MEINS
MARA_ZER
MCHA_VFDAT
VBRP_ARKTX
VBRP_CHARG
VBRP_FKIMG
VBRP_KZWI1
VBRP_MATKL
VBRP_MATNR
VBRP_SPART
VBRP_WERKS
Please suggest how to correct them and can caution we have to take before creating the
Index.
The process creating the index form se11 table and there index>database utility and than create .The same process can be use .
Regards,Hi,
Please use the below procdure:
- Goto transaction SE11
- Enter table name and press view
- Click button "Indexes..."
Please alse check with the below links for more information.
Index:
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb20446011d189700000e8322d00/content.htm
Creating Secondary Index
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/1c/252640632cec01e10000000a155106/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/c7/55833c4f3e092de10000000a114027/frameset.htm
Check with this also......[click here|Steps for creating a database index;.
With Regards,
Krishna. -
Query tuning and using the "better" index.
I have a database table with about 40,000 records in it. Using
a certain index first limits the number of rows to 11,000
records. Using a different index first (by disabling the other
index in the query) limits the number of rows to 2,500 records.
Using the explain plan, the rest of the query is parsed the same
way for both queries. What reasons can explain why when the
index that returns 11,000 records first runs faster than
the "better" index? I thought the whole idea behind query
tuning is to use the index that limits the data the most.It looks like Oracle likes the equality condition more than the greater than -less than combination (which you might like to recode as a BETWEEN condition for clarity).
There are a number of factors here.
i) Are the "test names" equally distributed? Do some test names appear with greater frequency than others? If so, collecting column statistics might cause the BATCH_2 index to be used for some test names, and not for others.
ii) Likewise, what is the distribution of cdates? How does the distribution of cdates vary by test name?
iii) You could force the use of the BATCH_6 index over the BATCH_2 by using an optimizer hint instead of dropping the BATCH_2 index ...
select /*+ index(batch batch_6) */ id, test, cdate
from batch
where test = 'Some test name'
and cdate >= &start date&
and cdate < &end date& + 1
... or even try prompting Oracle to use both indexes ...
select /*+ index(batch batch_6) index(batch batch_2) */ id, test, cdate
from batch
where test = 'Some test name'
and cdate >= &start date&
and cdate < &end date& + 1
... and test the response times, then chose to use the optimizer hint in your application
iv) You might like to replace the rather unselective BATCH_2 index with a BATCH_2_6 index on both test and cdate (in that order). That would probably give you an excellent result, and the BATCH_6 index can still be used to satisfy queries slective on cdate that are not selective on test (in very recent versions of Oracle the BATCH_2_6 index might be used for such an operation, and you could drop both BATCH_6 and BATCH_2)
Well, see if any of this helps. -
Problem in accessing mseg table using MSEG~M Index.
Hi Experts,
I am facing problem in accessing mseg table using MSEG~M Index. I used same sequence of fields and i tried with mandt field also. but it is not taking the Index and it is going for TImeout ABAP dump.
This are my codes used in different ways
1. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg CLIENT SPECIFIED INTO TABLE t_mseg2
WHERE mandt EQ sy-mandt AND
matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
2. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg INTO TABLE t_mseg2
WHERE matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
3. SELECT mjahr
bwart
matnr
lifnr
dmbtr
kostl
aufnr
bukrs
FROM mseg INTO TABLE t_mseg2
WHERE matnr NE SPACE AND
werks EQ p_werks AND
lgort NE '0000' AND
bwart IN (122,201,262) AND
sobkz NE '0'.
The above all code is not at all taking the index in Quality server .but in Development it is taking .In Quality server it is reading all datas without using the index and going Timeout ABAP dmup
Please, Suggest me some solutions.
Thanks in Advance.
Regards,
NandhaHi,
Without NE also not working out. i am facing same problem still.
SELECT bwart
matnr
lifnr
dmbtr
kostl
aufnr
FROM mseg CLIENT SPECIFIED INTO TABLE t_mseg
WHERE mandt EQ sy-mandt AND
werks EQ p_werks AND
bwart IN (122,201,262) AND
mjahr EQ p_year AND
bukrs EQ p_cc
%_HINTS ORACLE 'INDEX("MSEG" "MSEG~M")'.
Please,check and help me out from this issue.
Regards,
Nandha -
Notes on using Object oriented concept in ABAP
Hi ,
I want somes notes on how to use Object oriented concept in ABAP.
Thanks in advance.
ChetanHi, this may help you
OOPs ABAP uses Classes and Interfaces which uses Methods and events.
If you have Java skills it is advantage for you.
There are Local classes as well as Global Classes.
Local classes we can work in SE38 straight away.
But mostly it is better to use the Global classes.
Global Classes or Interfaces are to be created in SE24.
SAP already given some predefined classes and Interfaces.
This OOPS concepts very useful for writing BADI's also.
So first create a class in SE 24.
Define attributes, Methods for that class.
Define parameters for that Method.
You can define event handlers also to handle the messages.
After creation in each method write the code.
Methods are similar to ABAP PERFORM -FORM statements.
After the creation of CLass and methods come to SE38 and create the program.
In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
Example:
REPORT sapmz_hf_alv_grid .
Type pool for icons - used in the toolbar
TYPE-POOLS: icon.
TABLES: zsflight.
To allow the declaration of o_event_receiver before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_receiver DEFINITION DEFERRED.
G L O B A L I N T E R N A L T A B L E S
*DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
To include a traffic light and/or color a line the structure of the
table must include fields for the traffic light and/or the color
TYPES: BEGIN OF st_sflight.
INCLUDE STRUCTURE zsflight.
Field for traffic light
TYPES: traffic_light TYPE c.
Field for line color
types: line_color(4) type c.
TYPES: END OF st_sflight.
TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
DATA: gi_sflight TYPE tt_sflight.
G L O B A L D A T A
DATA: ok_code LIKE sy-ucomm,
Work area for internal table
g_wa_sflight TYPE st_sflight,
ALV control: Layout structure
gs_layout TYPE lvc_s_layo.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container,
o_event_receiver TYPE REF TO lcl_event_receiver.
DATA:
Work area for screen 200
g_screen200 LIKE zsflight.
Data for storing information about selected rows in the grid
DATA:
Internal table
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
C L A S S E S
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Event handler method for event toolbar.
CONSTANTS:
Constants for button type
c_button_normal TYPE i VALUE 0,
c_menu_and_default_button TYPE i VALUE 1,
c_menu TYPE i VALUE 2,
c_separator TYPE i VALUE 3,
c_radio_button TYPE i VALUE 4,
c_checkbox TYPE i VALUE 5,
c_menu_entry TYPE i VALUE 6.
DATA:
ls_toolbar TYPE stb_button.
Append seperator to the normal toolbar
CLEAR ls_toolbar.
MOVE c_separator TO ls_toolbar-butn_type..
APPEND ls_toolbar TO e_object->mt_toolbar.
Append a new button that to the toolbar. Use E_OBJECT of
event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
This class has one attribute MT_TOOLBAR which is of table type
TTB_BUTTON. The structure is STB_BUTTON
CLEAR ls_toolbar.
MOVE 'CHANGE' TO ls_toolbar-function.
MOVE icon_change TO ls_toolbar-icon.
MOVE 'Change flight' TO ls_toolbar-quickinfo.
MOVE 'Change' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'CHANGE'.
PERFORM change_flight.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
ENDCLASS.
S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
SET SCREEN '100'.
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
DATA:
For parameter IS_VARIANT that is sued to set up options for storing
the grid layout as a variant in method set_table_for_first_display
l_layout TYPE disvariant,
Utillity field
l_lines TYPE i.
After returning from screen 200 the line that was selected before
going to screen 200, should be selected again. The table gi_index_rows
was the output table from the GET_SELECTED_ROWS method in form
CHANGE_FLIGHT
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gi_index_rows.
CALL METHOD cl_gui_cfw=>flush.
REFRESH gi_index_rows.
ENDIF.
Read data and create objects
IF go_custom_container IS INITIAL.
Read data from datbase table
PERFORM get_data.
Create objects for container and ALV grid
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
Create object for event_receiver class
and set handlers
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
Layout (Variant) for ALV grid
l_layout-report = sy-repid. "Layout fo report
Setup the grid layout using a variable of structure lvc_s_layo
Set grid title
gs_layout-grid_title = 'Flights'.
Selection mode - Single row without buttons
(This is the default mode
gs_layout-sel_mode = 'B'.
Name of the exception field (Traffic light field) and the color
field + set the exception and color field of the table
gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
gs_layout-info_fname = 'LINE_COLOR'.
LOOP AT gi_sflight INTO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
Value of traffic light field
g_wa_sflight-traffic_light = '1'.
Value of color field:
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
ELSE.
g_wa_sflight-traffic_light = '3'.
ENDIF.
MODIFY gi_sflight FROM g_wa_sflight.
ENDLOOP.
Grid setup for first display
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
CHANGING it_outtab = gi_sflight.
*-- End of grid setup -
Raise event toolbar to show the modified toolbar
CALL METHOD go_grid->set_toolbar_interactive.
Set focus to the grid. This is not necessary in this
example as there is only one control on the screen
CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0200 INPUT
MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN 'EXIT200'.
LEAVE TO SCREEN 100.
WHEN'SAVE'.
PERFORM save_changes.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form get_data
FORM get_data.
Read data from table SFLIGHT
SELECT *
FROM zsflight
INTO TABLE gi_sflight.
ENDFORM. " load_data_into_grid
*& Form change_flight
Reads the contents of the selected row in the grid, ans transfers
the data to screen 200, where it can be changed and saved.
FORM change_flight.
DATA:l_lines TYPE i.
REFRESH gi_index_rows.
CLEAR g_selected_row.
Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
Check if any row are selected at all. If not
table gi_index_rows will be empty
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a line'.
EXIT.
ENDIF.
Read indexes of selected rows. In this example only one
row can be selected as we are using gs_layout-sel_mode = 'B',
so it is only ncessary to read the first entry in
table gi_index_rows
LOOP AT gi_index_rows INTO g_selected_row.
IF sy-tabix = 1.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Transfer data from the selected row to screenm 200 and show
screen 200
CLEAR g_screen200.
MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
LEAVE TO SCREEN '200'.
ENDFORM. " change_flight
*& Form save_changes
Changes made in screen 200 are written to the datbase table
zsflight, and to the grid table gi_sflight, and the grid is
updated with method refresh_table_display to display the changes
FORM save_changes.
DATA: l_traffic_light TYPE c.
Update traffic light field
Update database table
MODIFY zsflight FROM g_screen200.
Update grid table , traffic light field and color field.
Note that it is necessary to use structure g_wa_sflight
for the update, as the screen structure does not have a
traffic light field
MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
g_wa_sflight-traffic_light = '1'.
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
clear g_wa_sflight-line_color.
ELSE.
g_wa_sflight-traffic_light = '3'.
clear g_wa_sflight-line_color.
ENDIF.
MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
Refresh grid
CALL METHOD go_grid->refresh_table_display.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN '100'.
ENDFORM. " save_changes
chk this blog
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
Reward if helpfull.
Regards Madhu. -
Why is my query using the wrong index?
Hi SQL Tuning experts....
I'm running Oracle 11.2.0.2 EE on Solaris 10
I've just checked my top SQL statements in OEM and drilling down on the top query of the list, I decided to run SQL Advisor on the query.
Low and behold, it came back with a profile that gives me a 99.9% improvement.
When I compared the original plan to the new plan the only difference is that the SQL Advisor is using a different index.
Now, the dumb DBA question: why? why is Oracle picking the wrong index?
original plan
SELECT STATEMENT
COUNT STOPKEY
VIEW
SORT ORDER BY STOPKEY
TABLE ACCESS BY INDEX ROWID ARADMIN.T2179 TABLE
INDEX RANGE SCAN ARADMIN.T2179_C3 INDEXnew plan...
SELECT STATEMENT
COUNT STOPKEY
VIEW
SORT ORDER BY STOPKEY
TABLE ACCESS BY INDEX ROWID ARADMIN.T2179 TABLE
INDEX RANGE SCAN ARADMIN.T2179_C536870923 INDEXThe stats:
table has approx. 3.3Mil rows
table segment is approx. 15G (5G of it is reclaimable space, but probably not related)
table has fresh stats and indexes have been recently rebuilt
indexes in this discussion are both b-tree
the C3 column is number(15) with 2836897 distinct rows
the C536870923 columns is VARCHAR2(255) with 1080533 distinct values
Here is the actual query:
SELECT *
FROM (
SELECT T2179.C1,C536871040,C536871037,C536870944,C3,C536870918,C536870919,
C536870924,C536871048,C536871049,C536871050,C536870926,C536870925,
C536870916,C4,C536871275,C536871095,C536870913
FROM T2179
WHERE ((T2179.C536870923 = :"SYS_B_0") AND (T2179.C3 > :"SYS_B_1")) ORDER BY C1 DESC )
WHERE ROWNUM <= :"SYS_B_2"Obviously this is a good example of why we should use profiles. :-)
Edited by: ji li on Feb 14, 2013 1:32 PM
Sorry... I should have included the plan output
I'm guessing this has something to do with the cardinality of the data in the columns.Dom.... I've already posted most everything. Here are the relevant init params and misc stuff you are asking for.
NAME TYPE VALUE
object_cache_optimal_size integer 102400
optimizer_capture_sql_plan_baselines boolean FALSE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 11.2.0.2
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
optimizer_use_invisible_indexes boolean FALSE
optimizer_use_pending_statistics boolean FALSE
optimizer_use_sql_plan_baselines boolean TRUE
plsql_optimize_level integer 2
db_file_multiblock_read_count integer 128
db_block_size integer 8192
cursor_sharing string FORCE
SNAME PNAME PVAL1 PVAL2
SYSSTATS_INFO STATUS COMPLETED
SYSSTATS_INFO DSTART 12-04-2012 12:28
SYSSTATS_INFO DSTOP 12-04-2012 15:28
SYSSTATS_INFO FLAGS 0
SYSSTATS_MAIN CPUSPEEDNW 2992.2746781116
SYSSTATS_MAIN IOSEEKTIM 10
SYSSTATS_MAIN IOTFRSPEED 4096
SYSSTATS_MAIN SREADTIM 48027.271
SYSSTATS_MAIN MREADTIM 37217.102
SYSSTATS_MAIN CPUSPEED 2978
SYSSTATS_MAIN MBRC 0
SYSSTATS_MAIN MAXTHR 400782336
SYSSTATS_MAIN SLAVETHR 1403904
13 rows selected.
QL> l
1 SELECT * FROM (
2 SELECT
3 T2179.C1,
4 C536871040,
5 C536871037,
6 C536870944,
7 C3,
8 C536870918,
9 C536870919,
10 C536870924,
11 C536871048,
12 C536871049,
13 C536871050,
14 C536870926,
15 C536870925,
16 C536870916,
17 C4,
18 C536871275,
19 C536871095,
20 C536870913
21 FROM aradmin.T2179
22 WHERE (
23 (C536870923 = '300885690')
24 AND
25 (C3 > '1360938353')
26 )
27 ORDER BY C1 DESC )
28* WHERE ROWNUM <= 1
no rows selected
Elapsed: 00:00:00.01
Execution Plan
Plan hash value: 2768254526
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 2315 | 6 (17)| 00:00:01 |
|* 1 | COUNT STOPKEY | | | | | |
| 2 | VIEW | | 1 | 2315 | 6 (17)| 00:00:01 |
|* 3 | SORT ORDER BY STOPKEY | | 1 | 226 | 6 (17)| 00:00:01 |
|* 4 | TABLE ACCESS BY INDEX ROWID| T2179 | 1 | 226 | 5 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | T2179_C3 | 1 | | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(ROWNUM<=1)
3 - filter(ROWNUM<=1)
4 - filter("C536870923"='300885690')
5 - access(SYS_OP_DESCEND("C3")<HEXTORAW('3AF1C2A1ABC9FF') )
filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("C3"))>1360938353)
Statistics
0 recursive calls
0 db block gets
2615 consistent gets
0 physical reads
0 redo size
1538 bytes sent via SQL*Net to client
513 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
0 rows processed -
Lack of support for Google Chrome in forced-use email app
If this isn't resolved, I will cancel all Verizon services. Am seeing a consistent decline in VZ services:
1. ghosting and massive digital artifacts in HD programming, INCLUDING "Premium" channels
2. HD set top box quality is very poor
3. High pricing
4. VZ has terminated use of preferred browser (Chrome, which is SECURE and much faster than any others) in new forced-use email client.
As expected, VZ is acting once again as if they were "the phone company".
Not true.
Expect this post to be taken down quickly.Going to side with Justin here as well (and those of us who have been here for a while know, like ourselves, that he isn't a Verizon employee) ... the issues being described are indicative of a local inside wiring problem (poor cabling, loose connections, unterminated/noise introducing cable outlets, etc.). Since the TV is indicating problems, it's likely also interfering with the MoCA signal to the modem which would result in internet issues as well.
I can second my experience with Chrome as well ... it works just fine with Verizon webmail. Just tried it again to be sure.
If you are encountering problems, it would be helpful if you could be more specific. I suspect the you have an anti-virus / malware product that is probably set to block certain kinds of traffic (like Javascript, etc.) that is potentially interfering. The solution in such cases is to whitelist the Verizon site as a known location -- how to do that however is a function of your anti-virus/anti-malware product.
As for cost, I've been a customer for several years now. My rate went up by $10 once in that time and I ended up rebundling my STB's and essentially negating that increase. Compared to my cable provider -- who I continue to evaluate every year for cost/speed (while I like FiOS, I believe in fair competition and the best price / speed will always win my business) -- they are still the best deal for my money (don't get me wrong, cheaper or more bundle optons would be better!). YMMV. -
Unable to download OS X using Zapping PRAM index.
Unable to download OS X using Zapping PRAM index. Gives OS X Mavericks failed to download use the purchases page to try again - But cant see Mac app store icon as screen has completely gone grey
Since yesterday my Macbook Pro is not working - rather I cant see finder and upon booting, instead of any screen savers and icons displaying it is showing a balnk grey screen.
After reading some discussion and watching to some videos on You Tube, I managed to empty my Mac HD by traferring all the files to an external HD and then suing zapping PRAM keys, I got to a screen from where I am trying to download OS X to re install it.
However after some time it is giving error as 'OS X Mavericks failed to download use the purchases page to try again'.
But to access purchase page, I am unable to view Mac app stores application or icon.
Please help in fixing this issue.Hi there,
Mine is 2011.
I tried the suggestion you gave, but it didnt work.
However can someone help with clarification - mine is 2011 MBP and I reconk that it came with OS X Lion pre-installed and now with OS X utilities page, when I try to reinstall OSX it tries installing Mavericks and fails at certain stage.
When it fails I get pop-up message as 'OS X Mavericks failed to download use the purchases page to try again'
But I am unable to get App stores and go to purchases, as I dont see that option anywhere using OS X Utilities (which is the only way I am able to access my mac once I start)
So, Kindly help whether I need to get OS X Lion reinsalled first and then upgrade OS X Mavericks?
To do so, should I buy OS X Lion (as I dont think there is any back-up of OS available on my machine)?
Any suggestion will be much appreciated. -
Hi all,
can anyone help me with the procedure to handle unknown indexes in ABAP dictionary for a BW SAP_BW 350 Production system?
The list of some of the indexes are as follows :
/BI0/E0CCA_C11~P
/BI0/E0FIGL_C01~P
/BI0/E0OPA_C11~P
/BI0/E0PS_C04~P
/BIC/EIEFERC~P
Thanks a lot in advance ....
Madhavi RaneYou should be able to delete and recreate indexes from the infocube performance tab, RSRV or DB02. The bigger question is why these e fact table indexes are not being handled properly. I would try searching OSS Notes to see if yo ufind one relevant for your DB;
This older Notes provides some good background
Note 594287 - DB6: Corrections to the primary index of fact tables -
I am new to ABAP. I tried creating abstract class and found that class builder allows development of abstract final class. What is the use of such class in ABAP?
Hi,
Does not compile:
This one do:
Inheritance:
Regards.
Maybe you are looking for
-
I recorded a 8min video on my brand new ipod touch 4g 9 gigs,i had .9gs bef
i recorded a 8min video on my brand new ipod touch 4g 9 gigs,i had .9gs before the vid,after i was done recording it,it said it saved it,but its not in my photos but it took up the memory im down to .3gs now in itunes it says i have 281 photos but on
-
Every time I try to access the color wheel in Motion, it crashes (like changing the bakcground color in edit>project profile, or changing the color of a text element in text>style>face>color). This happened when I upgraded to snow leopard. I have kep
-
How to retain my pictures in My Photo Stream in IOS8
Hi, I am using Iphone 4S and I have upgraded to IOS 8 recently. After this upgrade, I lost all my pictures in My Photo Stream. Please help me out, how will I get my pictures back, I need them. Or else please tell me the process to downgrade to IOS 7.
-
Can u help stop people from taking money from my bank account
money has been taken from my bank account I need it to stop ino that fuckbook .com have ino about that but can you. stop any other from now please
-
Now for months, Firefox has been doing the spinning beach ball with practically every action I take on OS X 10.5.8. It doesn't matter what I do -- try to type something, go to a webpage -- spinning beach ball. Safari is a speed demon compared, but al