Code: Alles auswählen.
lv_archive_id_ed = iv_archiv_id.
CALL FUNCTION 'ARCHIVOBJECT_CREATE_TABLE'
EXPORTING
archiv_id = lv_archive_id_ed
document_type = iv_doc_type
length = lv_length
IMPORTING
archiv_doc_id = lv_arc_id
TABLES
archivobject = lt_archivobject
binarchivobject = lt_bin
EXCEPTIONS
error_kernel = 1
error_communicationtable = 2
error_archiv = 3.
IF sy-subrc = 0.
lv_object_id = iv_sap_belegnr.
lv_sap_object = iv_sap_objekt. "VTTL, VBRK LIKP o.ä.
lv_creadat = sy-datum.
lv_dokumentart = iv_dokumentart.
CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
EXPORTING
archiv_id = lv_archive_id_ed
arc_doc_id = lv_arc_id
ar_date = lv_creadat
ar_object = lv_dokumentart
object_id = lv_object_id
sap_object = lv_sap_object
doc_type = iv_doc_type
EXCEPTIONS
error_connectiontable = 1
OTHERS = 2.
IF sy-subrc <> 0.
RAISE gos_link_error.
ENDIF.
ELSE.
RAISE archiv_create_error.
ENDIF.
ENDIF.
Code: Alles auswählen.
* PDF speichern
lv_so_obj_id = ls_folder_id.
CALL FUNCTION 'SO_DOCUMENT_INSERT_API1'
EXPORTING
folder_id = lv_so_obj_id
document_data = ls_document_data
document_type = 'PDF'
IMPORTING
document_info = ls_docinfo
TABLES
contents_hex = lt_contents_hex
EXCEPTIONS
folder_not_exist = 1
document_type_not_exist = 2
operation_no_authorization = 3
parameter_error = 4
x_error = 5
enqueue_error = 6
OTHERS = 7.
CASE sy-subrc.
WHEN 1.
RAISE folder_not_exist.
WHEN 2.
RAISE document_type_not_exist.
WHEN 3.
RAISE operation_no_authorization.
WHEN 4.
RAISE parameter_error.
WHEN 5.
RAISE doc_insert_error.
WHEN 6.
RAISE doc_insert_error.
WHEN 7.
RAISE doc_insert_error.
ENDCASE.
ls_object_a-instid = iv_objectkey.
ls_object_a-typeid = iv_object.
ls_object_a-catid = 'BO'.
ls_object_b-instid = ls_docinfo-doc_id.
ls_object_b-typeid = 'MESSAGE'.
ls_object_b-catid = 'BO'.
TRY.
CALL METHOD cl_binary_relation=>create_link
EXPORTING
is_object_a = ls_object_a
is_object_b = ls_object_b
ip_reltype = 'ATTA'.
CATCH cx_obl_parameter_error .
RAISE link_parameter_error.
CATCH cx_obl_model_error .
RAISE link_model_error.
CATCH cx_obl_internal_error .
RAISE link_internal_error.
ENDTRY.
IF iv_commit = abap_true.
COMMIT WORK.
ENDIF.
Code: Alles auswählen.
CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
EXPORTING
ar_object = iv_archiv_object
object_id = iv_object_id "z.B. TKNUM
sap_object = iv_sap_object "z.B. VTTK
IMPORTING
archiv_doc_id = lv_doc_id
documentclass = lv_doctyp
CHANGING
infiletab = lt_infiletab
EXCEPTIONS
error_archiv = 1
error_communicationtable = 2
error_connectiontable = 3
error_kernel = 4
error_parameter = 5
error_scanqueue = 6
canceled_by_user = 7
OTHERS = 8.
Folgende Benutzer bedankten sich beim Autor IHe für den Beitrag (Insgesamt 2):
ewx • DeathAndPain
Folgende Benutzer bedankten sich beim Autor Lukas Sanders für den Beitrag:
msfox