report print_attachments. data: i_workitems like swwwihead occurs 0 with header line. data: i_attachments type table of swr_object with header line, i_att_buffer type table of swr_object. data: att_key type swotobjid. data: begin of att_obj_key, folder_id type soodk, object_id type soodk, forwardername like soub-usrnam, end of att_obj_key. data: Obj_Container type table of soli with header line. data: sy_retcode type sysubrc. Parameters: wf_id like swwwihead-wi_id. * Get all dependent workitems CALL FUNCTION 'SWI_GET_DEPENDENT_WORKITEMS' EXPORTING WI_ID = wf_id TABLES DEPENDENT_WIS = i_workitems. * Read all attachments refresh i_attachments. loop at i_workitems. refresh i_att_buffer. CALL FUNCTION 'SAP_WAPI_GET_ATTACHMENTS' EXPORTING WORKITEM_ID = i_workitems-wi_id IMPORTING RETURN_CODE = sy_retcode TABLES ATTACHMENTS = i_att_buffer . if sy_retcode eq 0. append lines of i_att_buffer to i_attachments. endif. endloop. * display attachment list loop at i_attachments. write: / i_attachments-shorttext(15), i_attachments-def_attrib hotspot on intensified on. hide: i_attachments-object_id. endloop. clear i_attachments. at line-selection. * display selected attachment check not i_attachments-object_id is initial. clear att_key. move i_attachments-object_id to att_key. clear att_obj_key. move att_key-objkey to att_obj_key. CALL FUNCTION 'SO_OBJECT_READ' EXPORTING FOLDER_ID = att_obj_key-folder_id OBJECT_ID = att_obj_key-object_id TABLES OBJCONT = obj_container EXCEPTIONS ACTIVE_USER_NOT_EXIST = 1 COMMUNICATION_FAILURE = 2 COMPONENT_NOT_AVAILABLE = 3 FOLDER_NOT_EXIST = 4 FOLDER_NO_AUTHORIZATION = 5 OBJECT_NOT_EXIST = 6 OBJECT_NO_AUTHORIZATION = 7 OPERATION_NO_AUTHORIZATION = 8 OWNER_NOT_EXIST = 9 PARAMETER_ERROR = 10 SUBSTITUTE_NOT_ACTIVE = 11 SUBSTITUTE_NOT_DEFINED = 12 SYSTEM_FAILURE = 13 X_ERROR = 14 OTHERS = 15. IF SY-SUBRC = 0. loop at obj_container. write: / obj_container-line. endloop. ENDIF.