Hello Experts &
Marçal Oliveras
I have similar problem which Marcal posted
http://scn.sap.com/thread/3597335
Please let me know if anything wrong i am doing in java code.
I have added work center field in EditTransaction which was not in screenset but its there in object and transaction property , i have extended two java classes.
1. NotificationEdit
2. NotificationPostBAPI
But work center does not seems to be populated in my SAP BAPI
public class ZNotificationEdit extends NotificationEditBAPI{
public ZNotificationEdit(User u, SAPObject obj) throws Exception {
super(u, obj);
}
@Override
protected void setHeaderParameters(Logger log) throws Exception {
JCO.Structure header = _imports.getStructure("IS_NOTIF_HEADER");
JCO.Structure xStruct = _imports.getStructure("IS_NOTIF_HEADER_X");
setEditValue(header, xStruct, log, "PM_WKCTR", _notification.getWorkCenter());
//PM_WKCTR
}
@Override
public ArrayList<SAPObject> processResults() throws Exception {
return super.processResults();
}
}
public class ZnotificationPostBAPI extends NotificationPostBAPI{
public ZnotificationPostBAPI(User u) throws Exception {
super(u);
}
@Override
protected void setHeaderParameters(Logger log) throws Exception{
if (_bapiType.equals("CREATE")) {
if (_notification.getIsLocal()) {
JCO.Structure header = _imports.getStructure("IS_NOTIF_HEADER");
setValue(header, log, "PM_WKCTR", _notification.getWorkCenter());
}
}
else if (_bapiType.equals("UPDATE")) {
JCO.Structure header = _imports.getStructure("IS_NOTIF_HEADER");
JCO.Structure xStruct = _imports.getStructure("IS_NOTIF_HEADER_X");
setEditValue(header, xStruct, log, "PM_WKCTR", _notification.getWorkCenter());
}
}
}
Regards
Manish