cancel
Showing results for 
Search instead for 
Did you mean: 

JCo : table contains default value in jcoFunction

Former Member
0 Kudos

Hi Experts,

I an getting some problem while setting values into JCO function after executing a this line...  destination.execute(function) .

Even if I am passing a ("")Blank String value to set into a date field in table parameter, JCo function contains a value like this "0000-00-00".

I dont when and how it's setting this value.

when I am passing a value in the format (yyyyMMdd ) it coverts to the format (yyyy-MM-dd)

It's fine when value is there, But I need a blank value from that field when I am passing a blank String ("").

Please help me.

Thanks

Gouri Shankar

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gouri,

What you want is not possible. In a DATE field, you cannot put an empty string. It's a DATE field and will always contain either a valid date or the value indicating an initial value: 00000000 or when accessing the value again with getString() in ISO format 0000-00-00. When setting an ampty string, via setValue(), this will always be interpreted as default value of the current type.

If you like to have a "" in a certain field, you need to have a CHAR type field.

Best regards,

Markus

Former Member
0 Kudos

Hi Markus

Thanks for your time and answer.

My problem is that ..

Depending upon certain parameters , one field can be Mandatory/ Optional in ECC.

case-1:  if it is optional ,then no issue.

case 2:  if it is mandatory and I am sending value , no issue.

case 3:  If it is a mandatory value for ECC and I am sending a blank ,it is taking a default value.

case-1 and case -2 are fine,

BUt for case-3 :

I want ECC to through Exception if such value will be inserted.(0000-00-00) as it is a mandatory value for ECC.

Is it possible? If not is there any alternative for that?

Thanks

Gouri Shankar

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gouri,

within a table, there is no notion of optional, this is only existing for a parameter itself. Hence, If I understood correctly what you like to achieve, I need to disappoint you and tell you that this is not possible. Only with a hacky flag table, which is telling which fields have been set, but as this is not really directly coupled, it's only working if values are set in a disciplined manner.

Best regards,

Markus