SAP Communication: CPI-C Programming (BC-CST-GW) 
In this documentation, you will learn how to implement program-to-program communication between SAP Systems (R/3 or R/2) and with external programs and systems using SAP’s CPI-C interfaces.
CPI-C programming is only required in the following cases:
The Remote Function Call interface further simplifies the implementation of communication. RFC is an SAP interface based on CPI-C. For more details on RFC, refer to the documentation
Remote Communications.For details on configuration, please refer to the documentation
BC - SAP Communication Configuration.The following topics are discussed in this documentation:
SAP CommunicationProgramming under Various Constellations
CPI-C Implementation in ABAP
CPI-C Interface in C Asynchronous Data Transfer With Q-API Using SAP Test Programs Error AnalysisSpecial Features on R/2 Hosts
Example Programs
Conversion Tables EBCIDC from/to ASCII
Special Features on R/2 Hosts