cancel
Showing results for 
Search instead for 
Did you mean: 

Java Business Logic Error

Former Member
0 Kudos

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 - ),  |

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hey,

getting this error now;

BAPIWRAPPER NAME FROM THE INI FILE OR SAP MOBILE CONFIGURATION. PLEASE CHECK THE INI FILE OR THE MOBILE CONFIGURATION FOR THE BAPI KEY (COM.SYCLO.SAP.WORKMANAGER.BAPI.TIMEENTRYCREATEBAPI) EITHER IN SECTIONS BAPI_WRAPPER OR REQUIRED_BAPI_WRAPPER |

Former Member
0 Kudos

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

Former Member
0 Kudos

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 - ),  |

Former Member
0 Kudos

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.  

Former Member
0 Kudos

Hi Adem;

Yes, you will have to extend all your 4 classes, object, bapi, steplet and stephandler and also reference your extension steplet on your fetch, that is, if you are trying to fetch custom fields.

Regards;

Sizo Ndlovu

Former Member
0 Kudos

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'

Former Member
0 Kudos

Adem;

My best pointer at this point would be for you to debug line to line and see where exactly it breaks.

Good luck.

Regards;

Sizo

Former Member
0 Kudos

hey Sizolwenkosi,

i dont have the source codes. when i debugged it the only line that i see my extended classes.

is there any other way to debug that you know.

Regards,

Adem

Former Member
0 Kudos
Former Member
0 Kudos

Instead of tried to get the laborcode, i put a constant like below;

and i got  this error;

JAVA.LANG.NULLPOINTEREXCEPTION: WHILE TRYING TO INVOKE THE METHOD COM.SYCLO.SAP.JCO.JCO$RECORD.SETVALUE(JAVA.LANG.STRING, JAVA.LANG.STRING) OF A NULL OBJECT LOADED FROM LOCAL VARIABLE 'RECORD' |

Former Member
0 Kudos

Adem,

You could request to SAP to provide source code.

otherwise you can use below mentioned plugin in to your eclipse editor.

Mchr3k Eclipse Update Site

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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;

Former Member
0 Kudos

Have you already deactivated standard classes in configpanel?

Also how you have configured TimeTickets class?

still i am confused why you have created all the classes.. Anyway try to set your custom timeticket class in bapi class and call it will work.

Former Member
0 Kudos

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

Former Member
0 Kudos

If you are not using standard class like steplet, stephandler, bapi and if you are creating your own than you have to also include custom object class.

Former Member
0 Kudos

Hey Upadhyaya

Thank you for your help.

I missed a line of code in my class,

now it works.

_tickets = _tables.getTable("IT_TIMETICKETS");

Answers (1)

Answers (1)

Former Member
0 Kudos

Any help will be appraceted.