cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible approve timesheets in S/4HANA Cloud using an API?

kvirkkunen
Discoverer
0 Kudos

Hi!

Normally timesheets are approved through the app My Inbox.

Is it possible to approve timesheets in another way, for example with an API? We want to be able to approve times from a side-by-side App.

The Workforce Timesheet API: https://api.sap.com/api/API_MANAGE_WORKFORCE_TIMESHEET/overview works for creating new timesheets, but if the approval workflow is defined using BADI, there seems to be no way to create or change a timesheet so it has the TimeSheetStatus 30 (Approved).

Through the My Inbox app the approval process is using the service HCM_CATS_MYINBOXAPPROVAL, but this is not exposed to the outside and cannot be called.

Is it possible to make these APIs usable somehow, or maybe there is some other way to do this?

Kind regards,

/ Kristofer

JulianoRomanato
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello kvirkkunen.

How are you? I have excluded the Tag "SAP S/4HANA Cloud" and included the Tag "SAP S/4HANA Cloud for Human Resources" for this question, as Timesheets are Objects related to Human Resources Line of Business.

Regards.

Juliano Romanato.

Marissa
Advisor
Advisor
0 Kudos

Hi,

We helped you to accept the answer, since there were no updates after 7 days.

You can unaccept it anytime if the answer provided was not helpful enough and you have further questions.

Best regards,

Marissa

Accepted Solutions (1)

Accepted Solutions (1)

Giulio_Grandine
Advisor
Advisor

If you are on a 3 SL landscape and have a Dev system with an ABAP workbench you can try to develop your own API using the same object that is used to approve a timesheet in your Inbox. This link will get help you get started.

Public API Service - Dev Environment and Deployment - Orca Development Project WIki - Wiki@SAP (int....

kvirkkunen
Discoverer
0 Kudos

Hi Guilio!

We don't have the ABAP workbench in this scenario, but thanks for the tip!

Kind regards,
Kristofer

Answers (1)

Answers (1)

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos
kvirkkunen
Discoverer
0 Kudos

Hi Owen!

Unfortunately when you have set up a workflow which requires some timesheets to be approved by the manager (for particular overtime categories for example), these timesheets cannot be approved with this API. You can push them into the workflow using the ReleasedOnSave = True field, but any timesheet that is put into status TimeSheetStatus 20 (Sent for approval) this way can't be out into TimeSheetStatus 30 (Approved).

This is the problem we are facing.

Kind regards
Kristofer