Share this page

# rejectTimeSheetLine

## Purpose

Reject an existing time sheet line object in PPM Center.

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 updates the status of a time sheet line to be "rejected."

Before this operation, the status of the line must be "submitted" or "approved."

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

- Have the Time Mgmt: Edit Time Sheets access grant.

- Be one of the following:

  - The time sheet line approver.

  - The delegate of the time sheet line approver.

An additional field this operation updates is the Actual Approver, which is set to null.

## Input

A long value of the time sheet line ID.

An object of whole TimeSheetBean where this line exists.

## Return

An object of TimeSheetBean, with all the fields completed.

## Java Interface

`RejectTimeSheetLineResponseDocument rejectTimeSheetLine(RejectTimeSheetLineDocument in)`

Parameters | Description
--- | ---
RejectTimeSheetLineDocument | Wrapper for TimeSheetBean and a long value for a time sheet line ID. See the following example for the construction.
RejectTimeSheetLineResponseDocument | Wrapper for TimeSheetBean. See the following example on how to retrieve the bean.

## Java Examples

Example: reject an existing time sheet line

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

                TimeServiceStub stub = new TimeServiceStub(ctx,
    WSURL);
                RejectTimeSheetDocument rejectTimeSheetDocument =
    RejectTimeSheetDocument.Factory.newInstance();
                TimeSheetBean rejectTimeSheetBean =
    rejectTimeSheetDocument.addNewRejectTimeSheet().addNewTimeSheet
    Bean();

    rejectTimeSheetBean.setTimeSheetId(createdTimeSheetBean.getTime
    SheetId());

    rejectTimeSheetBean.setResourceId(createdTimeSheetBean.getResou
    rceId());

    rejectTimeSheetBean.setPeriodId(createdTimeSheetBean.getPeriodI
    d());
               TimeSheetStatus timeSheetStatus =
    rejectTimeSheetBean.addNewState();
              timeSheetStatus.setCode(new BigInteger("2"));
              timeSheetStatus.setMeaning("pending-approval");
              TimeSheetLineBean timeSheetLineBean =
    rejectTimeSheetBean.addNewTimeSheetLines();

    timeSheetLineBean.setTimeSheetLineId(createdTimeSheetBean.getTi
    meSheetLinesArray(0).getTimeSheetLineId());

    timeSheetLineBean.setWorkItemId(createdTimeSheetBean.getTimeShe
    etLinesArray(0).getWorkItemId());

    timeSheetLineBean.setWorkItemSetId(createdTimeSheetBean.getTime
    SheetLinesArray(0).getWorkItemSetId());

    timeSheetLineBean.setWorkItemType(createdTimeSheetBean.getTimeS
    heetLinesArray(0).getWorkItemType());
             TimeActualsBean timeActualsBean1 =
    timeSheetLineBean.addNewTimeActualsList();
             timeActualsBean1.setTotalsFlag(true);
             timeActualsBean1.setEffortsListArray(new double[]
    {1,2,3,4,5,0,0,1,2,3,4,5,0,0,10});

             TimeActualsBean timeActualsBean2 =
    timeSheetLineBean.addNewTimeActualsList();
             timeActualsBean2.setTotalsFlag(false);
             timeActualsBean2.setEffortsListArray(new double[]
    {1,2,3,4,5,0,0,1,2,3,4,5,0,0,10});

             RejectTimeSheetResponseDocument response =
    stub.rejectTimeSheet(rejectTimeSheetDocument);
             TimeSheetBean returnTimeSheet =
    response.getRejectTimeSheetResponse().getReturn();

             System.out.println("Time Sheet was rejected " +
    returnTimeSheet.getTimeSheetId());
            }
            catch(Exception e) {
                e.printStackTrace();
            }
            System.out.println("testRejectTimeSheetLine
    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.cannotRejectTimesheetLine | User cannot reject Timesheet Line | You may not have the required access grant or Time Management License. | Check the user licenses and privileges (access grants).
ex.cannotRejectTimesheetLineMore | User may not have access to reject the line or timesheet line does exist. | You may not have the required access grant or Time Management License.Or, the time sheet line does not exist. | Check the user licenses and privileges (access grants). Or, Check the validity of the time sheet ID and line ID.
ex.timesheetLineCannotbeRejected | Timesheet line is not in submitted or approved state, it cannot be rejected | You try to reject a time sheet line that is neither submitted nor approved. | Check the state of the time sheet line that you are trying to reject.
ex.timesheetLineNotExist | Timesheet line does not exist in this timesheet | Time sheet ID or line ID is invalid, or database might be corrupt. | Check the validity of the time sheet ID and line ID.
ex.timesheetLineNullCannotbeRejected | Timesheet line or timesheet is null, cannot be rejected | Time sheet ID or line ID is invalid, or database might be corrupt. | Check the validity of the time sheet ID and line ID.
ex.tsIncorrectRejectStatus | This timesheet can not be rejected as timesheet status is {0} | Time sheet status is incorrect to reject. | Perform the getTimeSheet operation to check the time sheet status, and then perform other appropriate operations.
ex.tsIncorrectRejectByApprover | There is no line item available to be rejected by this approver | All line items are approved or rejected. | Perform the getTimeSheet operation to check the time sheet status, and then perform other appropriate operations.

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: