SAP ABAP SYNTAX FOR COMMUNICATION PART TWO

Variant 2

COMMUNICATION ALLOCATE ID id.

Addition

As for variant 1.

Effect

Sets up a program-to-program connection. The call must immediately follow COMMUNICATION INIT .

Example

 
TYPES: CONVERSATION_ID(8) TYPE C,
       DESTINATION(8)     TYPE C,
       RETURN_CODE        LIKE SY-SUBRC.
DATA:  CONVID  TYPE CONVERSATION_ID,
       DEST    TYPE DESTINATION VALUE 'C00',
       CPIC_RC TYPE RETURN_CODE.
INCLUDE RSCPICDF.
 
COMMUNICATION INIT DESTINATION DEST
                   ID          CONVID
                   RETURNCODE  CPIC_RC.
IF CPIC_RC NE CM_OK.
   WRITE: /'COMMUNICATION INIT, RC = ', CPIC_RC.
   EXIT.
ENDIF.
COMMUNICATION ALLOCATE ID CONVID RETURNCODE CPIC_RC.
IF CPIC_RC NE CM_OK.
   WRITE: /'COMMUNICATION ALLOCATE, RC = ', CPIC_RC.
   EXIT.
ENDIF.

Variant 3

COMMUNICATION ACCEPT ID id.

Addition

As for variant 1.

Effect

Accepts a connection requested by the partner program. id is a field of type C which is 8 characters long and contains the ID of the accepted connection after a successful call.

Example

 
FORM CPIC_EXAMPLE.
  TYPES: CONVERSATION_ID(8) TYPE C,
         RETURN_CODE        LIKE SY-SUBRC.
  DATA:  CONVID  TYPE CONVERSATION_ID,
         CPIC_RC TYPE RETURN_CODE.
  INCLUDE RSCPICDF.
  COMMUNICATION ACCEPT ID CONVID
                       RETURNCODE  CPIC_RC.
  IF CPIC_RC NE CM_OK.
     EXIT.
  ENDIF.
ENDFORM.



RELATED POST
 
Authorization and implementation of SAP
Mysap market place introduction
 Customer interface in mysap market place

2 comments :