SAP Open Server and Open Client Programmers Supplement for Windows Company
Total Page:16
File Type:pdf, Size:1020Kb
PUBLIC SAP Open Server 16.0 SP03 PL07 Document Version: 1.0 – 2019-06-06 SAP Open Server and Open Client Programmers Supplement for Windows company. All rights reserved. All rights company. affiliate THE BEST RUN 2019 SAP SE or an SAP SE or an SAP SAP 2019 © Content 1 Open Client and SAP Open Server Applications.....................................6 1.1 Prerequisites................................................................6 C Compilers.............................................................. 7 1.2 Environment Variables .........................................................7 1.3 Header Files.................................................................7 DB-Library Header Files......................................................8 Client-Library Header Files....................................................8 Server-Library Header Files................................................... 8 1.4 Import Libraries..............................................................8 1.5 Dynamic Link libraries (DLLs) ....................................................9 1.6 Configuration Requirements.................................................... 10 1.7 Platform Specific Default Values..................................................10 1.8 Client-Library Programming Issues................................................11 ct_callback...............................................................11 Installing Debug DLLs .......................................................11 Multi-threaded Support .....................................................12 Example of Compile-and-Link Operations.........................................12 1.9 DB-Library Programming Issues..................................................13 Example of Compile and Link DB-Library......................................... 13 1.10 Server-Library Programming Issues...............................................14 srv_callback..............................................................14 Scheduling Modes.........................................................14 Preemptive Scheduling Mode .................................................15 srv_sleep................................................................15 srv_wakeup..............................................................16 Example of Compile and Link Operations.........................................16 2 Open Client Client-Library/C.................................................. 18 2.1 Using Client-Library Sample Programs.............................................18 Location of the Sample Programs.............................................. 19 Header Files............................................................. 19 example.h File............................................................20 2.2 Summary of Sample Programs...................................................21 Utility Routines for the Sample Programs.........................................22 firstapp.c Sample Program...................................................22 uni_firstapp.c Sample Program................................................23 arraybind.c Sample Program................................................. 23 SAP Open Server and Open Client Programmers Supplement for Windows 2 PUBLIC Content Asynchronous Sample Program...............................................23 blktxt.c Sample Program.................................................... 23 compute.c Sample Program..................................................24 usedir.c Sample Program....................................................24 exconfig.c Sample Program.................................................. 25 csr_disp_implicit.c Sample Program............................................25 il8n.c Sample Program......................................................26 Multi-threaded Sample Program...............................................26 batch_lang.c Sample Program................................................ 26 batch_dynamic.c Sample Program............................................. 26 csr_disp.c Sample Program.................................................. 27 uni_csr_disp.c Sample Program............................................... 27 rpc.c command Sample Program.............................................. 27 uni_rpc.c Sample Program...................................................28 secct.c Sample Program.....................................................28 csr_disp_scrollcurs.c Sample Program.......................................... 28 csr_disp_scrollcurs2.c Sample Program..........................................29 getsend.c Sample Program...................................................29 twophase.c Sample Program................................................. 29 uni_blktxt.c Sample Program.................................................30 uni_compute.c Sample Program...............................................30 wide_dynamic.c Sample Program..............................................30 wide_compute.c Sample Program..............................................30 wide_curupd.c Sample Program............................................... 31 wide_rpc.c sample program..................................................32 3 Open Client DB-Library/C.....................................................33 3.1 Using DB-Library Sample Programs...............................................33 Location of the Sample Programs..............................................34 Header Files.............................................................34 3.2 Summary of Sample Program...................................................36 example1.c Sample Program..................................................37 example2.c Sample Program................................................. 37 example3.c Sample Program..................................................37 example4.c Sample Program................................................. 38 example5.c Sample Program................................................. 38 example6.c Sample Program................................................. 38 example7.c Sample Program..................................................38 example8.c Sample Program................................................. 39 example9.c Sample Program................................................. 39 example10.c Sample Program.................................................40 example11.c Sample Program.................................................40 SAP Open Server and Open Client Programmers Supplement for Windows Content PUBLIC 3 example12.c Sample Program.................................................41 bulkcopy.c Sample Program..................................................41 twophase.c Sample Program..................................................41 4 Server-Library/C for SAP Open Server...........................................42 4.1 Using Server-Library Sample Programs............................................ 42 4.2 Location of the Server Library...................................................43 4.3 Tracing................................................................... 44 4.4 Header Files................................................................44 4.5 Summary of Sample Programs.................................................. 45 Testing the Sample Programs.................................................46 osintro.c Sample Program................................................... 47 ctos.c Sample Program..................................................... 47 dynlisten.c Sample Program..................................................48 lang.c Sample Program..................................................... 48 fullpass.c Sample Program...................................................48 regproc.c Sample Program...................................................48 halang.c Sample Program....................................................49 intlchar.c Sample Program...................................................49 mqueue.c Sample Program.................................................. 49 multthrd.c Sample Program..................................................50 paramreader.c Sample Program...............................................50 redirect.c Sample Program...................................................50 secsrv.c Sample Program....................................................51 sendrpc.c Sample Program...................................................51 timedsleep.c Sample Program.................................................51 updtext.c Sample Program...................................................51 5 Open Client Embedded SQL/C.................................................52 5.1 Building an Embedded SQL/C Executable...........................................52 Command of Precompiling the Application........................................53 Compiling-and-Linking the Application.......................................... 54 Embedded SQL/C Sample Programs............................................55 Header File..............................................................56 example1.cp Sample Program.................................................56 example2.cp Sample Program.................................................57 exampleHA.cp Sample Program...............................................57 uni_example1.cp Sample Program..............................................57 uni_example2.cp Sample Program..............................................57 6 Open Client Embedded SQL/COBOL...........................................