ABAP Channels Part 1 - WebSocket Communication Using ABAP Push Channels - SAP Blogs PDF
ABAP Channels Part 1 - WebSocket Communication Using ABAP Push Channels - SAP Blogs PDF
Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner
About
About
ABAP Connectivity
abap | channel | communication | event | messaging | notificatios | pub
share
0 share
0 tweet share
0 like
6
Follow
Introduction
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 1/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
This blog focuses on the WebSocket integration in ABAP, also known as ABAP
Push Channel (APC).
In order to pass an event from the ABAP engine to an HTML5 based user agent
we decided to integrate the WebSocket protocol into the ABAP
engine.WebSocket provides a bi-directional communication channel over a
TCP/IP socket. It is designed to be implemented in web browsers and web
servers, but in general it can be used by any client or server application.
The WebSocket JavaScript API is standardized by the W3C, whereas the
WebSocket protocol (RFC 6455) is standardized by the IETF. The
WebSocket protocol is supported by many new browsers, e.g. Chrome 14,
Firefox 7.0, IE 10 and Safari on iOS6 (and higher).
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 2/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
ws.onopen = function()
alert(“Message is sent…”);
};
alert(msg.data);
};
ws.onclose = function()
// WebSocket is closed.
alert(“Connection is closed…”);
};
In APC framework the involved events and methods are very similar. A
simple APC class handler would have the following events and methods.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 3/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 4/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
ENDMETHOD.
TRY.
data(lo_message_manager) = i_message->get_context( )-
>get_message_manager( ).
lo_message = lo_message_manager->create_message( ).
lo_message->set_text( i_message->get_text( ) ).
” Send message
lo_message_manager->send( lo_message ).
ENDTRY.
ENDMETHOD.
METHOD if_apc_ws_extension~on_close.
” WebSocket is closed
ENDMETHOD.
ENDCLASS.
The new version of APC class handler would have the following events and
methods, which also supports the Push Channel Protocol (PCP) as
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 5/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
subprotcol.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 6/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
METHOD if_apc_wsp_extension~on_start(
i_context type ref to if_apc_wsp_server_context
i_message_manager type ref to if_apc_wsp_message_manager ).
ENDMETHOD.
METHOD if_apc_wsp_extension~on_message(
i_message type ref to if_apc_wsp_message
i_message_manager type ref to if_apc_wsp_message_manager
i_context type ref to if_apc_wsp_server_context ).
TRY.
lo_message = i_message_manager->create_message( ).
lo_message->set_text( i_message->get_text( ) ).
” Send message
i_message_manager->send( lo_message ).
ENDTRY.
ENDMETHOD.
METHOD if_apc_wsp_extension~on_close(
i_reason type string
i_code type type i
i_context_base type ref to if_apc_wsp_server_context_base ).
” WebSocket is closed
ENDMETHOD.
ENDCLASS.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 7/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
The following diagram (figure 2.0) shows the interaction model of WebSocket
client, e.g. HTML5-enabled browser, and APC framework in the ABAP engine of
the NetWeaver application server.
The main advantage of the integration model is based on the fact that
WebSocket connections are administrated by an ICM process, i.e. the end-
point of a connection is the ICM process and not the ABAP session. This
design helps to reduce resource consumption during inactivity phases of
WebSocket communication. Furthermore APC applications are stateless per
default.This means that each received message is handled in a dedicated
session. The application can preserve its state information either in shared
object areas or database tables.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 8/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
icm/server_port_101 = PROT=WEBSOCKET,PORT=0,TIMEOUT=-1
icm/server_port_102 = PROT=WEBSOCKETS,PORT=0,TIMEOUT=-1
assuming that 101 and 102 are not yet used by other server_ports.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 9/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.1.
Figure 2.2.
Figure 2.3.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 10/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.4.
Figure 2.5.
Figure 2.6.
Figure 2.7.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 11/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.8.
Figure 2.9.
Figure 2.10.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 12/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.11.
The example coding for 740 with support package less than
SP08 is:
METHOD if_apc_ws_extension~on_start.
TRY.
DATA(lo_message_manager) = i_context-
>get_message_manager( ).
DATA(lo_message) = lo_message_manager-
>create_message( ).
lo_message_manager->send( lo_message ).
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 13/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
ENDTRY.
ENDMETHOD.
And the coding for 740 SP08 and later is:
METHOD if_apc_ws_extension~on_start.
TRY.
DATA(lo_message) = i_message_manager-
>create_message( ).
i_message_manager->send( lo_message ).
ENDTRY.
ENDMETHOD.
Figure 2.12.
Figure 2.13.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 14/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.14.
The example coding for 740 with support package less than
SP08 is:
METHOD if_apc_ws_extension~on_message.
TRY.
DATA(lv_text) = i_message->get_text( ).
DATA(lo_context) = i_message->get_context( ).
DATA(lo_message_manager) = lo_context-
>get_message_manager( ).
DATA(lo_message) = lo_message_manager-
>create_message( ).
lo_message_manager->send( lo_message ).
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 15/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
lo_message->set_text( lv_text ).
lo_message_manager->send( lo_message ).
ENDTRY.
ENDMETHOD.
METHOD if_apc_ws_extension~on_message.
TRY.
DATA(lv_text) = i_message->get_text( ).
DATA(lo_message) = lo_message_manager-
>create_message( ).
i_message_manager->send( lo_message ).
lo_message->set_text( lv_text ).
i_message_manager->send( lo_message ).
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 16/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
ENDTRY.
ENDMETHOD.
Figure 2.15.
Figure 2.16.
Figure 2.17.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 17/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.18.
and leave the “Class Builder” via Back (see figure 2.19):
Figure 2.19.
Figure 2.20.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 18/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Figure 2.21.
To test the application just press the Test icon (see figure
2.22):
Figure 2.22.
Figure 2.23.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 19/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
APC Security
Each APC application has a path entry in the transaction SICF. With a new
installation this entry is inactive per default. For an active usage of an APC
application the associated APC path in SICF transaction has to be activated
before. The path to an APC application is /sap/bc/apc/<name
space>/<application name>. For each APC application you can maintain a
dedicated virus/content scan ID for outgoing and incoming messages.
Furthermore we recommend to use the existing escape methods in ABAP,
e.g. the ESCAPE statement, to escape the WebSocket content that is
exchanged between client and server. Finally we highly recommend to use
the secure varaint of WebSocket, i.e. wss instead of ws, for the
communication.
APC Supportability
WIth external breakpoints you can debug the execution of the ON_START,
ON_MESSAGE, ON_CLOSE and ON_ERROR methods similarily to HTTP
handler i.e. by setting breakpoints in the respective methods.
be initiated:
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 20/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Debugging: choose menu bar the entry “Utilities” -> “Debugging” ->
“Activate Debugging“/Deactivate Debugging“
Runtime Analysis: choose menu bar the entry “Utilities” ->
“Runtime Analysis” -> “Activate“/Deactivate”
Kernel Trace: choose menu bar the entry “Utilities” -> “Trace” ->
“Reset Trace“/”Display Trace“/”Activate Trace“/“Deactivate Trace“
The runtime analysis records which start with the prefix “APC:<application
path>”, e.g. “APC:/sap/bc/apc/sap/ping” for a PING application, can be
monitored in transaction SAT.
As you can see from the lines above, the ABAP Push Channel provides the
infrastructure for WebSocket communication in ABAP. The present
implementation of APC supports only the server side of communication based
on stateless sessions, i.e. stateless APC communication similar to stateless
HTTP communication. A stateful APC communication and also an APC client
library are under development.
The next related blog to ABAP Channels is ABAP Messaging Channel (AMC).
AMC blog describes the eventing framework for messages exchange
between different ABAP sessions based on publish/subscribe channels.
Alert Moderator
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 21/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
57 Comments
Hey Masoud,
Very useful feature. Congrats to your team for building this into ABAP stack. I am
exited by its possibilities.
I am building SAP UI5 applications based on NW Gateway services. One of the very
required feature is pessimistic resource locking. Example: If I am editing a purchase
order in UI5 app, no other user using UI5 app should be able to change it.
Within my UI5 application, as soon as someone enters into change mode, I would
create a websocket connection for that client (UI5 library provides an API) and send
the resource id (say PO number). In the server side I would make an entry in a Z
table (with a generated GUID connection ID and PO number) and give back a
success message to the client. If the Z table already has an entry for that PO, then
the server would refuse the lock and push a suitable message. Whenever the user
closes the browser/tab, I suppose that the websocket connection would end, and in
the on_close method, I would remove the entry from the Z table. If the user is
inactive for more than 10 mins, I would end the websocket connection in the client
javascript.
Thanks
Krishna
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 22/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Samson Dass
Hi Krishna,
Regards,
Samson
Hi Krishna,
your proposal sounds good as far as those lock entities, e.g. purchages orders, are
not accessed by other classical transactions, e.g. from within SAPGUI or RFC, using
ABAP enqueue based locks. In that case the enqueue locks and your custom table
for recording of locks are not anymore in sync and this could lead to side effects, e.g.
accessing the order though the order is already marked as locked in the Z* table .
Best regards,
Masoud
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 23/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Surendra Suryawanshi
Hi Masoud,
how I will handle close method . it should call on only when user
explicitly call close or browser close
Thank.
Shadab Shafiq
HI Masoud,
I was trying your example. The part of send/receive works perfectly. But now I
wanted to experiment further based on what you have written about “exchange of
messages between either user sessions“. I first tried to run two instances of same
application and in parallel browser windows and was trying to send message hoping
it should also be received in the other window. But this does not work. I also ceated a
simple html page using the websocket URL just created, but this also works in its
own context it only listens and transmits its own message.
Would the class need to be enhanced further. I tried this on Basis 740 SP-Level
0000.
Warm Regards
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 24/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Shadab Shafiq
Hi Shadab,
this blog is one of the up-coming 3-4 articles around ABAP Channel capabilities. As I
mentioned in the introduction:
…
The ABAP channels supports the following use-cases:
1. 1. ABAP Push Channel (APC): The WebSocket integration in ABAP.
2. 2. ABAP Messaging Channel (AMC): Eventing framework for messages
exchange between different ABAP sessions based on publish/subscribe
channels.
3. 3. Collaboration scenario: Using APC and AMC to push messages from
ABAP sessions to WebSocket clients by binding publish/subscribe channels
to the WebSocket connection.
In this article we focus on the WebSocket framework in ABAP called ABAP Push
Channel.
…
Well I am writing at the moment a blog about ABAP Messaging Channel (AMC) and
additionally I will spend time for the collaboration article which will contain the
information you are looking for. But in the mean time you can have a look into one of
my example in the system. Just execute the APC test application “http(s)://<host>:
<port>/sap/bc/apc_test/ping” in Chrome/Firefox browser, preferably in several
browser windows. Before executing the URL you have to activate the paths
“/sap/bc/apc_test/ping” and “/sap/bc/apc/sap/ping” in the transaction SICF. The
proposed URL executes the APC application “PING” (look into the html source
code) which itself take use of AMC application APC_SIMPLE_TEST to exchange of
messages between different WebSocket connections. You may debug the
ON_START and ON_MESSAGE methods of the APC application “PING” during
execution of the URL.
Best regards,
Masoud
Shadab Shafiq
Hi Masoud,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 25/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Thanks.
Warm Regards
Shadab
Vikas Lamba
Hi Masoud,
I was trying what you did and have a question now. I see that all the test client
examples are using a Web Dynpro application which is of course hosted in the same
NW server and have no security issue communicating.
I tried to write a JS page to make a client and then realized that JS WS API does not
provide any way to pass authorization information to server. So I was getting HTTP
401 instead of a WS upgrade.
Can you share some light on how can I use a JS client to open a WS connection with
ABAP and does it need any additional configurations on server to enable this. I Have
NW 7.4 SP06 installed.
Cheers,
Vikas
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 26/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Hi Vikas,
you can pass the logon data (just for testing) as cgi form parameters,
i.e. sap-client=<client number>&sap-user=<username>&sap-password=
<password>. If the JS WS client page does not reside on the same
ABAP system, then you have to maintain the cross origin access white
list accordingly (refer to cross-origin-access in APC security section).
Each WS access rejection due to cross origin access is reported in
ABAP log, i.e.transaction SM21 on the respective application server.
Alternatively you can create the JS WS client in ABAP system and this
either as a BSP application or as a free style HTTP handler (just have
look into the SICF handler maintained for the path /sap/bc/apc_test/ping
(also have a look to my reply to Shadab).
Best regards,
Masoud
Horst Keller
Can you share some light on how can I use a JS client to open a
WS connection with ABAP
Best
Horst
Vikas Lamba
Hi Horst,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 27/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Regards,
Vikas
Hi Vikas,
Best regards,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 28/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Masoud
Ming Zhang
Hi, Vikas
wss://ldai3ebj.wdf.sap.corp:44315/sap/bc/apc/
sap/zhar_apc_center?sap-client=<client
number>&sap-user=<username>&sap-
password=<password>? Do you encode the
password in BASE64?
Michael Stürmer
Hi Masoud,
Also, I noticed some WebSocket-related (but unfortunately not released) notes in the
web dispatcher patch documentation. Do you know if/when there’ll be official support
for WebSockets in web dispatcher?
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 29/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Thanks,
Michael
Hi Michael,
ON_CLOSE/ON_ERROR handling of APC has been enhanced with NW 740 SP08 release. In the
740 SP08 release contains ON_CLOSE/ON_ERROR method the ini al request interface
parameter as well. The solu on to establish WebSocket context informa on for a WebSocket
connec on is to iden fy the WebSocket connec on id, which is stable for the whole life me
of the connec on. The connec on is then used as key to temporarily persist the context
informa on on the backend, either by using a (buffered) database table or shared objects
areas. Usually you would establish the context informa on for the WebSocket connec on,
i.e. APC applica on context, either in ON_START or in ON_MESSAGE method. And the
cleanup should take place in ON_CLOSE method.
By the way we do not guarantee that the ON_CLOSE method will be executed under all
circumstances, as there are worst-case scenarios which this hinder us to execute any ABAP
coding.
For the iden fica on of the WebSocket connec on id following steps has to be applied:
1. For NW 740 SP05 release (for correct extended passport (EPP) handling for
WebSocket) please apply the kernel patch level 35, i.e. download from
service.sap.com/swdc => Browse our Download Catalog => Addi onal Components
=> SAP Kernel
2. Use follwoing ABAP coding in ON_START/ON_MESSAGE or ON_CLOSE methods to
retrieve the connec on id out of EPP:
TRY.
ENDTRY.
Web Dispatcher supports WebSocket out of the box without any addi onal configura on
since 7.40 patch level 15 and with 7.41 patch level 0.
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 30/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Masoud
Daniel Rothmund
Hi ,
what are the correct settings to use the APC with an SAP WebDispatcher infront ?
Regards
Hi Daniel,
Web Dispatcher supports WebSocket out of the box without any addi onal configura on
since 7.40 patch level 15 and with 7.41 patch level 0.
Kind regards,
Masoud
Daniel Rothmund
Sergiu Popa
Hi Masoud,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 31/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
First of all thank you for writing this blog! I find it very useful as well as the technology
it relates about.
Now to get to the point of this question, I would like to use APC in some applications,
but I have a few concerns regarding limitations in terms concurrent connections to an
APC. Is there any hard-coded restriction in terms of the number of concurrent
connections to an APC?
Best regards,
Sergiu
Hi Sergiu,
rdisp/max_websocket_connections=20000
icm/max_conn=20000
Best regards,
Masoud
SANOOP P S
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 32/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Hi,
Best regards,
Masoud
Manish Majumdar
Hi Masoud,
Really nice Blogs. I really appreciate the time you have put in to show make it
available for SDn users. I was experimeting a bit around this to get rid of the
notification service used in my WD application. So right now I have a WD application
with a HTMLISLAND and have a JavaScript added into it as a Mime Object. I am
creating a Websocket object within my JS function. What I am trying to do is to pass
a value from my actual WD application to the JS function and from JS function I am
trying to pass on the value to the APC~ON_START method. The first part seems to
be easy enough. But I am finding it difficult to pass any value to the ON_START
method. I did checked the Websocket API but I didnt find anything useful for my
purpose.
Regards,
Manish
Hi Manish,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 33/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
you can pass any name-value pairs as part of the WebSocket URL (and
query string) to the APC application, such as
wss://host:port/sap/bc/apc/sap/<myapplication>?
name1=value1&name2=value2. In the APC application <myapplication>
in ON_START or ON_MESSAGE the parameters can be accessed via
context interface IF_APC_WS_CONTEXT and as follow:
METHOD if_apc_ws_extension~on_start.
DATA:
TRY.
lo_binding = i_context->get_binding_manager( ).
lo_request = i_context->get_initial_request( ).
data(lv_message) = lx_apc_error->get_text( ).
ENDTRY.
ENDMETHOD.
Cheers,
Masoud
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 34/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Klaus Keller
Hi Manish,
Regards,
Klaus
Hello,
However when I want to ‘Test’ my APC from Tx SE80, I get the error ‘Function not yet
implemented’
Regards,
Erwin
Hi Erwin,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 35/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Best regards,
Masoud
Hello,
Best regards,
Erwin
Hi Erwin,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 36/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Best regards,
Masoud
santosh pasupunuri
Thanks for Sharing The Knowledge. and i have one Doubt in my Development.
is it Posible To Pass any parameter from Back end and Retrieve it in WD Componet??
Thanks in Advance.
Hi Siva anand,
I do not understand the (end to end) use case. If you like to push
messages/parameters from an ABAP session to another one (WD
component), wheres the target session is a stateful session (here Web
Dynpro session), in this case the ABAP Messaging Channels provide
the necessary infrastructure. Alternatively using the ABAP Channels
collaboration scenario you can push messages/parameters from an
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 37/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Best regards,
Masoud
Nitesh Jain
Hi Masoud,
I built a UI5 application using websockets and I integrated this application into our
SAP Enterprise Portal. When the UI5 application is executed from the portal the
websocket connection with the backend was getting established successfully. We
tried this from multiple PCs and it worked.
Next we modified the application, redeployed it in the backend and re-run the
application from the portal and am facing the following issues:
a. The websocket connection is NOT getting established and I am getting the error
‘Error during websocket handshake: unexpected response code: 403’.
b. Then i tried executing the application from another PC and in this case the
websocket connection is getting established however the modifications made to the
application are not getting reflected.
Then I tried executing the UI5 application directly from the browser and in this case it
worked correctly.
Would appreciate you help in trying to resolve the issues I am getting when
executing the UI5 application from the portal.
Server versions: Portal: SAP EP 7.4, Backend ECC – ECC6 EHP7 SP06
regards
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 38/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Nitesh
Hi Nitesh,
Best regards,
Masoud
Kevin Zhang
Hi Masoud,
Thanks for your contribution. It really helps. Right now I’m developing an UI5
application with ABAP push channel and the APC works fine when test with
WebDynpro WDR_TEST_APC. But I’m stuck when I try to integrate it with UI5. Here is
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 39/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
my JS code
“path”: “/sap/bc/apc”,
“target”: {
“type”: “destination”,
“name”: “ER9CLNT001”,
“entryPath”: “/sap/bc/apc”
},
And the error changed to Firefox can’t establish a connection to the server at
wss://webidetesting3973187-
ori.dispatcher.neo.ondemand.com/sap/bc/apc/sap/zqchart_ws. when running
in Firefox. Do you have any idea about this issue?
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 40/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Best Regards,
Kevin Zhang
Hi Kevin,
Cheers,
Masoud
Kenneth Moore
Hello Masoud,
When I test the Push Channel it does not connect. I push the connect button, but
nothing happens and there is no message. Any ideas?
Thanks,
Kenneth
Hi Kenneth,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 41/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
in Chrome browser you usually find in the developer tools (F12) ->
Network -> WS log entries regarding the connection setup issues.
Cheers,
Masoud
Kenneth Moore
Hi Masoud,
Hi Kenneth,
Cheers,
Masoud
Daniel Rothmund
Hello Masoud,
I tried to add a service user to sicf but I get an 403 from icm.
Regards
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 42/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Hi Daniel,
sure, in that case you have to choose in the respective (external) SICF
service and in the tab “Logon Data” as “Procedure” the option “Required
with Logon Data”. By the way the response code 403 arises (I assume)
since the cross origin policy check of APC failes. Here you have to apply
the SAP note “2123214 – Error handling for ABAP Channels using SYSLOG
entries” .
Cheers
Masoud
Daniel Rothmund
Thx Masoud ,
And also thanks for the hint with the note. I did not know
“RS_AC_READ_SYSLOG”.
BR
Daniel
Paul Hardy
Dear All,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 43/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
In the above comments I have seen several people attempting to add code to a UI5
application in order to initiate a web socket connection and then send a message
from a UI5 application to SAP.
As this works with the test tool in transaction SAPC it must be possible, but no-one
here at least seems to be able to get this to work.
Has anyone in fact managed to write some code in any part of a UI5 application – be
it XML or JS – that manages to establish a connection and then send a message
from the UI5 front end to the SAP back end?
Cheersy Cheers
Paul
Hi Paul,
Cheers,
Masoud
Dren Selimi
Hello Masoud,
ON_MESSAGE, is that what should happen, or I have got it wrong, I that is what
should happen why doesn’t happen, where do you think is my problem ?
Thanks, Dren
Hi Dren,
sorry for the late response. Please have a look into the FAQ – ABAP
Channels.and also note 2353453.
Cheers,
Masoud
Kyle Bitson
Hi Masoud,
I’m getting a 501 (Not Implemented) error when trying to connect to the WS. What
could be causing this, and how could I go about debugging?
Thanks,
Kyle
Hi Kyle,
sorry for late response. I assume there is something wrong with the
creation of you application. Just refer to the FAQ – ABAP Channels, and
the related question “My APC WebSocket connection to the ABAP
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 45/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
application server does not work. Are there known pitfalls? What are the
first steps for troubleshooting?”.
Good luck!
Masoud
Serdar Simsekler
Hello Masoud
Thanks for the blog series. Can I ask how we can have the ABAP side send
messages directly to the e.g. UI5 application through the defined APC without AMC?
Thanks
Serdar
Hi Serdar,
sorry for the late response. From ABAP Server release >= 7.50 we have
established the concept of system-wide access or attach handle to be
able to push data from a session to an existing WebSocket connection.
For this please refer to teh documentation and examples available here.
Cheers,
Masoud
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 46/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
manish sethia
Hello Masoud,
If I call a BAPI inside the method on_message and that BAPI internally calls a
function module which raises an error message then the session ends abruptly. In
normal report programs or classes, that is not the case and standalone BAPI is also
executed successfully.
Thanks,
Manish
Hi Manish,
if you are using an APC stateless application, then this behavior should
not happen, abstractly speaking. It could be that the BAPI runtime
checks some session type specific context information which are not
available in an APC session. That is, if you run a BAPI from withing a
SAPGUI and thus SAPGUI session in SE38 or SE24 in this case the
SAPGUI session has GUI (interaction) capability which is not given in
an APC session. What is the error text of the raised message ? I would
propose to debug both situation, i.e. good and bad case and check what
causes the error.
Cheers,
Masoud
manish sethia
Hello Masoud,
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 47/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
When I call the same BAPI via a report program, the error
is still raised but program continues.
Thanks,
Manish
Hi Manish,
Good luck !
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 48/49
4/16/2018 ABAP Channels Part 1: WebSocket Communication Using ABAP Push Channels | SAP Blogs
Masoud
manish sethia
Dear Masoud,
Regards,
Manish
Add Comment
https://blogs.sap.com/2013/11/18/websocket-communication-using-abap-push-channels/ 49/49