SAP COMMUNICATION COMSTEP ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• INIT DESTINATION COMMUNICATION (obsolete)
• ALLOCATE COMMUNICATION (obsolete)
• ACCEPT COMMUNICATION (obsolete)
• SEND BUFFER COMMUNICATION (obsolete)
• RECEIVE BUFFER COMMUNICATION (obsolete)
• DATAINFO COMMUNICATION (obsolete)
• STATUSINFO COMMUNICATION (obsolete)
• DEALLOCATE COMMUNICATION (obsolete)

COMMUNICATION, comstep
Short Reference

ABAP_SYNTAX_OBS
... ${INIT DESTINATION dest$}
$| ALLOCATE
$| ACCEPT
$| ${SEND BUFFER buf$}
$| ${RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat$}
$| DEALLOCATE ...

ABAP_ALTERNATIVES:
1 ... INIT DESTINATION dest
2 ... ALLOCATE
3 ... ACCEPT
4 ... SEND BUFFER buf
5 ... RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat
6 ... DEALLOCATE

What does it do?
There are different alternatives for specifying comstep, each of which is responsible for a connection step.

ABAP Alternative 1 ... INIT DESTINATION dest

What does it do?
The connection between the programs initialized by specifying dest . dest expects a flat character-like data object of the length 8 that, when executing the statement, contains a value from the column SDEST of the DDIC database table TXCOM.
During initialization, the system automatically runs an authorization check on the authorization object S_CPIC. The authorization can be checked before the connection is established using the function module AUTHORITY_CHECK_CPIC.

ABAP Alternative 2 ... ALLOCATE

What does it do?
Establishes a connection to the partner identified in the previous addition DESTINATION. At the same time, a start request is passed to the partner, if it is a program.

ABAP Alternative 3 ... ACCEPT

What does it do?
This addition can be used to accept the established connection in a called partner program. After authentication, the called program is in receive status.

ABAP Alternative 4 ... SEND BUFFER buf

What does it do?
Sends data to the partner program. A data object can be specified for buf, for which all flat elementary types are allowed and the memory requirement of 32000 bytes cannot be exceeded. If the statement COMMUNICATION is executed, the content of buf is passed to the partner program.



Latest notes:

A connection step opened with SEND must be followed by a connection step opened with RECEIVE.
Information loss, for example due to different number formats of the communication partners, is avoided if only character-like types are used for transferring the data. Furthermore, the data is only transferred completely if the sending and receiving buffers have the same structure and length.
ABAP_HINT_END

ABAP Alternative 5 ... RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat

What does it do?
Receives data from the partner program. A data object can be specified for buf, for which all flat elementary types are allowed and the memory requirement of 32000 bytes cannot be exceeded. When the statement COMMUNICATION is executed, the content of buf is taken from the partner program.
After the execution of the statement, the data object dat contains information about whether the data is sent completely, and the content of the data object stat indicates whether the current program is in send or receive mode. Only byte-like data objects are allowed for dat and stat, the length should not be less than 4 bytes. The encoding for the values in dat and stat