Skip to Content
-1

Select Data from nth row using ABAP

Jul 17, 2017 at 03:21 PM

75

avatar image

Hello Experts,

My requirement is as follows:

I want to select records from large tables like BSEG etc.

In that case, I want to select only 25000 records at first attempt, do processing on it and then select next 25000 records. this will happen till the last record.

Currently I am using sy-dbcnt variable to do that but it's impacting the performance.

Please suggest if there's any other way to do that.

Regards,

OS

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Horst Keller
Jul 17, 2017 at 03:49 PM
2

From ABAP 7.51 on, there's an addition OFFSET to SELECT.

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abennews-751-open_sql.htm

Before, the PACKAGE SIZE addition to the INTO clause should also be sufficient.

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abapinto_clause.htm

Share
10 |10000 characters needed characters left characters exceeded
David Antonio Arroyo León Jul 17, 2017 at 04:22 PM
-2

Hi Onkar,

Try to avoid to do Select on BSEG Table: For that use BSIK/BSAK for Vendor, BSID/BSAD for Customer and BSIS/BSAD for document details (All Based on Opening or close documents).

Now, in reference on every 25,0000 documents; previously, you can fill an internal table with 25,0000 records and for each 25,0000 records you can use a LOOP sentences in this way.

LOOP AT internal_table INTO structure FROM value_from TO value_final.

ENDLOOP.

Regards,

Share
10 |10000 characters needed characters left characters exceeded
Christian Kalweit Jul 17, 2017 at 03:47 PM
0

Have a look at open cursor/fetch package size. (e.g. at https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapopen_cursor.htm)

Share
10 |10000 characters needed characters left characters exceeded