on 08-03-2007 9:28 AM
hi friends,
I have Z_BAPI_VEN is the classname, in that method name is
Z_BAPI_VENDOR_GET_DETAILS
i am accessing the z_bapi_vendor_get_details ,but i am unable to access
the z_bapi_ven ..
how to access that z_bapi_ven using jco programming ...
thanks
Hi Tony,
Please post the code that you have implemented.
Rgds,
Prashil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi prashil,
import com.sap.mw.jco.*;
public class Bapi1 extends Object{
JCO.Client mConnection;
JCO.Repository mRepository;
public Bapi1(){
try{
mConnection = JCO.createClient("100","NTWDEV","******",
null,"10.111.11.111","00" );
mConnection.connect();
mRepository = new JCO.Repository("MyRepos", mConnection);
}catch(Exception ex){
ex.printStackTrace();
System.exit(1);
}
JCO.Function function = null;
JCO.Table codes = null;
try{
function = this.createFunction("Z_BAPI_VENDOR_GET_DETAILS ");
if (function == null){
System.out.println("Z_BAPI_VENDOR_GET_DETAILS " + "not found in SAP");
System.exit(1);
}
mConnection.execute(function);
codes = function.getTableParameterList().getTable("IT_LFA");
for( int i = 0; i < codes.getNumRows();i++){
codes.setRow(i);
System.out.println(codes.getString(codes.getName(i));
}
}catch(Exception ex){
ex.printStackTrace();
System.exit(1);
}
mConnection.disconnect();
}
public JCO.Function createFunction(String name) throws Exception{
try{
IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
}catch(Exception ex){
throw new Exception("Probelm retrieving JCO.Fucntion object");
}
}
public static void main(String agrs[]){
Bapi1 app = new Bapi1();
}
My problem is how to access the Bapi ? I am access the Function module
thanks
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.