Hi All,
I found a solution for the problem. However, I'm not sure if CA support agrees with this solution.
Anyways, here it is.
I create a new timesheet for the same timeperiod and same resource, by inserting new row in the database and put the value of the PRADJUSTEDID = previous posted timesheetid. Then, I use the prj_timeperiods_write.xml to xog time-entries for the newly created timesheet.
Below is the stored procedure to create an adjusted timesheet ID. It takes the posted timesheet ID as parameter.
CREATE OR REPLACE PROCEDURE Z_CREATE_TIMESHEET_ADJUSTMENT (timesheetID IN NUMBER)
AS
temp NUMBER;
periodID NUMBER;
resourceID NUMBER;
status NUMBER;
BEGIN
SELECT PRTIMEPERIODID, PRRESOURCEID, PRSTATUS INTO periodID, resourceID, status
FROM PRTIMESHEET
WHERE PRID = timesheetID;
IF (status = 4) THEN
SELECT PRTIMESHEET_S1.NEXTVAL INTO temp FROM DUAL;
INSERT INTO PRTIMESHEET(PRUID, PRID, PRTIMEPERIODID, PRRESOURCEID, PRSTATUS, PRVERSION, PRISADJUSTMENT, PRADJUSTEDID, PRMODBY, PRMODTIME)
VALUES ('PRTIMESHEETUID'||temp, temp, periodID, resourceID, 0, 1, 1, timesheetID, 1, SYSDATE);
COMMIT;
END IF;
END;
Regards,
Leo.