COMMUNICATION SEND: Send Data 

Use

Data is sent to the communications partner. The type and structure of the data can be agreed upon with the communications partner. The length of the CPI-C buffer is restricted to 32000 Bytes (maximum).

Due to this restriction, it is recommendable to work with a buffer of 28000 Bytes.

Integration

The program, which builds the conversation, has send authorization at first. If a program has send authorization, it can call the following functions:

Send Data

Return the send authorization and wait for data from the partner

Close the connection

Prerequisites

For CPI-C communication in an R/2 IMS environment via the LU6.1 Adapter, the length of the send buffer should not be greater than the LONG MESSAGE in IMS. (Recommendation: Send buffer length <= LONG MESSAGE - 100)

To achieve optimum performance, the transfer unit you choose should be as large as possible (see LENGTH parameter).

Activities

Syntax

COMMUNICATION SEND ID <conv_id>

BUFFER <buf>

[ LENGTH <slen> ]

[ RETURNCODE <rc> ]

Parameter Values

<conv_id>

Conversation ID (input, type C(8)

<buf>

Data buffer (input, type C(?) or structure): Range of the data to be sent

<slen>

No. of characters to be sent (entry, type P)

If the length is not specified explicitly, the defined buffer length is used internally and filled with X'00' or blanks depending on the data type.

<rc>

Return code (output, type X(2))

Alternatively, you can check the value directly via SY-SUBRC.

Return Codes

Value

Explanation

CM_OK

 

CM_PROGRAM_STATE_CHECK

Program is not in send status

CM_DEALLOCATED_ABEND

Partner has closed/interrupted the connection (UTM: Also SYSLOG message 781)

DATA: CONV_ID(8),

BUF(72),

SLEN TYPE P,

RC LIKE SY-SUBRC.

:

BUF = 'Hello World'.

LEN = 11.

COMMUNICATION SEND ID CONV_ID

BUFFER BUF

LENGTH SLEN

RETURNCODE RC.

IF RC <> CM_OK....