Share this page

# getTimeSheet

## Purpose

Read an existing time sheet object in PPM.

Note: This operation supports the Day in Days option and Period in Days option, which were introduced since PPM Center version 8.00 Service Pack 1. For more information, see the Time Sheet Update Service section in Project and Portfolio Management Center Version 8.00.01 (Service Pack 1) Release Notes.

## Function

This operation reads an existing time sheet object, identified by time sheet ID in PPM.

The user performing this operation must have the permission to view this particular time sheet, meaning that the user must meet the following conditions:

- Have one of the following access grants:

  - Time Mgmt: View Time Sheets

  - Time Mgmt: Edit Time Sheets

- Be one of the following:

  - The resource of the time sheet

  - The delegate of the resource

  - The manager of the resource

## Input

A long value of an ID of an existing time sheet.

## Return

An object of TimeSheetBean, with all fields values completed. The data is returned according to the time sheet policy.

## Java Interface

`GetTimeSheetResponseDocument getTimeSheet(GetTimeSheetDocument in)`

Parameters | Description
--- | ---
GetTimeSheetDocument | Wrapper for a long value which holds the TimeSheetId. See the following example for the construction.
GetTimeSheetResponseDocument | Wrapper for TimeSheetBean. See the following example for retrieving the bean and its fields.

## Java Examples

Example: read an existing time sheet.

    TimeSheetBean createdTimeSheetBean = null;
        public void testGetTimeSheet() {
            System.out.println("testGetTimeSheet started ...");
            try {
                if(createdTimeSheetBean == null)
                      testCreateTimeSheet();

                TimeServiceStub stub = new TimeServiceStub(ctx,
    WSURL);
                GetTimeSheetDocument getTimeSheetDocument =
    GetTimeSheetDocument.Factory.newInstance();

    getTimeSheetDocument.addNewGetTimeSheet().setTimeSheetId(create
    dTimeSheetBean.getTimeSheetId());

                GetTimeSheetResponseDocument response =
    stub.getTimeSheet(getTimeSheetDocument);
                final TimeSheetBean returnTimeSheetBean =
    response.getGetTimeSheetResponse().getReturn();

                System.out.println("Time Sheet was found " +
    returnTimeSheetBean.getTimeSheetId());

            }
            catch(Exception e) {
                e.printStackTrace();
            }
            System.out.println("testGetTimeSheet completed");
        }

## Errors and Exceptions

When an error occurs on this operation, you will receive a description of the root cause in the log or in the response message.

The server log file content is similar to the following:

    Exception in thread "main" org.apache.axis2.AxisFault: [root cause description]

Response message:

    <exception:exceptionDetails xmlns:exception="http://
    www.mercury.com/ppm/ws/exception">
    <exception:detail>[root cause description] </exception:detail>
    </exception:exceptionDetails>

Possible root cause descriptions:

Message Code | Message | Cause(s) | Possible Corrective Action
--- | --- | --- | ---
ex.timesheetNotExist | Timesheet does not exist | Time sheet ID is invalid. | Check the validity of the time sheet ID.
ex.cannotEditTimesheet | User cannot edit Timesheet | You may not have the required access grant or Time Management License. | Check the user licenses and privileges (access grants).

https://admhelp.microfocus.com PPM 8942
Tips to improve your search results... OpenText™ Project and Portfolio Management Help Center PPM Help 26.2-26.3 All View Local Help Center View Online Help Center Version: