Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

performance issue in ABAP report

former_member226419
Contributor
0 Likes
766

Hi Gurus,

I am facing a very strange problem in my report.

I have written a 1 query

   SELECT wi_id

               wi_stat

               wi_ct

               wi_aed

               wi_aagent

               parent_wi

          FROM swwwihead

          INTO TABLE gt_swwwihead1  FOR ALL ENTRIES IN gt_swwwihead

          WHERE parent_wi = gt_swwwihead-wi_id

            AND wi_type = gc_w.

Above query is taking lot of time when we are testing in quality client (OQY) where records are less as compared to developmnt client

and for the same in ODY which has more records and is executing very fast.

I am little confused with this behaviour

Pls suggest me with ur expert advice .

below I mentioned bit elaborated code to give u more clarity

   SELECT wi_id
             wi_stat
             wi_ct
             wi_aed
             wi_aagent
             parent_wi
        FROM swwwihead
        INTO TABLE gt_swwwihead
        FOR ALL ENTRIES IN gt_sww_wi2obj
        WHERE wi_id = gt_sww_wi2obj-wi_id
          AND wi_type = gc_f.
      IF sy-subrc = 0 .
        SELECT wi_id
               wi_stat
               wi_ct
               wi_aed
               wi_aagent
               parent_wi
          FROM swwwihead
          INTO TABLE gt_swwwihead1"APPENDING TABLE gt_swwwihead
          FOR ALL ENTRIES IN gt_swwwihead
          WHERE parent_wi = gt_swwwihead-wi_id
            AND wi_type = gc_w.

        IF sy-subrc = 0 .
          APPEND LINES OF gt_swwwihead1 TO gt_swwwihead.
          SELECT  wi_id
                  meth_etime
          FROM   swwloghist
        INTO TABLE gt_swwloghist
        FOR ALL ENTRIES IN gt_swwwihead
        WHERE wi_id = gt_swwwihead-wi_id.
        ENDIF.
      ENDIF.
    ENDIF.

Regards

Sumeet

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
720

HI sumeet,

  Create a secondary index for Table swwwihead  for PARENT_WI field.you are using it in where condition without any primary key.

Regards

Ajit

Hi Gurus,

I am facing a very strange problem in my report.

I have written a 1 query

   SELECT wi_id

               wi_stat

               wi_ct

               wi_aed

               wi_aagent

               parent_wi

          FROM swwwihead

          INTO TABLE gt_swwwihead1  FOR ALL ENTRIES IN gt_swwwihead

          WHERE parent_wi = gt_swwwihead-wi_id

            AND wi_type = gc_w.

Above query is taking lot of time when we are testing in quality client (OQY) where records are less as compared to developmnt client

and for the same in ODY which has more records and is executing very fast.

I am little confused with this behaviour

Pls suggest me with ur expert advice .

below I mentioned bit elaborated code to give u more clarity

   SELECT wi_id
             wi_stat
             wi_ct
             wi_aed
             wi_aagent
             parent_wi
        FROM swwwihead
        INTO TABLE gt_swwwihead
        FOR ALL ENTRIES IN gt_sww_wi2obj
        WHERE wi_id = gt_sww_wi2obj-wi_id
          AND wi_type = gc_f.
      IF sy-subrc = 0 .
        SELECT wi_id
               wi_stat
               wi_ct
               wi_aed
               wi_aagent
               parent_wi
          FROM swwwihead
          INTO TABLE gt_swwwihead1"APPENDING TABLE gt_swwwihead
          FOR ALL ENTRIES IN gt_swwwihead
          WHERE parent_wi = gt_swwwihead-wi_id
            AND wi_type = gc_w.

        IF sy-subrc = 0 .
          APPEND LINES OF gt_swwwihead1 TO gt_swwwihead.
          SELECT  wi_id
                  meth_etime
          FROM   swwloghist
        INTO TABLE gt_swwloghist
        FOR ALL ENTRIES IN gt_swwwihead
        WHERE wi_id = gt_swwwihead-wi_id.
        ENDIF.
      ENDIF.
    ENDIF.

Regards

Sumeet

4 REPLIES 4
Read only

Former Member
0 Likes
721

HI sumeet,

  Create a secondary index for Table swwwihead  for PARENT_WI field.you are using it in where condition without any primary key.

Regards

Ajit

Read only

0 Likes
720

Thanx ajit...my query is answered. I created secondary index for the same.

Read only

former_member212705
Active Participant
0 Likes
720

Hi Sumeet,

sort the table gt_swwwihead before using for all entries. and delete adjacent duplicates from it.

Regards,

Ashish

Read only

SharathYaralkattimath
Contributor
0 Likes
720

Hi,

Have you checked if the table'gt_sww_wi2obj' is not initial before SELECT....FOR ALL ENTRIES.'gt_sww_wi2obj'..?

If table is initial it will select all records....