cancel
Showing results for 
Search instead for 
Did you mean: 

Getting com.sap.aii.proxy.framework.core.DataAccessException

Former Member
0 Kudos

Hi All,

I am fetching data from R/3 using WD Java application. All is working fine except for 1 field(Created On) which of type date dd-mmm-yyyy in the backend. Whenever i try to get this field, the application throws an exception com.sap.aii.proxy.framework.core.DataAccessException.

I have tried to search in SDN but could not find any relevant solution. Has anyone faced similar issue before? Any inputs will be helpful.

Thanks.

Rajat

Accepted Solutions (1)

Accepted Solutions (1)

former_member185086
Active Contributor
0 Kudos

Hi

Consider some scenario (first try 3 option )

1.It might it require a date in that format so format it before send/ get by this

String DATE_FORMAT_NOW = "yyyy-MM-dd";
	SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT_NOW);
	System.out.println("Previous Friday from current date:"+ format.format(calendar.getTime()));

2. Check whether it require date of type : import java.util.Calendar; or import java.util.Date;

3. Third and important thing is com.sap.aii.proxy.framework.core.DataAccessException. it means This field are byDefault created by the framework and u r trying to access these thing .

Example : Created On, Create Date, user etc are some default field generated and maintain by the

framework itself(Creation and modification on these field is auto)

Finally do one check : Run your app without using this field.

Best Regards

Satish Kumar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

Thanks for your replies. I resolved it myself. There was change in the field type at the backend. Reimporting the model solved the problem.

Regards.

Rajat

Former Member
0 Kudos

Hi Satish,

On running the app without using this field, my application runs fine.

Using this scenario is not helping out:


String DATE_FORMAT_NOW = "yyyy-MM-dd";
	SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT_NOW);
	System.out.println("Previous Friday from current date:"+ format.format(calendar.getTime()));

Because the application throws the dataaccessexception as soon as i am trying to access the CreatedOn field from the BAPI, i.e., on the line


table.getCreated_On() ;

it gives the exception where table is the object I am using to access the data from the BAPI

If I do not access the CreatedOn field then rest of the data can be accessed using the same BAPI. It gives error only for this field which is of date type. It shows me the following exception:

com.sap.aii.proxy.framework.core.DataAccessException: Type conversion error, field CREATED_ON, complex type class

I could not get your 3rd point.

Regards.

Rajat

Edited by: Rajat Jain on Mar 23, 2009 9:46 AM

pravesh_verma
Active Contributor
0 Kudos

Hi rajat,

Its clearly an issue which is coming during the retrieval of values from the table object. It seems that the datatype of Created_On is different from the datatype in which you are storing its value or setting the value.

Try this fix:

1) Set a debug session and check for the datatype name of the Created_On attribute. You can write this in the watch window:


table.getCreated_On().getClass().getName();

and check the value. If table.getCreated_On() is gicing a exception in debug session as well then switch to the context debugging and check the nsame of the dataType there. I am sure if you drill down in the context debugging you will get the exact datatype.

2) Close the debug session and initialize a new variable with same datatype as that of what you have found in the debug session. Lets say you have found that the datatype is CctDate, which is a complex date type then initialize a variable like this:



CctDate date = null;

// and while getting the value use this:

date = table.getCreated_On() ;

// Doing this will ensure that both the datatypes of variable and the Created_On attribute are same

I hope this should fix your issue. If you still ahev some issue please revert back.

Thanks and Regards,

Pravesh

former_member185086
Active Contributor
0 Kudos

Hi

I know that without using that field your application will run without any error, thats why I emphasis on third point .

I put my point in more clear way further you have to clarification with any apab guys who has knowledge about writing rfc or know about it.

whenever we create CAF project some field are default maintaioned by framework these field are

CreatedBy, CreatedOn,ModificationDate,ModifyBy .in the same way It might possible that these same will be maintained by your rfc also (This point need clarification with your abap mates).

These are the field we never control from our end that is if u created on object so at the time of creation

CreatedBy --- Logged in user id .

CretatedOn -- Default sys date

same for ModificationDate and ModifyBy

These field are automatically get created with object (and of course its important from ACL or credentials or object information point of view for future reference ), It might that u are trying to access these field. (cause of the error, these field dont need any thing from your side).

This is the scenario of CAF In same way EJB but here we have to define all object explicitly i.e entries are there in TABLE fields then u will able to work on these field.

Hope thing will clear now

Best Regards

Satish Kumar