Skip to Content
0
Former Member
Oct 23, 2015 at 02:34 PM

Successfactors LMS sytem integration with ERP

90 Views

Hi,

Actually my requirement is to fetch Employee learning history data from Successfactors LMS system to ERP system. By Using Rest API I can pull that data as shown in the below screen shot.

I tried to get data from LMS system to SAP ERP system as shown below, but I am getting 407 - ICM_HTTP_SSL_ERROR. Please let me know is there any possibility for this.

REPORT ZZLMS_DMS_INTEGRATION_TEST.

DATA: lo_http_client TYPE REF TO if_http_client,

lv_service TYPE string,

lv_result TYPE string,

lo_ixml TYPE REF TO if_ixml,

lo_streamfactory TYPE REF TO if_ixml_stream_factory,

lo_istream TYPE REF TO if_ixml_istream,

lo_document TYPE REF TO if_ixml_document,

lo_parser TYPE REF TO if_ixml_parser,

lo_weather_element TYPE REF TO if_ixml_element,

lo_weather_nodes TYPE REF TO if_ixml_node_list,

lo_curr_node TYPE REF TO if_ixml_node,

lv_value TYPE string,

lv_node_length TYPE i,

lv_node_index TYPE i,

lv_node_name TYPE string,

lv_node_value TYPE string.

*DATA: lo_json TYPE REF TO /ui2/cl_json.

DATA: lv_json TYPE string,

lv_x_json TYPE xstring,

lv_subrc TYPE sy-subrc,

lv_errortext TYPE string.

lv_service = 'https://XXXXXX/learning/oauth-api/rest/v1/token'.

cl_http_client=>create_by_url(

EXPORTING

url = lv_service

IMPORTING

client = lo_http_client

EXCEPTIONS

argument_not_found = 1

plugin_not_active = 2

internal_error = 3

OTHERS = 4 ).

lo_http_client->request->set_method(

method = if_http_request=>co_request_method_post ).

lo_http_client->request->if_http_entity~set_content_type(

content_type = 'application/json' ).

lv_json = '{"grant_type": "client_credentials","scope":{"userId":"111035","companyId":"xxx-sbx","userType":"user","resourceType":"learning_public_api"},"client_id":"xxx-sbx",'

&& '"client_secret":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"'.

lo_http_client->request->if_http_entity~set_cdata( data = lv_json ).

lo_http_client->send(

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2 ).

lo_http_client->receive(

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3 ).

IF sy-subrc <> 0.

CALL METHOD lo_http_client->get_last_error

IMPORTING

code = lv_subrc

message = lv_errortext.

WRITE:/ 'Error: ', lv_subrc, '-', lv_errortext.

EXIT.

ENDIF.


OUTPUT: I am getting 407 - ICM_HTTP_SSL_ERROR.

Please help me is it possible to design code like this.

Attachments

LMS.png (27.6 kB)