1
votes

Into ABAP channel collaboration, trying to implement 4 scenarios, all of them using PCP protocol, with the help of some really good posts. First two are as provided by the authors, only changes done are relevant to the conversion of the channel from text to PCP

  1. Websocket call from SAPUI5 client, response from backend

Based on ABAP Push / Messaging Channel and SAPUI5 Demo Application, it works fine

  1. Backend communication

Based on https://blogs.sap.com/2014/03/26/abap-channels-part-2-publish-subscribe-messaging-using-abap-messaging-channels/, works fine as well

Here's the AMC channel configuration with both scenarios working (class for scenario 1, reports for scenario 2):

enter image description here

Having the first two working, tried combining them

  1. Message via websocket from the client, delivery to SAP session

Worked just fine (I sent the message from SAPUI5 client and it was received by the GUI backend session), as soon as I removed the APC Channel receiver class, new config below

enter image description here

  1. Message from the backend, delivered to SAPUI5 client (actually, the other 3 served only to reach here)

The idea behind it is removing the report receiver from the authorized programs tab and replacing it again with the APC receiver class, only this time defined as "receive via session", so I can receive the message from the sender report and forward it to the client. Calling SAPUI5 application, connection with APC channel opening as expected, calling backend report, message gets sent correctly by the sender application (sy-subrc = 0, no exception) but seems to go nowhere as a) nothing appears in the client and b) (the most important) break-point inside the on_message method of the APC class is not hit (method not called)

Provided that all other 3 scenarios are working fine, is there something I miss / a specific point that I should have a look or have I understood things completely wrong and scenario 3 works "incidentally"? Scenario 4 AMC configuration below.

enter image description here

1

1 Answers

0
votes

Did you bind the Push Channel to the specific APC Channel?

METHOD if_apc_ws_extension~on_start.

  TRY.
* bind the WebSocket connection to the AMC channel
DATA(lo_binding) = i_context->get_binding_manager( ).
lo_binding->bind_amc_message_consumer( i_application_id = ‘YAMC_TEST’
i_channel_id      = ‘/ping’ ).
CATCH cx_apc_error INTO DATA(lx_apc_error).
DATA(lv_message) = lx_apc_error->get_text( ).
MESSAGE lx_apc_error->get_text( ) TYPE ‘E’.
ENDTRY.

ENDMETHOD.