We have a open SQL statement in our ABAP Code as given below.
TYPES:
BEGIN OF ty_vbak.
INCLUDE TYPE vbak.
TYPES: asttx TYPE asttx,
asttx_t TYPE j_txt30,
END OF ty_vbak .
DATA: lt_temp_vbeln TYPE HASHED TABLE OF ty_vbak WITH UNIQUE KEY vbeln
SELECT head~vbeln
INTO CORRESPONDING FIELDS OF TABLE lt_temp_vbeln
........
Now when this code is executed on the SQL Server, in the ST12 we can see that a DISTINCT clause has been added to the query as shown below
SELECT DISTINCT "HEAD"."VBELN" FROM ( "VBAK" .........)
So my question is that how come the DISTINCT clause is added to the query?