0% found this document useful (0 votes)
67 views

PLSQL API

This document declares variables and initializes global settings for an accounts receivable adjustment API. It populates an adjustment record with sample data and calls the API to create an adjustment, passing the required parameters. The API response is output, including any messages, the new adjustment number and ID. Finally, it commits the transaction.
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)
67 views

PLSQL API

This document declares variables and initializes global settings for an accounts receivable adjustment API. It populates an adjustment record with sample data and calls the API to create an adjustment, passing the required parameters. The API response is output, including any messages, the new adjustment number and ID. Finally, it commits the transaction.
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/ 2

SET serveroutput on

DECLARE
v_init_msg_list VARCHAR2 (1000);
v_commit_flag VARCHAR2 (5) := 'F';
v_validation_level NUMBER (4) := fnd_api.g_valid_level_full;
v_msg_count NUMBER (4);
v_msg_data VARCHAR2 (1000);
v_return_status VARCHAR2 (5);
v_adj_rec ar_adjustments%ROWTYPE;
v_chk_approval_limits VARCHAR2 (5) := 'F';
v_check_amount VARCHAR2 (5) := 'F';
v_move_deferred_tax VARCHAR2 (1) := 'Y';
v_new_adjust_number ar_adjustments.adjustment_number%TYPE;
v_new_adjust_id ar_adjustments.adjustment_id%TYPE;
v_called_from VARCHAR2 (25) := 'ADJ-API';
v_old_adjust_id ar_adjustments.adjustment_id%TYPE;
l_customer_trx_id NUMBER;
l_payment_schedule_id NUMBER;
l_receivables_trx_id NUMBER;

BEGIN

/*------------------------------------+
| Setting global initialization |
+------------------------------------*/
mo_global.init ('AR');
mo_global.set_policy_context ('S', '204');
fnd_global.apps_initialize (1318, 50559, 222);--1015214
/*------------------------------------+
| Setting value to input parameters |
+------------------------------------*/
--Populate v_adj_rec record
v_adj_rec.customer_trx_id := 835618;--834618;
v_adj_rec.TYPE := 'LINE';
v_adj_rec.payment_schedule_id := 360940;--359940;
v_adj_rec.receivables_trx_id := 1007;
v_adj_rec.amount := 11;
v_adj_rec.apply_date := TO_DATE (sysdate);
v_adj_rec.gl_date := TO_DATE (sysdate);
v_adj_rec.created_from := 'ADJ-API2';
ar_adjust_pub.create_adjustment ('AR_ADJUST_PUB',
1.0,
v_init_msg_list,
v_commit_flag,
v_validation_level,
v_msg_count,
v_msg_data,
v_return_status,
v_adj_rec,
v_chk_approval_limits,
v_check_amount,
v_move_deferred_tax,
v_new_adjust_number,
v_new_adjust_id,
v_called_from,
v_old_adjust_id
);
DBMS_OUTPUT.put_line (v_msg_data);
DBMS_OUTPUT.put_line (v_new_adjust_number);
DBMS_OUTPUT.put_line (v_new_adjust_id);
DBMS_OUTPUT.put_line (v_init_msg_list);
DBMS_OUTPUT.put_line ('Successfully Completed');
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
FOR i IN 1 .. v_msg_count
LOOP
DBMS_OUTPUT.put_line (v_msg_data);
DBMS_OUTPUT.put_line (v_new_adjust_number);
DBMS_OUTPUT.put_line (v_new_adjust_id);
DBMS_OUTPUT.put_line (v_init_msg_list);
END LOOP;
END;
/

You might also like