First read links:
cl_binary_relation=>read_links
then use FM to get links content:
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
EXPORTING
document_id = l_document_id "<= pass ls_links-instid_b here
IMPORTING
document_data = ls_document_data
TABLES
object_header = lt_object_header
object_content = lt_object_content
contents_hex = lt_contents_hex
EXCEPTIONS
document_id_not_exist = 1
operation_no_authorization = 2
x_error = 3
OTHERS = 4.
You might need SCMS_BINARY_TO_XSTRING for hex content and SCMS_TEXT_TO_XSTRING for ASCII content (depends on link, if it is binary file or TXT file...).