call function 'BAPI_DOCUMENT_GETDETAIL2'
exporting
documenttype = drad-dokar
documentnumber = drad-doknr
documentpart = drad-doktl
documentversion = drad-dokvr
getobjectlinks = 'X'
getcomponents = 'X'
getactivefiles = 'X'
getdocdescriptions = 'X'
getdocfiles = 'X'
getclassification = 'X'
importing
documentdata = l_documentdata
return = l_return
tables
objectlinks = lt_objectlinks
documentdescriptions = lt_documentdescriptions
longtexts = lt_longtexts
statuslog = lt_statuslog
documentfiles = lt_documentfiles "<===store the attachment files
components = lt_components
characteristicvalues = lt_characteristicvalues
classallocations = lt_classallocations
documentstructure = lt_bapi_doc_structure
whereusedlist = lt_whereusedlist.
ls_object_id-class = 'DMS_PCD1'.
ls_object_id-objid = wa_document_file_id-file_id.
call function 'SDOK_PHIO_LOAD_CONTENT'
exporting
object_id = ls_object_id
client = sy-mandt
tables
file_access_info = l_file_access_info
file_content_binary = l_file_content_binary
exceptions
not_existing = 1
not_authorized = 2
no_content = 3
bad_storage_type = 4
others = 5.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = l_file_detail-file_size
first_line = l_file_detail-first_line
last_line = l_file_detail-last_line
importing
buffer = r_file_in_binary
tables
binary_tab = l_file_content_binary
exceptions
error_message = 1
others = 2.
gt_attach_content = cl_document_bcs=>xstring_to_solix( gv_pdf_xstring ).
gv_attach_size = xstrlen( gv_pdf_xstring ).
CL_DOCUMENT_BCS->add_attachment( i_attachment_type = lv_file_type
i_attachment_subject = lv_file_subject
i_attachment_size = gv_attach_size
i_att_content_hex = gt_attach_content
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |