这段SDK是为Windows平台设计的SAP NetWeave软件开发工具包,内含作者定制开发的一系列接口封装类,极大简化了与SAP系统的集成和交互过程。
这段代码使用了 SAP NWRFCSDK 7.1 for win32 接口封装类 Rfc_Communication,并通过 Value_Pool 收集返回的数据。仅需几行简单代码即可完成对 SAP 系统 RFC 函数的调用。
首先,日志记录显示正在创建函数:
```cpp
wxLogMessage(_(SAP正在创建函数...));
fun_handle = Thread_rfc_com->Create_Function(wxT(ZAP_PS_PROJECT_INFO), fun_handle_desc);
```
接着填充参数并进行相应的日志记录:
```cpp
wxLogMessage(_(rfc函数正在填充参数...));
Thread_rfc_com->fillFunctionParameter(fun_handle_desc, fun_handle, wxT(CE_WERKS), s_plant);
Thread_rfc_com->fillFunctionParameter(fun_handle_desc, fun_handle, wxT(CE_START_DATE), array_wbs.Item(0));
Thread_rfc_com->fillFunctionParameter(fun_handle_desc, fun_handle, wxT(CE_END_DATE), array_wbs.Item(1));
```
然后,日志显示正在运行函数:
```cpp
wxLogMessage(_(SAP正在运行函数...));
Thread_rfc_com->RunFunction(fun_handle);
```
接下来获取项目的基本信息和参数,并记录相应的操作:
```cpp
wxLogMessage(_(SAP正在获取项目基本信息...));
pool_basic = Thread_rfc_com->GetResult(wxT(OT_PROJ), fun_handle_desc, fun_handle);
wxLogMessage(_(SAP正在获取项目参数...));
pool_para = Thread_rfc_com->GetResult(wxT(OT_CONF), fun_handle_desc, fun_handle);
```
最后,日志记录显示销毁访问函数:
```cpp
wxLogMessage(_(SAP销毁访问函数...));
Thread_rfc_com->DestroyFunction(fun_handle);
```