0% found this document useful (0 votes)
83 views1 page

SQL Queries

The document contains steps to update cost distribution line records where the transfer status is 'X' and the associated expenditure item has been adjusted. This involves: 1. Updating original expenditure items and their cost distribution lines. 2. Committing the transaction. 3. Running a process to generate cost accounting events and verifying the results. 4. Repeating steps for the reversal expenditure items and cost distribution lines. 5. Committing and verifying another process run. 6. Performing a final cleanup of any remaining records marked for transfer.

Uploaded by

vbkanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views1 page

SQL Queries

The document contains steps to update cost distribution line records where the transfer status is 'X' and the associated expenditure item has been adjusted. This involves: 1. Updating original expenditure items and their cost distribution lines. 2. Committing the transaction. 3. Running a process to generate cost accounting events and verifying the results. 4. Repeating steps for the reversal expenditure items and cost distribution lines. 5. Committing and verifying another process run. 6. Performing a final cleanup of any remaining records marked for transfer.

Uploaded by

vbkanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

create table PA_COST_DIST_LINES_ALL_bk

as
select * from PA_COST_DISTRIBUTION_LINES_ALL
WHERE TRANSFER_STATUS_CODE = 'X';

1. Update Original EI

UPDATE PA_COST_DISTRIBUTION_LINES_ALL
SET TRANSFER_STATUS_CODE = 'P',
created_by = '-25307865'
WHERE TRANSFER_STATUS_CODE = 'X'
AND EXPENDITURE_ITEM_ID IN
(SELECT ADJUSTED_EXPENDITURE_ITEM_ID
FROM PA_EXPENDITURE_ITEMS_ALL
WHERE EXPENDITURE_ITEM_ID < ADJUSTED_EXPENDITURE_ITEM_ID
AND NET_ZERO_ADJUSTMENT_FLAG = 'Y'
AND ADJUSTED_EXPENDITURE_ITEM_ID IS NOT NULL);

2. COMMIT;

--Inform me.. so I will run 3rd point.

3. Run the PRC: Generate Cost Accounting Events and verify.

--I will let you to you once the 3rd Point is completed.

4. Update Reversal EI

UPDATE PA_COST_DISTRIBUTION_LINES_ALL
SET TRANSFER_STATUS_CODE = 'P',
created_by = '-25307865'
WHERE TRANSFER_STATUS_CODE = 'X'
AND EXPENDITURE_ITEM_ID IN
(SELECT EXPENDITURE_ITEM_ID
FROM PA_EXPENDITURE_ITEMS_ALL
WHERE EXPENDITURE_ITEM_ID < ADJUSTED_EXPENDITURE_ITEM_ID
AND NET_ZERO_ADJUSTMENT_FLAG = 'Y'
AND ADJUSTED_EXPENDITURE_ITEM_ID IS NOT NULL);

5. COMMIT;

--Inform me.. so I will run 6th point.

6. Run the PRC: Generate Cost Accounting Events and verify the result

--I will let you to you once the 6th Point is completed.

7. Run the following update as a final cleanup of any items flagged as 'X' created
while the original and adjusted item had corruption:

UPDATE PA_COST_DISTRIBUTION_LINES_ALL cdl1


SET TRANSFER_STATUS_CODE = 'P'
WHERE TRANSFER_STATUS_CODE = 'X';

8. COMMIT;

-- DBA job done.

You might also like