cancel
Showing results for 
Search instead for 
Did you mean: 

[Work Manager 6.5.1] Issue with extending Part class

Former Member
0 Kudos
392

Hi SAP Experts,

I was having an issue with adding a field ZRecipient (WEMPF) which has been already existed on backend to Java class ZPart (extension of standard Part java class).

The error happened at the getBAPIConstant(Class<?> cls, String key) method of standard object Ex12nManager when the hp object is null trying to call getProperties method. Could you have a look and advise why my ZClass which looks very simple was not detected in Ex12nManager. Any response would be highly appreciated. Below is my code and the log file

My code:

public class ZPart extends Part
{
  public String ZRecipient = "";
   
  public ZPart() {}
  
  public ZPart(User user) throws Exception  {	 
          this._user = user;
	  this._compManager = ((WorkorderComponentManager)this._user.getComponentManager(COMPONENT_MANAGER_CLASS_NAME));	  
  }
  
  public ZPart(JCO.Table tbl, JCO.Table longTextTbl, Workorder wo)
		    throws Exception {
	  
	  this(wo.getUser());
	  setProperties(tbl, wo);
	  setNotes(longTextTbl);
          setZWEMPF(tbl.getString("WEMPF")); 
	}
 public void setProperties(JCO.Table tbl, Workorder wo) throws Exception{ 
	 super.setProperties(tbl,wo); 	 
 }
 
 public String getZWEMPF() {
	 //Recipient
    return this.ZRecipient;
  }  
  public void setZWEMPF(String ZWEMPF) {
    this.ZRecipient = ZWEMPF;
  } 
}
<br>

73699d#web##na#na#na#na#ERROR Ex12nManager while trying to invoke the method com.syclo.sap.HierarchyProperties.getProperty(java.lang.String, java.lang.String) of a null object loaded from local variable 'hp' |

2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable## at com.syclo.sap.Ex12nManager.getBAPIConstant(Ex12nManager.java:64) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.SAPObject.getFieldName(SAPObject.java:519) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.component.workorder.object.Part.setProperties(Part.java:400) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.component.workorder.object.Workorder.setParts(Workorder.java:692) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.component.workorder.bapi.WorkorderFetchBAPI.setParts(WorkorderFetchBAPI.java:261) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.component.workorder.bapi.WorkorderFetchBAPI.processWorkOrders(WorkorderFetchBAPI.java:183) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous#at com.syclo.sap.component.workorder.bapi.WorkorderFetchBAPI.processResults(WorkorderFetchBAPI.java:147) |
2018 06 11 23:42:51#+00#ERROR#java.lang.Throwable##anonymous# at com.syclo.sap.component.workorder.stephandler.GetWorkOrdersStepHandler.run(GetWorkOrdersStepHandler.java:66) |
2018 06 11 23:42:51#+00#ERROR at com.syclo.sap.component.workorder.steplet.GetWorkOrdersSteplet.execute(GetWorkOrdersSteplet.java:68

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member194451
Active Participant
0 Kudos

Hi,

It looks like there is no value returned. Did you verify the BAPI has values returned?

Regards,

Chung

SAP Product Support