on 01-04-2018 4:29 PM - last edited on 02-04-2024 12:20 AM by postmig_api_4
Hello i'm using the following code snippet. The goal is to update the user lastname firstname and co using the BAPI_PERSDATA_CHANGE bapi. But somehow it's not working, I tried a lot of possibilities but it's not working. The message to the function related to BAPI_PERSDATA_CHANGE is:
No data stored for 0002 in the selected period
public boolean writeData(long id, HashMap<String, String> userData) throws Exception{
String DST1 = "ABAP_AS";
JCoDestination dest = JCoDestinationManager.getDestination(DST1);
JCoFunctionTemplate template = dest.getRepository().getFunctionTemplate("BAPI_PERSDATA_CHANGE");
JCoFunction jcoFunction = template.getFunction();
jcoFunction.getImportParameterList().setValue("EMPLOYEENUMBER", id);
//jcoFunction.getImportParameterList().setValue("SUBTYPE", "002");
//jcoFunction.getImportParameterList().setValue("OBJECTID", "");
//jcoFunction.getImportParameterList().setValue("LOCKINDICATOR", "");
jcoFunction.getImportParameterList().setValue("VALIDITYBEGIN", "19570101"); //"1994-04-24");
jcoFunction.getImportParameterList().setValue("VALIDITYEND", "99991231");
jcoFunction.getImportParameterList().setValue("RECORDNUMBER", "000");
jcoFunction.getImportParameterList().setValue("FIRSTNAME", "FOfie modifier");
JCoFunction jCoFunction1 = dest.getRepository().getFunctionTemplate("BAPI_TRANSACTION_COMMIT").getFunction();
JCoFunction BAPI_EMPLOYEE_DEQUEUE = dest.getRepository().getFunction("BAPI_EMPLOYEE_DEQUEUE");
BAPI_EMPLOYEE_DEQUEUE.getImportParameterList().setValue("NUMBER", id);
jcoFunction.execute(dest);
jCoFunction1.execute(dest);
BAPI_EMPLOYEE_DEQUEUE.execute(dest);
JCoContext.end(dest);
return false;
}
Am i missing something ? Thanks for helping.
You could first call BAPI_PERSDATA_GETDETAILEDLIST and/or BAPI_PERSDATA_GETDETAIL to get actual current values, then depending on required changes, call BAPI_PERSDATA_CHANGE and/or other BAPI like DELIMIT or CREATE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Delly. Could you refer the link below? It seems that It's the same issue. You could try to use the same solution. thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.