SAP ABAP SYNTAX FOR COMMUNICATION

Variants



1. COMMUNICATION INIT DESTINATION dest ID id.
2. COMMUNICATION ALLOCATE ID id.
3. COMMUNICATION ACCEPT ID id.
4. COMMUNICATION SEND ID id BUFFER f.
5. COMMUNICATION RECEIVE ID id
...BUFFER f
...DATAINFO d
...STATUSINFO s.
6. COMMUNICATION DEALLOCATE ID id.


The COMMUNICATION statement allows you to develop applications which perform direct program-to-program communication. The basis for this is CPI-C (Common Programming Interface - Coummunication), defined by IBM within the context of SAA standards as a standardized communications interface. The COMMUNICATION statement provides the essential parameters for implementing simple communication. Its starter set covers the following functionality:
Establishing a connection Accepting a communication Sending data Receiving data Closing a connection
The other essential part of such a communication is an ABAP/4 program containing a FORM routine which is executed when the connection has been established. This program may be in an R/3 System or an R/2> System. Here, you should be aware that the application programs themselves declare a protocol. In particular, logon to the partner SAP System must be performed in the calling program. The partner programs must also manage different character sets, e.g. ASCII - EBCDIC themselves. A facility known as the Remote Function Call ( RFC ) has now been developed to save users from having to deal with these problems. External programs (e.g. a program written in C on a UNIX workstation) can also be used as partner programs. For this purpose, SAP provides a platform-specific development library.

Variant 1

COMMUNICATION INIT DESTINATION dest ID id.

Addition

... RETURNCODE rc

Effect

Initializes a program-to-program connection.

The partner system is specified in the dest field. You can use any name you like, but it must be entered in the connection table TXCOM and can be no more than 8 characters long. This entry in TXCOM determines to which physical system a connection is established using the symbolic name of the target system.

In the field id , the system assigns an eight-character ID number of type C to the connection. The system field SY-SUBRC contains an appropriate return code value.
All return codes can be read using their symbolic names. For this purpose, you can use the program RSCPICDF which contains these names and can be included, if required.

Addition

... RETURNCODE rc

Effect

Stores the return code in the field rc .

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.

27.5

RELATED POST

SAP ABAP SYNTAX FOR COMMIT
sap internet transaction architecture
SAP internet transaction application components

SAP authorization and client administration in mysap.com
SAP Authorization and ALE
Authorization and implementation of SAP
Mysap market place introduction
Customer interface in mysap market place

No comments :

Post a Comment