Video Lesson 5.2: SAP Data Retrieval Using A Select Loop

Video Lesson 5.2: SAP Data Retrieval Using A Select Loop

This lesson shows how to use the ABAP statement SELECT-ENDSELECT to create a loop and retrieve multiple entries from a transparent table.

  • You can use the SELECT loop to read several rows of a database table into the program in succession.
  • The database delivers the data to the database interface of the application server in packages.
  • The specified processing block then copies the records to the target area row-by-row for processing.
  • The return value should be queried after the SELECT loop (that is, after the ENDSELECT statement).
  • You can use the INTO TABLE addition to copy the selected part of the database into an internal table directly instead of doing so row-by-row.
  • This technique is called an array fetch.
  • Since an Array Fetch is not a type of loop processing, no ENDSELECT statement is required or allowed.
  • The Array Fetch must be structured left-justified just like the field list.
  • If an internal table does not meet this prerequisite, you have to use the INTO CORRESPONDING FIELDS OF TABLE addition instead of INTO TABLE.
  • With the array fetch, the content that might be in the internal table is overwritten.
  • If you want to append rows instead, you can use the APPENDING TABLE addition.




Share this on Social Media

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Unit 1 – SAP System Architecture

Unit 2 – Object Navigator, Repository and ABAP Programs

Unit 3 – Transparent tables in the ABAP Dictionary

Unit 4 – Basic ABAP statements, ABAP Structures and ABAP Logical Expressions

Unit 5 – ABAP Data Retrieval

Unit 6 – SAP Analysis Tools

Unit 7 – ABAP Subroutines

Unit 8 – ABAP Events

Unit 9 – ABAP User Interface

Unit 10 – Function Modules, Methods, ALV and BAPI

Unit 11 – Adjusting SAP Standard Software

Unit 12 – ABAP Debugger, Selection Screens, and Table Controls

Unit 13 – ABAP Web Dynpro

Unit 14 – Advanced Topics

Unit 15 – Advanced Topics II

Object Oriented (OO) ABAP

ABAP for SAP HANA (Introduction)

OData and SAP Netweaver Gateway