Those who have worked with CRM middleware probably know that it’s possible to send Bdocs with the use of IDOC to PI/PO systems using site type IDOC but there’s also a way to send proxy messages to PI/PO system. The issue is that in order to make it work with just generation the proxy data type needs to be exactly the same as the data type of used internally in the CRM middleware (bdoc). Is there a way then to populate a custom proxy (with a different structure then the CRM internal structure)? The procedure is not very much different than the standard one but as even the standard one is not described anywhere let me show all the steps.
The idea is to distribute BDOC type BUPA_TRANS_MAIN which can contant all information about CRM orders.
Create a new site of type XI – in transaction SMOEAC and configure it to subscribe to BUPA_TRANS_MAIN – this step is more or less described in many guides so I will skip this one.
Next you need to configure your site for the correct interface in transaction – crmxif_c1.
The next step you only need to excute in two cases:
a) either your function CRMXIF_ORDER_MAPSEND does not exits
b) you want to generate a proxy which has the same interface as the internal data type
Excecute program CRMXIF_MAPSEND_GENERATE and run it with interface CRMXIF_ORDER_SAVE
Now the function CRMXIF_ORDER_MAPSEND which invokes correct site will in standard contain only a way to work with IDOCs and XML (not proxies).
If we want to call a custom function module in which we will call the custom proxy we need to change this generated program and include those lines:
* or PO/PI/XI
ELSEIF is_recipient-sitetypeid = c_crmxif_sitetype_xi.
CALL FUNCTION ‘your function module which calls proxy’
is_header = is_header
is_data_mapped = ls_data_mapped
is_recipient = is_recipient
ct_error_segments = ct_error_segments.
Now when the transaction will be saved CRM middleware will call your XI site and the function module which can call any type of proxy. Please remember that in this function module you need to do the mapping between the internal structure and proxy structure.