Establishing a Connection via an ABAP Program 
Purpose
You can activate one or more connections from an ABAP program, and start an external (transaction)program, in the same way as you start an ABAP program from an external system. Certain restrictions apply for setting up communication via LU6.2 from IMS (up to Version 3.1).
Process flow
An external partner program is accessed in accordance with the CPI-C standard as a symbolic name (symbolic destination). This name is used during the initialization call (INIT) to determine the communications parameters, which are needed to establish the connection (ALLOCATE). You must maintain these parameters in the side information table (R/2 host: XCOM, R/3: TXCOM). Amongst other things, they contain system-specific information.
Once the connection is established, the program has send status. Data can now be sent to the partner.
Parallel Connections
If you want to establish several parallel connections, you must ensure that the following call sequence is adhered to:
COMMUNICATION INIT
COMMUNICATION ALLOCATE
...
COMMUNICATION INIT
COMMUNICATION ALLOCATE
...
The sequence
COMMUNICATION INIT... COMMUNICATION INIT... COMMUNICATION ALLOCATE... COMMUNICATION ALLOCATE is not permitted because it causes the first defined communications parameters to be overwritten.Restricted Use of Key Words (R/2)
The ABAP key words listed below cannot be called during a communications session because this causes the conversation to be terminated. The reason for this lies in the internal SAP administration for mode and screen changes.
Debugging (R/2)
When a BREAKPOINT is reached, field contents can be displayed, but the connection is also broken so that a screen change can take place.
Debugging is not permitted under UTM because it violates the UTM rules for distributed transaction processing and causes the task to be terminated with 83Z/KS01.