Hi all,
Just to add in the Transaction attachments name( hyperlink ) of the document will be empty without this code ( marked bold ).
ls_prop-name = 'KW_RELATIVE_URL'.
ls_prop-value = 'TEST'.
APPEND ls_prop TO lt_properties.
CALL METHOD cl_crm_documents=>create_with_file
EXPORTING
file_name = p_fname
directory = p_file
business_object = ls_bor
properties = lt_properties
IMPORTING
loio = lv_loio
phio = lv_phio
error = lv_error.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Rg Dan