cancel
Showing results for 
Search instead for 
Did you mean: 

POSTing valid datetime value causes complicated error

Former Member
0 Kudos

Hi, I have a webservice where i have an entity with property like below:

the abap field data element is GBDAT of data type DATS.

When i send the date using the following function:


getODataDateFromDatePicker: function(datePickerInstance) {

  var yyyymmdd = datePickerInstance.getProperty('yyyymmdd');

  var splitDateArray = yyyymmdd.match(/(\d{4})(\d{2})(\d{2})/);

  var yyyySlashMMSlashDD = splitDateArray[1] + '/' + splitDateArray[2] + '/' + splitDateArray[3];

  var jsDateObject = new Date(yyyySlashMMSlashDD);

  return jsDateObject;

  },

OR

if i just send it like yyyy-mm-ddT00:00:00 for ex: Born: "1990-12-05T00:00:00" the result is the same error as shown bellow:

Call of the method CONV_DATE_EXT_TO_INT of the class CL_ABAP_DATFM failed; wrong type for parameter IM_DATEXT


I also tried sending null, but got the same error even thought i checked Nullable in gateway.

Plz help...been at this for 2 weeks straight now.

Accepted Solutions (0)

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello German,

Do not maintain any precision and Scale. Keep it Zero.

Using ABAP Editor, use ABAP-Type as 'DATS'

Re-Generate Run-Time Objects.

Clear Model Cache using /iwfnd/cache_cleanup

Refer below ->

Regards,

Ashwin

Former Member
0 Kudos

Cant set abap type to dats because everything is uneditable:

AshwinDutt
Active Contributor
0 Kudos

Ok can u try removing only the Precision and Scale and keep it Zero, generate objects, clear the model cache using /iwfnd/cache_cleanup ?

Former Member
0 Kudos

Did that. Same error.