How to use VALUE# (), REF# (), enclosed Internal tables for Table expressions.

DATA(ls_contact) = VALUE # ( lt_contact[ 1 ] ).

WRITE: / ls_contact-contact_id.

DATA( ls_contact_ref) = REF # ( lt_contact[ 1 ] ).

WRITE:/ ls_Contact_Ref->contact_id.

The difference is clearly evident from the syntax. The former one is a value and the latter one is a reference.

The above table shows clearly that an internal table is enclosed with in another internal table. The record in the enclosed internal table can also be accessed using the table expressions.


Data(lv_mobile_name) = lt_contact[2]–mobile_info[2]-mobile_name

Lt_contact is outer internal table and mobile_info is inner internal table