🏆

SAP ABAP 100 Days Challenge

Day 13 — SELECT SINGLE vs SELECT UP TO 1 ROWS

1
0
0
0
0

Interview Question

1. What is the difference between SELECT SINGLE and SELECT UP TO 1 ROWS? 2. When do we use each statement?

Answer

1. SELECT SINGLE retrieves one record using the primary key. 2. It is used when only one unique record is required. 3. SELECT UP TO 1 ROWS retrieves the first matching record based on the WHERE condition. 4. It is useful when multiple records exist but only one record is needed. 5. SELECT SINGLE is generally faster for primary key searches.

Real-Time Example

1. A user enters Sales Order Number 50000123. 2. The program fetches the Sales Order using SELECT SINGLE from VBAK. 3. The business wants the latest Sales Order for Customer 100001. 4. The program uses SELECT UP TO 1 ROWS with ORDER BY to fetch one matching record. 5. The required record is displayed to the user.

Practice Questions

1. What is SELECT SINGLE? 2. What is SELECT UP TO 1 ROWS? 3. When do you use SELECT SINGLE? 4. Which statement is faster for primary key searches? 5. Give one real-time example.

Related Jobs — ABAP

See all

Discussion

to join the discussion.

Be the first to comment.