cancel
Showing results for 
Search instead for 
Did you mean: 

TIME_Duration

abelousov
Active Participant
0 Kudos
439

Hi,

In ABSL I need to assign a value to a variable of TIME_Duration type (from Standard BO).

I found no functions like "ParseFromString" converting a string into the value of such type (Duration type does not fit).

Is there some workaround for that type?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

abelousov
Active Participant
0 Kudos

Thank you, Horst,

Eventually, I fingered out we can just assign a plain string to a variable of the type, for example, we can act in such a manner:

var x : TIME_Duration;
x = "PT0H5M0S";

The warning message which appears on this code ("..can not be assigned..") can be ignored. It will be work properly anyway.

Thank you.

Best regards,

Aleksei

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Aleksei,

From the Repository Explorer I got this definition

TIME_Duration is a restriction of Duration where only values for hours, 
minutes, seconds and fractions of seconds are allowed.
The representation is as follows:
PTnHnMnS
Example:
PT4H12M40S

There is no library function for this special case of a Duration. 😞

So if you have the hours, minutes, and seconds you need to build up the TIME_Duration by yourself.

Sorry,
. Horst