Skip to Content
0
Former Member
Jun 08, 2016 at 12:31 PM

Performance issue in select query

857 Views

Hi Experts,

I have written one query to fetch data from SAP which is giving performance issue. Query is:

IF ROWCOUNT > 0.

ROWCOUNT = ROWCOUNT + ROWSKIPS.

ENDIF.


SELECT (outdata_itab-line) FROM (fromClauseString) INTO @<datarow> BYPASSING BUFFER UP TO @ROWCOUNT ROWS WHERE (whereClauseString).

CLEAR: returnRowString.

IF SY-DBCNT GT ROWSKIPS.

DO numberFields TIMES.

ASSIGN component sy-index of structure <datarow> to <datafield>.

dataFieldString = <datafield>.

CONCATENATE returnRowString '^~^' datafieldstring INTO returnRowString.

ENDDO.

dataline = returnRowString.

INSERT dataline INTO TABLE data.

ENDIF.

ENDSELECT.


Everything mentioned in select query is coming dynamically from front end. We have 2 parameters called ROWCOUNT and ROWSKIP based on which data is going to front end. Input for these 2 fields comes in loop from front end.


If condition mentioned in bold is giving issue when sy-dbcnt is more.


Please help me in finding way to escape this.


Thanks!


Akanksha