Para poner el numero externo de cliente o proveedor al llamar la BAPI de agregar roles, se puede usar la llamada del metodo SET_CUSTOMER o SET_VENDOR.
data: gt_messages type bapirettab.
parameters: p_parnr type bu_partner.
start-of-selection.
call function 'BUPA_ROLE_ADD_2'
exporting
iv_partner = p_parnr
iv_partnerrolecategory = 'FLVN00'
* IV_X_ALL_PARTNERROLES = ' '
iv_partnerrole = 'FLVN00'
* IV_DIFFTYPEVALUE =
* IV_VALIDFROM =
* IV_VALIDTO = '99991231'
iv_x_save = 'X'
* IV_CREATE_CP =
tables
et_return = gt_messages.
data(lcl_bp_vend) = cvi_bp_vendor=>get_instance( i_partner = p_parnr ).
lcl_bp_vend->set_vendor( p_parnr ). " I have the BP number equal to vendor, but You could use Your own number.
data(lcl_bp_cust) = cvi_bp_customer=>get_instance( i_partner = p_parnr ).
lcl_bp_cust->set_customer( p_parnr ). " I have the BP number equal to vendor, but You could use Your own number.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
else.
call function 'BAPI_TRANSACTION_ROLLBACK'.
endif.
No responses yet