cancel
Showing results for 
Search instead for 
Did you mean: 

Data type for duration

Former Member
0 Kudos

Hello everyone,

Is there any data type we can use to denote duration?

The scenario is that a user will need to enter hours and minutes and we should be able to use this information in reports.

thanks

Mahesh

Accepted Solutions (0)

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Mahesh,

Did you take a look the Reuse Library Duration?

HTH,

   Horst

Former Member
0 Kudos

Hi Horst,

Thanks for responding.

I want to have a field in the UI for the user to enter hours and minutes.

Eg: 2 hours 20 minutes

I am wondering is there is a data type which takes these values and can be used in reports.

If we go by work around, we can have two fields - one text field for the user, and then a second field hidden which is populated by parsing the first one and which is used in the reports.

thanks

Mahesh

Former Member
0 Kudos

Hi Mahesh.

How about the Data type "Duration"?

Former Member
0 Kudos

Hi Ludger,

This wont let us activate the XBO. I guess it is fine to use in custom BOs but not in extended standard BOs.

I get an error that it is not supported.

thanks

Mahesh

Former Member
0 Kudos

Indeed, this is not available for XBOs - there was nothing said that this is about XBOs.

According to the studio Library, in XBOs only the following elements are allowed, pick the one that comes closest to your use case:


  • Amount
  • Date
  • DecimalValue
  • CodeList – SAP code lists
  • ID
  • Identifier – SAP identifiers
  • Indicator
  • Quantity
  • Time
  • LANGUAGEINDEPENDENT_EXTENDED_Text
  • WebURI
  • EmailURI

By importing additional namespaces, you can access additional SAP CodeLists and Identifiers.

You can also use CodeLists that you have defined within your solution.

Sorry, no Duration in XBOs

Former Member
0 Kudos

Yes, for now I am using multiple fields. for users, forms and then in reports.

Just wanted to see if any of developers came across this kind of scenario.

thanks

Mahesh

Former Member
0 Kudos

Hi Manesh,

In our scenario we needed a duration in months. For this I used a quantity field with unit months. This unit could be made available through customizing.

Perhaps your solution might be to use two quantity fields, one with unit hours and one with minutes.

Regards,

Olaf

Former Member
0 Kudos

Hi Olaf,

thanks for responding.

Could you please explain how you achieved the "day" unit?

I know we have a data type "quantity", but it will give you an option to select a type (day, hour, kilograms, litres etc) from a drop down.

Is there a way we can restrict the value to just "days"?

Also, we have to use this in PDI/SDK to drive some logic off of these fields in a standard BO and standard TI.

thanks

Mahesh

Former Member
0 Kudos

Hello Mahesh,

If you are using an Embedded Component to add the field to the standard screen then you can set the Initial Value for the Unit field as Day in Embedded Component.

Also you can write a code in Aftermodify to always set that  field value to Day even if user changes that in UI.

Please let me know if that helps.

Thanks & Regards,

Meghna Sharma

Former Member
0 Kudos

No, we are not using EC to add the custom field. because we need this app to work on iPad as well. And on iPad custom ECs do not show up on standard screens.