Social Icons

Thursday, July 25, 2013

FA DELETION API SCRIPT

/* Formatted on 2013/05/14 13:47 (Formatter Plus v4.8.8) */
DECLARE
l_asset_hdr_rec fa_api_types.asset_hdr_rec_type;
l_return_status VARCHAR2 (1);
l_mesg_count NUMBER := 0;
l_mesg_len NUMBER;
l_mesg VARCHAR2 (4000);
CURSOR cur_fa_addition
IS
SELECT asset_id
FROM apps.fa_additions ;
BEGIN
FOR c1 IN cur_fa_addition
LOOP
DBMS_OUTPUT.ENABLE (1000000);
fa_srvr_msg.init_server_message;
-- asset header info
l_asset_hdr_rec.asset_id := c1.asset_id;
l_asset_hdr_rec.book_type_code := 'CORPORATE BOOK';
fa_deletion_pub.do_delete
(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_mesg_count,
x_msg_data => l_mesg,
p_calling_fn => NULL,
px_asset_hdr_rec => l_asset_hdr_rec
);
l_mesg_count := fnd_msg_pub.count_msg;
IF l_mesg_count > 0
THEN
l_mesg :=
CHR (10)
|| SUBSTR (fnd_msg_pub.get (fnd_msg_pub.g_first, fnd_api.g_false),
1,
250
);
DBMS_OUTPUT.put_line (l_mesg);
FOR i IN 1 .. (l_mesg_count - 1)
LOOP
l_mesg :=
SUBSTR (fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false),
1,
250
);
DBMS_OUTPUT.put_line (l_mesg);
END LOOP;
fnd_msg_pub.delete_msg ();
END IF;
IF (l_return_status <> fnd_api.g_ret_sts_success)
THEN
DBMS_OUTPUT.put_line ('FAILURE');
ELSE
DBMS_OUTPUT.put_line ('SUCCESS');
DBMS_OUTPUT.put_line ('ASSET_ID'
|| TO_CHAR (l_asset_hdr_rec.asset_id)
);
DBMS_OUTPUT.put_line ('BOOK: ' || l_asset_hdr_rec.book_type_code);
END IF;
END LOOP;
COMMIT;
END;

No comments :

Post a Comment

">