Sometime we need to get the full url of one attachment via code in Webclient UI component.
Suppose we need to get the full url of the first attachment with name "jerry text":
first we can get the logical object instance of that attachment via the code described here:
Then we can use the following code to get the full url of the attachment.
DATA: lv_host TYPE string.
DATA(lo_runtime) = cl_bsp_runtime=>get_runtime_instance( ).
DATA(lo_url) = NEW cl_url( server = lo_runtime->server ).
" now the <hostname>:<port number> is stored in lv_host
lo_url->host( CHANGING url = lv_host ).
the class and logical object id could be got via the code.
DATA(ls_object) = VALUE SDOKOBJECT( class = 'BDS_POC22' objid = '00163EA720041EE39FCBA3AE92BAC92D' ).
DATA(lv_att_url) = cl_sdc_bsp_utilities=>phio_get_url_for_get( request = lo_runtime->server->request object_id = ls_object ).
lv_att_url = lv_host && lv_att_url.
the full url looks like below and could directly be entered in IE to view the attachment content.