The *_SINGLE_READ functions
When you need to derive a single record from a database table, you normally use SELECT SINGLE, which is like this in its most basic form, as everyone knows:
SELECT SINGLE *
FROM KNA1
WHERE KUNNR = '1234567890'.Of course, if you are interested in just a few fields, ideally you select them explicitly to avoid copying unnecessary data from one side to the other:
DATA: lv_name1 TYPE name1.
SELECT SINGLE name1 INTO lv_name1
FROM KNA1
WHERE KUNNR = '1234567890'.But this is all obvious and I am rambling as none of this is what brings me to this subject today. Today I want to talk about the valuable standard functions that replace SELECT SINGLE. Many of SAP’s main tables have functions that replace it as their job is precisely to derive records from those tables. For example, the function to derive a record of KNA1 is called KNA1_SINGLE_READ:
