on 12-15-2009 6:43 AM
Hi All,
i was trying to run multiple BAPI's using Jco. but no luck. it giving error message like "Employee/person not locked yet".
the BAPI's i'm trying are
1. BAPI_EMPLOYEET_ENQUEUE
2. BAPI_ABSENCE_REQUEST
3. BAPI_TRANSACTION_COMMIT
4. BAPI_EMPLOYEET_DEQUEUE
i'm using connection pooling to get connection.
the code
JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
JCoFunction function = destination.getRepository().getFunction("BAPI_EMPLOYEET_ENQUEUE");
function.getImportParameterList().setValue("NUMBER", "00000002");
function.execute(destination);
function = destination.getRepository().getFunction("BAPI_ABSENCE_REQUEST");
function.getImportParameterList().setValue("EMPLOYEENUMBER", "00000002");
function.getImportParameterList().setValue("VALIDITYBEGIN", c.getTime());
function.getImportParameterList().setValue("VALIDITYEND", c1.getTime());
function.getImportParameterList().setValue("ABSENCETYPE", "0014");
function = destination.getRepository().getFunction("BAPI_TRANSACTION_COMMIT");
function.execute(destination);
function = destination.getRepository().getFunction("BAPI_EMPLOYEET_DEQUEUE");
function.getImportParameterList().setValue("NUMBER", "00000002");
function.execute(destination);
i don't know where i'm going wrong. Plx help me out.
thanks in Advance.
Ravi.
Hi.
I found the correct form to use.
BAPI_EMPLOYEE_ENQUEUE
BAPI_PERSDATA_CHANGE
BAPI_EMPLOYEE_DEQUEUE
In a java file need use JCoContext to generate a group functions to will be execute
try {
JCoContext.begin(destination);
if (JCoContext.isStateful(destination))
bloqFunction.execute(destination);
cambFunction.execute(destination);
desbFunction.execute(destination);
} finally {
JCoContext.end(destination);
}
Declarated:
JCoFunction bloqFunction = destination.getRepository().getFunction(
"BAPI_EMPLOYEE_ENQUEUE");
JCoFunction cambFunction = destination.getRepository().getFunction(
"BAPI_PERSDATA_CHANGE");
JCoFunction desbFunction = destination.getRepository().getFunction(
"BAPI_EMPLOYEE_DEQUEUE");
I hope help with this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sir,
Correcting the forum to the Java WD one.
Regards,
Bentow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.