on 11-23-2005 3:12 PM
Hy,
Please find SAP anwser to one of our performance problem on spesific developments :
In other words there is no internal table which has no key - if you
do not specify a key then the default key is used:
data itab type table of sflight.
is identical to
types: ty_itab type standard table of sflight
with non-unique default key
data itab type ty_itab.
I am sorry but all this is consulting and shouldn't be discussed
via oss. (see attached note)
================================
If you test the following program with SE30 (with more than 100 000 lines) you will see performance differences.
With 176 000 on our dev server
with out key : 1.2 sec
with default key : 2.5 sec
===========================
test program :
===========================
TABLES: t100.
SELECT-OPTIONS :
s_arbgb FOR t100-arbgb DEFAULT 'Y*' OPTION CP.
PARAMETERS :
p_wo TYPE oax,
p_times TYPE i DEFAULT 50.
TYPES :
t_wo TYPE STANDARD TABLE OF ybc_prt_messages,
t_wk TYPE STANDARD TABLE OF ybc_prt_messages
WITH non-unique DEFAULT KEY.
DATA:
i_t100 TYPE STANDARD TABLE OF t100,
wa_t100 LIKE LINE OF i_t100,
t_wo TYPE t_wo,
t_wk TYPE t_wk.
START-OF-SELECTION.
SELECT * INTO TABLE i_t100
FROM t100
WHERE arbgb IN s_arbgb
AND sprsl = sy-langu
AND NOT text IS NULL
AND text <> space.
DO p_times TIMES.
LOOP AT i_t100 INTO wa_t100.
IF p_wo IS INITIAL.
PERFORM insert_wk USING wa_t100
CHANGING t_wk.
ELSE.
PERFORM insert_wo USING wa_t100
CHANGING t_wo.
ENDIF.
ENDLOOP.
ENDDO.
IF p_wo IS INITIAL.
DESCRIBE TABLE t_wk LINES sy-tabix.
ELSE.
DESCRIBE TABLE t_wo LINES sy-tabix.
ENDIF.
WRITE:/ sy-tabix.
&----
*& Form insert_wk
&----
text
----
-->P_T100 text
-->T_TABLE text
----
FORM insert_wk USING p_t100 TYPE t100
CHANGING t_table TYPE t_wk.
DATA:
wa TYPE ybc_prt_messages.
wa-msgid = p_t100-arbgb.
wa-msgno = p_t100-msgnr.
APPEND wa TO t_table.
ENDFORM. " insert
&----
*& Form insert_wo
&----
text
----
-->P_T100 text
-->T_TABLE text
----
FORM insert_wo USING p_t100 TYPE t100
CHANGING t_table TYPE t_wo.
DATA:
wa TYPE ybc_prt_messages.
wa-msgid = p_t100-arbgb.
wa-msgno = p_t100-msgnr.
APPEND wa TO t_table.
ENDFORM. " insert
Let me know if you have the same results !
Good Mourning My Friend,
Remember, when you acces a standard table or an user table, firstly must check if this table have a lot of record and if this table on the future can alocate many records.
So, always try tu use the default key or another key of the table, for example in your code if you make a trace of the next sentence you can see that the select never use the default key.
*"----
SELECT * INTO TABLE i_t100
FROM t100
WHERE arbgb IN s_arbgb
AND sprsl = sy-langu
AND NOT text IS NULL
AND text <> space.
*"----
If you want to use the default key must change your code as next:
*----
SELECT * INTO TABLE i_t100
FROM t100
WHERE sprsl = sy-langu
AND arbgb IN s_arbgb
AND NOT text IS NULL
AND text <> space.
*----
Then, when you run this select, can check that the sentence acces by default key.
The trace can do it by using transaction ST05
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did you check already the performance web logs by Harry:
/people/harry.dietz/blog
Also check service.sap.com/performance
Eddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.