Code: Alles auswählen.
call function 'ARCHIV_GET_CONNECTIONS'
exporting
objecttype = 'VBRK'
object_id = object_id " invoice no.
tables
connections = connections
exceptions
nothing_found = 1
others = 2.
Code: Alles auswählen.
LOOP AT connections INTO connection.
CALL FUNCTION 'ARCHIVOBJECT_GET_TABLE'
EXPORTING
archiv_id = connection-archiv_id
document_type = doc_type " = connection-reserve
archiv_doc_id = connection-arc_doc_id
IMPORTING
binlength = binlength
TABLES
binarchivobject = binary_file
EXCEPTIONS
error_archiv = 1
error_communicationtable = 2
error_kernel = 3
OTHERS = 4.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = length
importing
buffer = document
tables
binary_tab = binary_file
exceptions
failed = 1
others = 2.
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = binary_file
tables
binary_tab = binary_tab.
mail_document->add_attachment( " Hier sind wir schon bei CL_BCS !
exporting
i_attachment_type = 'PDF'
i_attachment_subject = 'Ich bin ein Test'
i_att_content_hex = binary_tab ).
ENDLOOP.