Difference between select single and select upto 1 rows:-
PROGRAM
*&---------------------------------------------------------------------*
*& Report ZR_SSINGLE_SUPTO1ROWS
*&
*&---------------------------------------------------------------------*
REPORT ZR_SSINGLE_SUPTO1ROWS.
TYPES : BEGIN OF TY_KNB1,
BUKRS TYPE KNB1-BUKRS,
KUNNR TYPE KNB1-KUNNR,
AKONT TYPE KNB1-AKONT,
END OF TY_KNB1.
DATA : LS_KNB1 TYPE TY_KNB1.
SELECT SINGLE BUKRS KUNNR AKONT
*&
*&---------------------------------------------------------------------*
REPORT ZR_SSINGLE_SUPTO1ROWS.
TYPES : BEGIN OF TY_KNB1,
BUKRS TYPE KNB1-BUKRS,
KUNNR TYPE KNB1-KUNNR,
AKONT TYPE KNB1-AKONT,
END OF TY_KNB1.
DATA : LS_KNB1 TYPE TY_KNB1.
SELECT SINGLE BUKRS KUNNR AKONT
FROM KNB1
INTO LS_KNB1
WHERE BUKRS = '5000' AND KUNNR = '0000000224'.
WRITE : / LS_KNB1-BUKRS, LS_KNB1-KUNNR, LS_KNB1-AKONT.
*SELECT BUKRS KUNNR AKONT
*SELECT BUKRS KUNNR AKONT
FROM KNB1
INTO LS_KNB1
UP TO 1 ROWS WHERE BUKRS = '5000'.
* ENDSELECT.
*
*WRITE : / LS_KNB1-BUKRS,
* ENDSELECT.
*
*WRITE : / LS_KNB1-BUKRS,
LS_KNB1-KUNNR,
LS_KNB1-AKONT.