I have written one query to fetch data from SAP which is giving performance issue. Query is:
IF ROWCOUNT > 0.
ROWCOUNT = ROWCOUNT + ROWSKIPS.
SELECT (outdata_itab-line) FROM (fromClauseString) INTO @<datarow> BYPASSING BUFFER UP TO @ROWCOUNT ROWS WHERE (whereClauseString).
IF SY-DBCNT GT ROWSKIPS.
DO numberFields TIMES.
ASSIGN component sy-index of structure <datarow> to <datafield>.
dataFieldString = <datafield>.
CONCATENATE returnRowString '^~^' datafieldstring INTO returnRowString.
dataline = returnRowString.
INSERT dataline INTO TABLE data.
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.