Skip to Content
author's profile photo Former Member
Former Member

ABAP Performance Issue

Dear Experts,

I have got a problem on performance issue.

Please see the code below:

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = '60'

text = 'SELECT RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

IF p_case IS INITIAL.

IF gt_aroutines IS INITIAL.

ELSE.

SELECT

r~codetp

i~isource

i~infocube

u~iciobjnm

u~routine

t~txtlg

a~line_no

a~line

u~updid

a~codeid

INTO TABLE

gt_uroutines

FROM rsaabap AS a

INNER JOIN rsarout AS r

ON rcodeid = acodeid

AND robjvers = aobjvers

AND r~codetp = gc_ur

  • AND r~activfl = gc_x

LEFT OUTER JOIN rsaroutt AS t

ON tcodeid = rcodeid

AND tobjvers = robjvers

AND t~langu = sy-langu

INNER JOIN rsupdrout AS u

ON ucodeid = rcodeid

AND uobjvers = robjvers

INNER JOIN rsupdinfo AS i

ON iupdid = uupdid

AND iobjvers = uobjvers

FOR ALL ENTRIES IN gt_aroutines

WHERE a~codeid = gt_aroutines-codeid

AND a~objvers = gc_a

AND a~line_no = gt_aroutines-line_no

AND u~iciobjnm IN s_iciobj

AND i~infocube IN s_infocb

AND i~isource IN s_isourc

.

ENDIF.

ELSE.

SELECT

r~codetp

i~isource

i~infocube

u~iciobjnm

u~routine

t~txtlg

a~line_no

a~line

u~updid

a~codeid

INTO TABLE

gt_uroutines

FROM rsaabap AS a

INNER JOIN rsarout AS r

ON rcodeid = acodeid

AND robjvers = aobjvers

AND r~codetp = gc_ur

  • AND r~activfl = gc_x

INNER JOIN rsaroutt AS t

ON tcodeid = rcodeid

AND tobjvers = robjvers

AND t~langu = sy-langu

INNER JOIN rsupdrout AS u

ON ucodeid = tcodeid

AND uobjvers = tobjvers

INNER JOIN rsupdinfo AS i

ON iupdid = uupdid

AND iobjvers = uobjvers

WHERE a~objvers = gc_a

  • AND a~line LIKE g_line

AND a~line IN s_line

AND u~iciobjnm IN s_iciobj

AND i~infocube IN s_infocb

AND i~isource IN s_isourc

.

ENDIF.

IF sy-subrc = 0.

g_lines = g_lines + sy-dbcnt.

ELSE.

  • g_text = text-db4.

  • REPLACE gc_replace IN g_text

  • WITH 'RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

  • MESSAGE g_text TYPE gc_e.

ENDIF.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = '100'

text = 'SELECT RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

This is the code done by some developer and now i have to change this code maintaining the performance.

So I wrote this code as mentioend below:

DATA: lv_count_ur TYPE i.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = '60'

text = 'SELECT RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

IF p_case IS INITIAL.

IF gt_aroutines IS INITIAL.

ELSE.

  • IF gt_aroutines[] IS NOT INITIAL.

SELECT codeid objvers line_no line

FROM rsaabap

INTO TABLE gt_rsaabap

FOR ALL ENTRIES IN gt_aroutines

WHERE codeid = gt_aroutines-codeid

AND line_no = gt_aroutines-line_no

AND objvers = gc_a.

IF sy-subrc = 0.

SELECT codeid objvers codetp

FROM rsarout

INTO TABLE gt_rsarout

FOR ALL ENTRIES IN gt_rsaabap

WHERE codeid = gt_rsaabap-codeid

AND objvers = gt_rsaabap-objvers

AND codetp = gc_ur.

IF sy-subrc = 0.

SELECT codeid objvers routine updid iciobjnm

FROM rsupdrout

INTO TABLE gt_rsupdrout

FOR ALL ENTRIES IN gt_rsarout

WHERE codeid = gt_rsarout-codeid

AND objvers = gt_rsarout-objvers

AND iciobjnm IN s_iciobj.

IF sy-subrc = 0.

SELECT updid objvers infocube isource

FROM rsupdinfo

INTO TABLE gt_rsupdinfo

FOR ALL ENTRIES IN gt_rsupdrout

WHERE updid = gt_rsupdrout-updid

AND objvers = gt_rsupdrout-objvers

AND infocube IN s_infocb

AND isource IN s_isourc.

IF sy-subrc = 0.

SELECT codeid objvers langu txtlg

FROM rsaroutt

INTO TABLE gt_rsaroutt

FOR ALL ENTRIES IN gt_rsupdrout

WHERE codeid = gt_rsupdrout-codeid

AND objvers = gt_rsupdrout-objvers

AND langu = sy-langu.

SORT gt_rsaabap BY codeid line_no .

SORT gt_rsarout BY codeid objvers.

SORT gt_rsupdrout BY updid objvers.

SORT gt_rsupdinfo BY objvers updid.

LOOP AT gt_aroutines ASSIGNING -txtlg.

ENDIF.

APPEND uroutines_wa TO gt_uroutines.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

  • ENDIF.

ENDIF.

ELSE.

SELECT codeid objvers line_no line

FROM rsaabap

INTO TABLE gt_rsaabap

WHERE objvers = gc_a

AND LINE IN s_line.

IF sy-subrc = 0.

SELECT codeid objvers codetp

FROM rsarout

INTO TABLE gt_rsarout

FOR ALL ENTRIES IN gt_rsaabap

WHERE codeid = gt_rsaabap-codeid

AND objvers = gt_rsaabap-objvers

AND codetp = gc_ur.

IF sy-subrc = 0.

SELECT codeid objvers routine updid iciobjnm

FROM rsupdrout

INTO TABLE gt_rsupdrout

FOR ALL ENTRIES IN gt_rsarout

WHERE codeid = gt_rsarout-codeid

AND objvers = gt_rsarout-objvers

AND iciobjnm IN s_iciobj.

IF sy-subrc = 0.

SELECT updid objvers infocube isource

FROM rsupdinfo

INTO TABLE gt_rsupdinfo

FOR ALL ENTRIES IN gt_rsupdrout

WHERE updid = gt_rsupdrout-updid

AND objvers = gt_rsupdrout-objvers

AND infocube IN s_infocb

AND isource IN s_isourc.

IF sy-subrc = 0.

SELECT codeid objvers langu txtlg

FROM rsaroutt

INTO TABLE gt_rsaroutt

FOR ALL ENTRIES IN gt_rsupdinfo

WHERE codeid = gt_rsupdinfo-codeid

AND objvers = gt_rsupdinfo-objvers

AND langu = sy-langu.

SORT gt_rsaabap BY codeid objvers.

SORT gt_rsarout BY codeid objvers.

SORT gt_rsupdrout BY codeid objvers.

SORT gt_rsupdinfo BY objvers updid.

LOOP AT gt_rsaabap ASSIGNING -txtlg.

ENDIF.

APPEND uroutines_wa TO gt_uroutines.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

DESCRIBE TABLE gt_troutines LINES lv_count_ur.

IF sy-subrc = 0.

g_lines = g_lines + lv_count_ur.

ELSE.

  • g_text = text-db4.

  • REPLACE gc_replace IN g_text

  • WITH 'RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

  • MESSAGE g_text TYPE gc_e.

ENDIF.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = '100'

text = 'SELECT RSAABAP, RSAROUT(T), RSUPDROUT, RSUPDINFO'.

Here I have used for all entries removing inner join.Please guide me whether it is right . If not then pls help me to change the initial code into a new one maintaining performance.

Thanks in advance.

Raj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 10:41 AM

    Hello,

    For all select statements you use For all entries dont use inner joins this will increase the performance.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Yes. It increases the performance, but one problem is occuring.

      While I am seeing the changed code in German language it's showing at the top of the report Hit Count: 25, but in the German the initial report is showing Hit Count; 338.

      Kindly guide me on the same. What can be reason behind it?

      Thanks,

      Raj

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.