IF line_exists( lt_contact[ contact_id = 102 ] ).
WRITE: / ‘Record exists’.
ELSE
WRITE: / ‘Record does not exists’.
ENDIF
Contact_id | Contact_Name | Contact_Address |
100 | Mike | Street 10 |
101 | Tom | Street 14 |
102 | Richard | Street 18 |
The line exists condition is true as the Data record with contact_id = 102 exists in the Internal table lt_contact.
In the above case, it will not raise any runtime error such as ‘CX_SY_ITAB_LINE_NOT_FOUND’.