When integrating SAP ERP (ECC, S/4 HANA) with SAP Integration Suite, it’s common to create separate destinations for each iFlow. This can lead to an excessive number of destinations, which can be cumbersome to manage. Here are two methods to streamline this process and avoid creating multiple destinations:
One effective way to reduce the number of destinations is to establish certificate-based authentication between SAP ERP and SAP Integration Suite. This method allows you to securely authenticate and communicate without needing a separate destination for each iFlow.
Sample code :
DATA: lo_http_client TYPE REF TO if_http_client.
cl_http_client=>create_by_url( EXPORTING url = 'Pass URL Here'
ssl_id = 'Pass SSL Id'
IMPORTING client = lo_http_client
EXCEPTIONS argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4 ).
* Check for exceptions
IF sy-subrc <> 0.
ENDIF.
* Disable logon popup
lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled.
* Set the HTTP method to POST
lo_http_client->request->set_method( 'POST' ).
* Send the HTTP request
lo_http_client->send(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5 ).
* Check for exceptions
IF sy-subrc = 0.
* Receive the HTTP response
lo_http_client->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 5 ).
ENDIF.
Another approach is to create a general RFC destination in transaction SM59 with only the host specified and leaving the path prefix blank. You can then dynamically set the specific path for each request using the header field ~request_uri.
RFC Destination :
Sample code :
DATA: lo_http_client TYPE REF TO if_http_client.
* Create HTTP client using the destination name
cl_http_client=>create_by_destination(
EXPORTING
destination = 'DestinationName'
IMPORTING
client = lo_http_client
EXCEPTIONS
argument_not_found = 1
destination_not_found = 2
destination_no_authority = 3
plugin_not_active = 4
internal_error = 5
OTHERS = 6 ).
* Check for exceptions
IF sy-subrc <> 0.
ENDIF.
* Disable logon popup
lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled.
* Set the HTTP method to POST
lo_http_client->request->set_method( 'POST' ).
* Set the specific path for the request
lo_http_client->request->set_header_field(
name = '~request_uri'
value = 'PassYourPath' ).
* Send the HTTP request
lo_http_client->send(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5 ).
* Check for exceptions
IF sy-subrc = 0.
* Receive the HTTP response
lo_http_client->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 5 ).
ENDIF.
By implementing these methods, you can significantly reduce the number of destinations required for integration between SAP ERP and SAP Integration Suite, making the process more efficient and easier to manage.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |