cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Asynchronous webservice - CRM WEBic

Former Member
0 Kudos

Hi Experts,

I have a scenario where i have to fetch details from a third party system via a webservice call. However the response from the third party system can only be asynchronous. The requirement is to display the data returned from the third party on the webic when the response comes in.

Ideally -

  • A user can log on to a screen and trigger the request
  • Their session will not be locked, there should be no spinning wheel wait.
  • The request can be processed and the response back to SAP WebIC will then alert the user that it has completed
  • The user should not have to continually refresh their screen to see if the response has come back in

Firstly, is this technically  possible with the CRM webIC? or are there any customization or workaround that you can suggest to achieve this?

Thanks in advance for any suggestions.

Regards,

Alan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This is definitely possible in CRM WEB IC.

There are many ways of doing it.

Easiest would be as below.

1. Create one custom FM and call it on your button STARTING NEW TASK and PERFORMING CUSTOM_ROUTINE as shown below.

Declare variable in the Same FM group where your custom FM is created of type STRING.

CALL FUNCTION 'Custom FM ZZZZZZ for triggering web service'

             STARTING NEW TASK iv_task_id DESTINATION 'NONE'

             PERFORMING HANDLE_CALLBACK ON END OF TASK

             EXPORTING

               PARAMETERS  = PARAMETERS.

Put the below code in above FM.

GV_STRING =  cl_icwc_session_registry=>GET_AGENT_SESSION_QUEUE( ).


Then call the web service.

2. In the same FM after statement ENDFUNCTION or in the same Function group add include program with the custom subroutine.

FORM HANDLE_CALLBACK USING TASK_ID.

Here you will read the response of web service with DO ENDDO LOOP and WAIT 1 or 2 Seconds.

As soon as you get response from Web Service You will exit from the loop and trigger the alert on USER with following code.

call function 'CRM_IC_5X_EXT_ALERT'

Exporting

CONNECTION_KEY = GV_STRING

ALERT_MESSAGE = 'Please check the webservice response'

ALERT_NAVLINK = 'OPTIONAL : Any Navlink you want to put '.

ENDFORM.

Let me know if this works.

Regards,

Naresh