I_PURCHASE_REQUISITION Type EBAN-BANFN
I_PURCHASE_ORDER Type EKKO-EBELN
method gos_alink_copy_link_pr_to_po.
data: mt_connections type standard table of toav0.
data: ms_toavo type toav0.
data: m_object type toav0-object_id.
field-symbols: <toavo> type toav0.
check i_purchase_requisition is not initial and i_purchase_order is not initial.
m_object = i_purchase_requisition.
cl_alink_connection=>find(
exporting
sap_object = 'BUS2105'
object_id = m_object
mandt = sy-mandt
* archiv_id = archiv_id
* arc_doc_id = arc_doc_id
* ar_object = ar_object
* from_ar_date = from_ar_date
* until_ar_date = SY-DATUM
* doc_type = doc_type
* del_date = del_date
* limited = limited
no_auth_check = 'X'
* limit = limit
* parameter = parameter
importing
* count = count
* reducedbylimit = reducedbylimit
* reducedbyauthority = reducedbyauthority
connections = mt_connections
exceptions
not_found = 1
error_authorithy = 2
error_parameter = 3
others = 4
).
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at mt_connections assigning <toavo>.
clear ms_toavo.
move-corresponding <toavo> to ms_toavo.
ms_toavo-object_id = i_purchase_order.
ms_toavo-sap_object = 'BUS2012'.
cl_alink_connection=>insert(
exporting
link = ms_toavo
* barcode = barcode
* receiving
* tab_name =
exceptions
error = 1
others = 2
).
if sy-subrc eq 0.
endif.
endloop.
endmethod.