Package BodyCOMMENTS:
The package body should be formatted as below with revisions and comments:
BODY_VERSION:
The body version should match the body date and version number and be updated for any code changes to be released. The Body Version will appear in the about section in the AIW spreadsheet.
PROCEDURE VERSION:
The procedure version is required for the about section in the AIW spreadsheet.
PROCEDURE UPLOAD:
This is the main procedure that will be called by the loader.
Sample header/parent error and success code has been provided.
Sample line/child error and success code has been provided.
CHILD LOOP:
Sample code for looping and processing child rows has been provided.
EXCEPTION HANDLER:
Package body should always include an exception handler. A sample WHEN OTHERS exception handler has been provided.
create or replace
PACKAGE BODY M4APS_AIW_XYZ AS
/******************************************************************************
NAME: M4APS_AIW_XYZ
PURPOSE: Put the purpose here
REVISIONS:
Ver Date Author Description
----- ----------- --------------- ------------------------------------
1.0.0 31 Aug 2017 S Smith Created
******************************************************************************/
body_version varchar2 (20) := '1.0.2 07-Feb-18';
PROCEDURE VERSION(
p_header_version OUT VARCHAR2,
p_body_version OUT VARCHAR2 )
IS
BEGIN
p_header_version := header_version;
p_body_version := body_version;
END VERSION;
PROCEDURE UPLOAD (
p_project_id in number,
p_asset_lines in out asset_lines_tbl_type,
x_return_status out varchar2,
x_err_msg out varchar2
) AS
BEGIN
--SUCCESS
x_return_status := fnd_api.g_ret_sts_success ;
--ERROR
x_return_status := fnd_api.g_ret_sts_error ;
x_err_msg := 'This project must be set up to use Client Extension in the Asset Cost Allocation Method';
for i in 1..p_asset_lines.count loop
--SUCCESS
p_asset_lines(i).x_return_status := fnd_api.g_ret_sts_success;
--ERROR
p_asset_lines(i).x_return_status := fnd_api.g_ret_sts_error;
p_asset_lines(i).x_err_msg := p_asset_lines(i).percentage || ' percent of ' || l_current_asset_cost || ' should be ' ||
end loop;
exception
when others then
x_err_msg := 'Unknown error in M4APS_AIW_PA_UNASSIGNED_ASSET.upload - '|| dbms_utility.format_error_backtrace;
dbms_output.put_line(x_err_msg);
dbms_output.put_line(dbms_utility.format_error_stack);
dbms_output.put_line(dbms_utility.format_error_backtrace);
x_return_status := FND_API.G_RET_STS_ERROR;
END UPLOAD;
END M4APS_AIW_XYZ;
Refer to section:
|