on 10-12-2006 10:20 AM
Hi all,
I have written code to connect to businessone.It is connecting.But after that the error is coming....
code written is.....
String c="C40001";
getConnection();
System.out.println("Connected");
IDocuments objServiceCall=SBOCOMUtil.newDocuments(company,SBOCOMConstants.BoObjectTypes_oServiceCalls);
objServiceCall.setCardCode(c);
objServiceCall.setDocDate(new Date());
int i=objServiceCall.add();
String callId=company.getNewObjectKey();
**********************************************************
Error:
com.sap.smb.sbo.wrapper.com.ComFailException: Invoke of: GetBusinessObject
Source: SAPbobsCOM.Company.6.7
Description: You are not connected to a company
at com.sap.smb.sbo.wrapper.com.Dispatch.invokev(Native Method)
at com.sap.smb.sbo.wrapper.com.Dispatch.invokev(Unknown Source)
at com.sap.smb.sbo.wrapper.com.Dispatch.callN(Unknown Source)
at com.sap.smb.sbo.wrapper.com.Dispatch.call(Unknown Source)
at com.sap.smb.sbo.api.Company.getBusinessObject(Unknown Source)
at com.sap.smb.sbo.api.SBOCOMUtil.newDocuments(Unknown Source)
at in.mobileone.www.b1.CreateServiceCall.main(CreateServiceCall.java:35)
Exception in thread "main"
Is it the correct approach or not.
any one guide me in this issue.
Thanks&Regards
Madhu
Well it sounds pretty self explanatory. Did you connect
successfully to a company before your code ? all the
object operations (add / update / delete / etc) need
to happen in the context of a connected company.
Have a look at the e-learning section here on SDN about
DI API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gianluigi,
What you said is correct.At that time my system has some problem with businessone.Now the company object is creating.But the error is showing at
the line of code....
objServiceCall.setCardCode("C40001");
no mapping found for cardcode...
Is the above send code is correct? or there is another way to approach to create a service call through DI API.
Thanks
Madhu
Madhu,
I don't think there's another way using DI, but you could auto fill the form information using UI, and auto-clicking the Add button.
That's another way, a bit different, but human intervention is required to invoke the process.
-
-
Alfredo Pérez
SAP Developer & Consultant
alperal (at) gmail.com
User | Count |
---|---|
95 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.