on 06-16-2004 10:07 AM
Hello, I have a problem, which i have no idea what happened. It seems like a JCo problem, but i'm not really sure. Trying a simple code, getting a connection and the following code excerpt before disconnecting.
[code]
Function create_emp = <ClassFunction>.createFunction("BAPI_INTCONTROL_CREATE", <Repository>);
if(create_emp!=null){
ParameterList pl = create_emp.getImportParameterList();
System.out.println("pl is: "+pl);
pl.setValue("10000001","EMPLOYEENUMBER");
pl.setValue(Date.valueOf("2000-01-01"),"VALIDITYBEGIN");
pl.setValue(Date.valueOf("2040-12-31"),"VALIDITYEND");
pl.setValue("licenceno20charaters","LICENSEPLATENO");
pl.setValue("123456","BUILDINGNUMBER");
pl.setValue("123456","ROOMNUMBER");
pl.setValue("12345","INHOUSETELNO1");
pl.setValue("12345","INHOUSETELNO2");
pl.setValue("T","NOCOMMIT");
create_emp.setTableParameterList(pl);
<Client>.execute(create_emp);
<Client>.execute(<ClassFunction>.createFunction("BAPI_TRANSACTION_COMMIT", <Repository>));
} else{
System.out.println("Function failed.");
}
[/code]
The following was obtained when run:
[code]
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x18279CC9
Function=Java_com_sap_mw_jco_rfc_MiddlewareRFC_00024Server_nativeListen+0x57BB
Library=C:\jco\sapjcorfc.dll
Current Java thread:
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1112)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3510)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3065)
at CreateEmpTest.main(CreateEmpTest.java:31)
...
[/code]
there is also a list of dll files, which i will ommit, unless it is necessary that i post it.
Message was edited by: Eugene Phang
Hi,
this is either a bug in your dll files (please check versions) or something wrong in your request (which I doubt, as there should be at least an acceptable error returned.)
Regards,
Benny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you benny.
the problem is, i have limited experience with SAP, and i have sent requests that do nothing (it seems) but do not return errors.
i have tried updating tables using BAPIs, which the java code runs and disconnects in the end with no problem, but calling the table up sees no added entry.
i'll check the dlls and see..
yes. i'm calling a BAPI function, setting the needed import parameters, and then executing it.
after that i call BAPI_TRANSACTION_COMMIT. i figure that B_T_COMMIT will commit executed stuff. not sure if that's right. but it still doesn't work.
i'm currently testing it out by trying to change an employee's maritial status. called ENQUE to lock the account, BAPI_PERSDATA_CHANGE, set some values, execute B_P_CHANGE. then i call B_T_COMMIT.
code runs fine.. no errors. but checking the married value from SAP GUI shows not changed. i checked the values and made sure they're right. only thins to wonder is, if there is a need to set the value every single import param, or just the important ones..
Hi,
1. Are you checking the RETURN-values of the bapi calls? You'll get an exception on really severe errors only (communication, system error e.g. short dump in R/3 and some more). The message(s) in the return will tell you, if something and what is missing/wrong with the call.
2. Ensure to set the WAIT parameter in B_T_COMMIT to 'X' or it will always return silently and OK.
3. Another possibility to check the call is testing it in SE37 using the same parameters.
Hope that helps.
Regards
Stefan
1. as in the export params? or tables? (from se37)
2. i've read about this somewhere, but it does nothing whether i set it or not. something is wrong somewhere?
3. how does one test a function from se37? i'll be looking into sap help, but thought i'd place the question forward to save time, so ignore this if it can be found in help. now, i'm only using it as a reference for import and export params..
> 1. as in the export params? or tables? (from se37)
It should be in the TABLES, since you can get more than one return value (Structure is BAPI_RETURN).
> 2. i've read about this somewhere, but it does
> nothing whether i set it or not. something is wrong
> somewhere?
There's definitely a difference, if you set it, since it does a "COMMIT WORK AND WAIT" when set.
> 3. how does one test a function from se37? i'll be
> looking into sap help, but thought i'd place the
> question forward to save time, so ignore this if it
> can be found in help. now, i'm only using it as a
> reference for import and export params..
Specify the name of the BAPI in SE37 and press F8.
Regards
Stefan
thx stefan,
i got the error message out. turns out that RETURN is actually in Export param structure BAPIRETURN. and must explicit call the MESSAGE value.
the problem is related to validity date. i've been "forced" to hardcode the validity date (begin and end) to get values from BAPI__GET... now, the same values to not fork for BAPI_*_CHANGE. anyway i can get this validity date? what exactly is it?
thx again
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.