2009 Aug 05 10:27 AM
Hi
I have some in-house applications which is developed on Oracle Developer 6i. I want to connect my applications from SAP ERP and while doing so I am using the OCX control.
I have generated the code and now able to establish the connection with the SAP. The connection has been establish and I have checked it through SM04 TCode. The established connection are coming over there. Now the problem is to extract data through some RFC.
I want to know the steps which I need to follow for extracting data. My current research tells me that first I have to add the function module in the OLE argument list then set the export and import parameter, call the function and then retrieve the data.
I have written the following code:
vFuncControl := ole2.Create_Obj('SAP.Functions');
vFuncMdl := SAP_ISAPFunctions.ole_Add(vFuncControl,'BAPI_MATERIAL_GET_DETAIL');
vMatExp := SAP_IFunction.exports(vFuncMdl,vOla_Var);
vMatImp := SAP_IFunction.imports(vFuncMdl,TO_VARIANT('RM225'));
I am getting stuck in the export, import, calling and retrieving. I don't know what to pass and to which package. If anyone has any idea then please kindly share it.
Thanks
Imran
2009 Aug 05 1:31 PM
Hello Imran,
Whatever variables you want to pass to SAP system will go in export and wherever variables you are expecting from SAP system will go in import and also there will be tables option to exchange tables between calling program and SAP.
So,
vMatExp := SAP_IFunction.exports(vFuncMdl,vOla_Var);
Means, you are setting value vOla_Var to vMatExp of vFuncMdl.
whereas,
vMatImp := SAP_IFunction.imports(vFuncMdl,TO_VARIANT('RM225'));
Means you are reading values into vMatImp.
To work everything correct your import export & table values should match with the parameters defined in SAP for given function module.
Hope this helps!
Thanks,
Augustin.
Hello Imran,
Whatever variables you want to pass to SAP system will go in export and wherever variables you are expecting from SAP system will go in import and also there will be tables option to exchange tables between calling program and SAP.
So,
vMatExp := SAP_IFunction.exports(vFuncMdl,vOla_Var);
Means, you are setting value vOla_Var to vMatExp of vFuncMdl.
whereas,
vMatImp := SAP_IFunction.imports(vFuncMdl,TO_VARIANT('RM225'));
Means you are reading values into vMatImp.
To work everything correct your import export & table values should match with the parameters defined in SAP for given function module.
Hope this helps!
Thanks,
Augustin.
2009 Aug 05 1:31 PM
Hello Imran,
Whatever variables you want to pass to SAP system will go in export and wherever variables you are expecting from SAP system will go in import and also there will be tables option to exchange tables between calling program and SAP.
So,
vMatExp := SAP_IFunction.exports(vFuncMdl,vOla_Var);
Means, you are setting value vOla_Var to vMatExp of vFuncMdl.
whereas,
vMatImp := SAP_IFunction.imports(vFuncMdl,TO_VARIANT('RM225'));
Means you are reading values into vMatImp.
To work everything correct your import export & table values should match with the parameters defined in SAP for given function module.
Hope this helps!
Thanks,
Augustin.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |