Post to WIP generates System Error

Document ID : KB000097545
Last Modified Date : 22/05/2018
Show Technical Document Details
Issue:
When I navigate to Home > Financial Management > Post to WIP page, enter a date range then click on 'Apply' > 'Post' button
I get 'System Error. Contact system administrator' no output is generated in log file. 

When I run a Post To Wip job then the following error gets generated in the bg-ca.log file.

ERROR 2018-05-22 13:01:26,914 [Dispatch Post to WIP : bg@demunapp1470.ondemand.ca.com (tenant=clarity)] niku.njs (clarity:abc.dav@ca.com:23250649__9590FC00-4FAC-4B3C-A3BF-24BD0A725488:Post to WIP) Error executing job: 5077036
com.niku.union.persistence.PersistenceException: 
SQL error code: 21000
Error message: [CA Clarity][Oracle JDBC Driver][Oracle]ORA-21000: error number argument to raise_application_error of -1 is out of range
ORA-06512: at "MUN1436P.PAC_PRC_POSTTOWIPS_SP", line 961
ORA-06512: at "MUN1436P.PAC_PRC_POSTTOWIP_JOB_SP", line 201
ORA-06512: at "MUN1436P.PAC_PRC_POSTTOWIP_JOB_SP", line 201
ORA-06512: at line 1
Cause:
The stored procedure 'PAC_PRC_POSTTOWIPS_SP' is erroring when attempting to insert data into PPA_WIP_VALUES table.
This is because the table sequence for PPA_WIP_VALUES is out of order
Resolution:
Check the NEXTVAL Sequence by executing the following Sql query;

SELECT MAX(ID)from PPA_WIP_VALUES

SELECT PPA_WIP_VALUES_S1.NEXTVAL from dual 

If the MAX(ID) is greater than the result from PPA_WIP_VALUES_S1.NEXTVAL then execute 
these two Sql statement below.

Note: the Increment by value is dependent on the variance between MAX(ID) and result of PPA_WIP_VALUES_S1.NEXTVAL.
If for example output for MAX(ID) is: 60726 and output for PPA_WIP_VALUES_S1.NEXTVAL is: 60226 then you would want
to use an increment value if say 1000. 
Here is the Sql query you execute:

alter PPA_WIP_VALUES_S1 increment by 1000; 

then commit the change. This will set PPA_WIP_VALUES_S1.NEXTVAL value to 61226.
Now if going forward we want to maintain an increment value of 1 then we need to execute this Sql statement 

alter PPA_WIP_VALUES_S1 increment by 1;
then commit;

With the table sequence corrected the Post To Wip will now work as expected.