How to implement and use ABAP Channels - Video Tut...
Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
The ABAP Channels infrastructure offers best support for native event-driven interactive and collaborative scenarios in ABAP and is generally available with ABAP 7.40 Support Package 5 (SP05). The ABAP 7.40 Support Package 8 (SP08) contains various enhancements including API refactoring to support WebSocket subprotocols.and message exchange with SAP Push Channel Protocol (PCP).
Take your time to watch these YouTube video tutorials to learn how to implement and use ABAP Channels.
How to implement ABAP Push Channel (APC) ABAP Push Channel enables bi-directional communication via WebSockets in ABAP. This video gives you step-by-step introduction on how to implement and use ABAP Push Channel.
How to implement ABAP Messaging Channel (AMC) ABAP Messaging Channel enables event-driven communication based on publish/subscribe mechanism for message exchange between different ABAP sessions which can reside on different ABAP Servers. Any ABAP session can subscribe to channels and any ABAP session can publish messages to channels. This video gives you step-by-step introduction on how to implement and use ABAP Messaging Channel.
How to implement collaboration using ABAP Push Channel (APC) and ABAP Messaging Channel (AMC)
The collaboration scenario provides the possibility on the basis of publish/subscribe mechanism of ABAP Messaging Channels and WebSocket implementation of ABAP Push Channel to exchange messages between different WebSocket Clients.This video gives you step-by-step introduction on how to implement collaboration scenario using ABAP Messaging Channel and ABAP Push Channel.
nice blog as usual. Can you release something about the dynpro push channels? I read somewhen a bit about it, but I'm not sure if the APC/AMC is the same?
in releases < 7.40 SP8 the Push Channel Protocol (PCP) handling can be done in application which is per default available with releases >= 740 SP08. The PCP type is per default a text based message type (very similar to HTTP message format without the request/response line part). In ABAP the PCP is realized via class CL_AC_MESSAGE_TYPE_PCP and the respecting interface IF_AC_MESSAGE_TYPE_PCP. In UI5/Fiori the PCP library is provided as sap.ui.core.ws.SAPPcpWebsocket and the messages transferred to an APC application can be deserialized to an PCP object via following line of codes included in ON_MESSAGE method:
TRY.
DATA(lo_pcp) = CL_AC_MESSAGE_TYPE_PCP=>DESERIALIZE(´i_message->get_text( ) ). CATCH cx_ac_message_type_pcp_error INTO DATA(lx_pcp_error).
" apply error handling
CATCH cx_apc_error INTO DATA(lx_apc_error).
"apply error handling
ENDTRY.
Furthermore to create a PCP message in an 740 SP05-S=7 release you will use following code snippet, e.g. in ON_MESSAGE:
TRY. DATA(lo_message_mgr) = i_message->get_context( )->get_message_manager( ). DATA(lo_message) = lo_message_mgr->create_message( ). " transfer of a message via PCP
the WebSocket client, i.e. APC client, is not released in NW ABAP 740 SPx and is only available as prototype ! The general availability is with NW ABAP 750.
Thank you for guides. Could you please clarify is there any way to process AMC messages in async mode (run if_amc_message_receiver~receive asynchronously)?
you can start e.g. an asynchronous RFC (aRFC) in your main program and in this aRFC implement subscription to the AMC to get AMC messages there. As soon as an AMC message is received in this aRFC, it will return to the main program via callback. Just take a look at the Masoud's replyin the "Comments" section of the blog “Say Goodbye to Polling: Real-time eventing in ABAP with ABAP Channels”. There you will find an example report with explanation how to implement it.
thank you for the reply. I have considered such approach, but messages still will be processed successively, the only difference is the main thread is not blocked. So the total processing time will be the same. Apparently it is impossible to build something like rest-service using channels, am I right?
yes, ABAP Messaging Channel (AMC)is not like a REST-based services infrastructure. AMC is based on the publish-subsribe mechanism and acts as a broker between ABAP sessions to exchange messages.
I know this old thread, but I am new to ABAP Channel.
1. Is this considered as a message BUS in SAP ?
2. I am trying to understand the use case for this. For SOA, I understand that the receiver should be always a live "WAITING" and listing for the SENDER. But, when I receive a message, my intention should be that to do some database/transaction action and get back into WAITING mode. As currently with ABAP Channel, I can't add a commit work or submit within the if_amc_message_receiver_text~receive .The WAITING must end to do a DATABASE commit. Can you please explain how can I use this as always WAITING to perform an Action.
How can I get publish/subscribe if I can not do some Like
WAIT=>RECIVE A MESSAGE=>ACTION(with DB reflection)=>WAIT
I missing something, but not sure what it is. Should each "receiving action" program needs to end to do a commit work ?1