on 11-30-2015 7:29 PM
Hey all,
I extend the TimeEntryCreateBapi and TimeTicket class as you see below;
public class TimeEntryCreateBAPIx extends TimeEntryCreateBAPI
{
public static String COMPLETE_STATUS_GLOBAL = "WO.Complete";
public static String OPERATION_COMPLETE_STATUS_GLOBAL = "WOOperation.Completed";
private JCO.Table _tickets;
private customtime _tt;
protected User _wmUser;
public TimeEntryCreateBAPIx(User u) throws Exception {
super(u);
}
@Override
public void setParameters(SAPObject obj) throws Exception {
// TODO Auto-generated method stub
super.setParameters(obj);
setValue(_tickets, new Logger(_user, "setParameters"), "PERS_NO",
_tt.getLb());
}
}
public class customtime extends TimeTicket
{
public customtime(com.syclo.sap.workmanager.User u) {
super(u);
_user = u;
// TODO Auto-generated constructor stub
}
@Override
public void setProperties(ConfirmationCreateBAPI b) {
// TODO Auto-generated method stub
super.setProperties(b);
setLb(_user.getString("transaction.LaborCode"));
}
public String lb;
public String getLb() {
return lb;
}
public void setLb(String lb) {
this.lb = lb;
}
}
I put the jar into agentry.ini file and deploy the content. I change the class definition in the config panel, when i test the application i got this error;
LaborAddSteplet::throwExceptionToClient::688::LaborAddSteplet - |
2015 11 30 10:59:05#0-800#ERROR#System.err###Agentry SAPWM16 Worker Thread########com.syclo.agentry.BusinessLogicException |
2015 11 30 10:59:05#0-800#ERROR#System.err###Agentry SAPWM16 Worker Thread######## at com.syclo.sap.User.rethrowException(User.java:1128) |
2015 11 30 10:59:05#0-800#ERROR#System.err###Agentry SAPWM16 Worker Thread######## at com.syclo.sap.workmanager.stephandler.LaborAddStepHandler.run(LaborAddStepHandler.java:45) |
2015 11 30 10:59:05#0-800#ERROR#System.err###Agentry SAPWM16 Worker Thread######## at com.syclo.sap.workmanager.steplet.LaborAddSteplet.execute(LaborAddSteplet.java:71) |
2015 11 30 10:59:05#0-800#ERROR#System.err###Agentry SAPWM16 Worker Thread######## at com.syclo.sap.Steplet.doSteplet(Steplet.java:169) |
2015 11 30 10:59:05#0-800#ERROR#com.sap.mobile.platform.server.agentry.console###Agentry SAPWM16 Worker Thread########Exception: 10:59:05 11/30/2015 : 20 (Agentry3), Java Business Logic Error (com.syclo.agentry.BusinessLogicException: LaborAddSteplet - ), |
If you are using SMP the jar name needs to be added to the management cockpit before the other jar files listed.
If you Production Logic, you need to create a new deployment file (with a new Agentry application version) and upload it to the server.
Also for Agentry you need to declare the variables as public and not private.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adem,
you have to configure this bapi class in configpanel.
to configure bapi class we have two parameters.
1. BAPI_CLASS -> so bapi class will be like TimeEntryCreateBAPI = Fully qualified name of extended TimeEntryCreateBAPI.
2. BAPI_WRAPPER -> configuration will be like "fully qualified name of extended TimeEntryCreateBAPI = name of the SAP BAPI"
whenever we extend the bapi class in Java it is mandatory to maintain above two methods in configpanel.
After setting this parameter dont forget to restart Agentry instance.
Thanks
Ajitesh
Hey,
Thank you very much for your response;
I got this error when i chaned the two parameter on the config panel.
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread########User::rethrowException::JAVA.LANG.CLASSNOTFOUNDEXCEPTION: |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT JAVA.LANG.CLASS.FORNAME0(NATIVE METHOD) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT JAVA.LANG.CLASS.FORNAME(CLASS.JAVA:264) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT COM.SYCLO.SAP.BAPIFACTORY.CREATE(BAPIFACTORY.JAVA:64) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT COM.SYCLO.SAP.WORKMANAGER.STEPHANDLER.LABORADDSTEPHANDLER.RUN(LABORADDSTEPHANDLER.JAVA:39) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT COM.SYCLO.SAP.WORKMANAGER.STEPLET.LABORADDSTEPLET.EXECUTE(LABORADDSTEPLET.JAVA:71) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## AT COM.SYCLO.SAP.STEPLET.DOSTEPLET(STEPLET.JAVA:169) |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread######## |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread########throwExceptionToClient::begin |
2015 12 01 03:54:21#0-800#INFO#System.out###Agentry SAPWM17 Worker Thread########throwExceptionToClient::com.syclo.sap.workmanager.steplet.LaborAddSteplet::throwExceptionToClient::9920::LaborAddSteplet - |
2015 12 01 03:54:21#0-800#ERROR#System.err###Agentry SAPWM17 Worker Thread########com.syclo.agentry.BusinessLogicException: |
2015 12 01 03:54:21#0-800#ERROR#System.err###Agentry SAPWM17 Worker Thread######## at com.syclo.sap.User.rethrowException(User.java:1128) |
2015 12 01 03:54:21#0-800#ERROR#System.err###Agentry SAPWM17 Worker Thread######## at com.syclo.sap.workmanager.stephandler.LaborAddStepHandler.run(LaborAddStepHandler.java:45) |
2015 12 01 03:54:21#0-800#ERROR#System.err###Agentry SAPWM17 Worker Thread######## at com.syclo.sap.workmanager.steplet.LaborAddSteplet.execute(LaborAddSteplet.java:71) |
2015 12 01 03:54:21#0-800#ERROR#System.err###Agentry SAPWM17 Worker Thread######## at com.syclo.sap.Steplet.doSteplet(Steplet.java:169) |
2015 12 01 03:54:21#0-800#ERROR#com.sap.mobile.platform.server.agentry.console###Agentry SAPWM17 Worker Thread########Exception: 03:54:21 12/01/2015 : 20 (Agentry3), Java Business Logic Error (com.syclo.agentry.BusinessLogicException: LaborAddSteplet - ), |
Do you also have to extend LaborAddStepHandler this class. Because it calls TimeEntryCreateBAPI the bapi that i extended.
@Stephen Streeter and @Ajitesh Upadhyaya any other thing that i missed to do.
Hey Thank you for the answer,
I extend those classes. I got null pointer error wth this code. Do you have any advice when i read the code.
LaborAddStepletEx - Problem in BAPI Create (/SMERP/PM_DOWORKORDERCONF_CRT): while trying to invoke the method com.syclo.sap.component.cats.object.Labor.getLaborCode() of a null object loaded from field com.syclo.sap.customworkmanager.bapi.TimeEntryCreateBAPIx.l of an object loaded from local variable 'this'
@Stephen Streeter @Ajitesh Upadhyaya @Bill Froelich
Adem,
You could request to SAP to provide source code.
otherwise you can use below mentioned plugin in to your eclipse editor.
just copy the URL path and install it in to your eclipse editor than restart the editor.
Now you will be able to see standard java classes.
Thanks
Ajitesh
Adem,
This error is coming because of super class(TimeTickets).
while setting up the value in sub class the parameter(obj value) becomes "null" thats why it is returning nullpointer exception.
could you please paste a screen shot over here how you have configured your customized as well as standard bapiclass and timeTicket object class in configpanel?
I think you have mapped this incorrectly.
Ajitesh
Hey Upadyaya,
Thank you for responding.
Here is my story:)
Firstly, i changed the java class of steps;
This is the LaborAddStepEx
This is LaborAddStepHandlerEx
This is TimeEntryCreateBAPIx
After all, i export my jar into java folder of my application and write the classpath as below;
This my mappings on config panel;
Hey Upadhyaya,
I didnt deactivate the classes in config panel, i modify them to use extended classes.
At this time, i didnt modify timeticket class. I just want to get current laborcode and use it in the timeenreycreatebapix class.
Below code throw an exception.
setValue(_tickets, new Logger(_user, "setParameters"), "XXX",l.getLaborCode());
in this case, that i m not extending the timeticket classes, what i missed i dont know
Hey Upadhyaya
Thank you for your help.
I missed a line of code in my class,
now it works.
_tickets = _tables.getTable("IT_TIMETICKETS"); |
Any help will be appraceted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.