on 02-10-2015 11:34 AM
Hello Experts &
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
Hi Manish,
Have you added the work center field in the add transaction too?
Before trying the Edit, I think you should try with the create (adding the field in the creation screen and transaction if they are not there). The way you extended NotificationPostBAPI looks fine, if the configuration portal changes are correctly implemented it should work.
You should debug if the _notification attribute has the work center informed when your overriden setHeaderParameters is called.
Regarding the edit, I think you must extend NotificationPostUpdateBAPI instead of NotificationEditBAPI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my project (Work Manager 6.1), the LAM is not used but the configuration portal is still pointing to the LAM java classes, so I created the extensions from lam classes. I'm not sure if this is due to a wrong backend installation, a wrong BC Set activation or it is just the standard way for WM 6.1.
Anyway, that is not really relevant. You just have to go to your configuration portal and see which class is being used in order to extend it and then replace it.
You say that com.syclo.sap.component.notification.bapi.NotificationPostUpdateBAPI does not have set header parameters, but this is not true. This class is inheriting from NotificationPostBAPi which has the method, but NotificationPostUpdateBAPI doesn't override it. That doesn't prevent you to override it in your extended class...
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.