I am trying to validate if a record in a structure is in a cluster table. The code that I thought of using is the following:
REPORT zzz.
DATA: BEGIN OF gs_zfi,
number TYPE bseg-belnr,
END OF gs_zfi.
START-OF-SELECTION.
SELECT SINGLE @abap_true
FROM bseg
INTO @DATA(lv_belnr_exists)
WHERE belnr = @gs_zfi-number. "number field has the same data element as the belnr(belnr_d)
IF lv_belnr_exists IS INITIAL.
MESSAGE a011(zfivald).
ENDIF.
However, I am not allowed to use abap_true in a cluster table. Is there any similar way to check whether a record in the structure, i.e. the field number, exist in the belnr field of the table bseg?