Whenever we use open SQL statements to get fetch data in SAP, it will get data from buffer area(depends on table buffer settings) for better performance, but in real world scenarios some tables may updated very frequently(milliseconds), we may need to bypass buffer to get real-time data, in that case we will bypass buffer using 'BYPASSING BUFFER' keyword.
Syntax for SELECT WITH BYPASSING BUFFER in SAP ABAP
select * FROM
INTO TABLE BYPASSING BUFFER.
Example for SELECT WITH BYPASSING BUFFER in SAP ABAP
The below example is used to fetch data from MARA(Material Master) table bypassing buffer.
TYPES: BEGIN OF ty_mara,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
END OF ty_mara.
DATA: it_mara TYPE TABLE OF ty_mara,
wa_mara TYPE ty_mara.
SELECT matnr mtart FROM mara INTO TABLE it_mara BYPASSING BUFFER.
LOOP AT it_mara INTO wa_mara.
WRITE:/ wa_mara-matnr, wa_mara-mtart.
Was this lesson helpful to you? Yes No 17 People out of 17 think this lesson helpful