Posted on September 5th, 2008 by Sanjit Anand |
Print This Post
|
Email This Post
This is sample code that you can use for creating adjustment.This is tested while integrating with POS -Oracle Integration.
Pre-requisite Setup
There should be You should take a note, API requires the following receivable activity setup:
- GL Account Source must be Activity
API documentation and Mapping
Here are API’S mapping and underline sample code. You can use this for creating adjustment through API’s.

You can also download mapping sheet here: Download
Sample Code
1. If you are using Sql*plus or Toad , you set org_context
exec fnd_client_info.set_org_context(org_id);
example
exec fnd_client_info.set_org_context(121);
2. Sample Code, you can check latest version at irep.
DECLARE up_adj_rec ar_adjustments%rowtype; up_api_name VARCHAR2(20); up_api_version NUMBER; up_called_from VARCHAR2(10); up_check_amount VARCHAR2(1); up_chk_approval_limits VARCHAR2(1); up_commit_flag VARCHAR2(1); up_init_msg_list VARCHAR2(1); up_move_deferred_tax VARCHAR2(10); up_msg_count NUMBER; up_msg_data VARCHAR2(2000); up_new_adjust_id ar_adjustments.adjustment_id%type; up_new_adjust_number ar_adjustments.adjustment_number%type; up_old_adjust_id ar_adjustments.adjustment_id%type; up_return_status VARCHAR2(5); up_validation_level NUMBER; BEGIN fnd_global.apps_initialize(1290, 50283, 222); up_adj_rec := NULL; up_api_name := NULL; up_api_version := 1.0; up_called_from := NULL; up_check_amount := NULL; up_chk_approval_limits := NULL; up_commit_flag := NULL; up_init_msg_list := FND_API.G_TRUE; up_move_deferred_tax := ‘Y’; up_msg_count := 0; up_msg_data := NULL; up_new_adjust_id := NULL; up_new_adjust_number := NULL; up_old_adjust_id := NULL; up_return_status := NULL; up_validation_level := FND_API.G_VALID_LEVEL_FULL; /* api- data adjustments mapping record - start */ up_adj_rec.ACCTD_AMOUNT := -300; — COLUMN A2 up_adj_rec.ADJUSTMENT_ID := NULL; up_adj_rec.ADJUSTMENT_NUMBER := NULL; up_adj_rec.ADJUSTMENT_TYPE := ‘M’; up_adj_rec.AMOUNT := -300; up_adj_rec.CREATED_BY := 1290; up_adj_rec.CREATED_FROM := ‘MEDICLAIM WEBCALL-API’; up_adj_rec.CREATION_DATE := to_date(’21-JUL-2008′, ‘DD-MON-YYYY’); up_adj_rec.GL_DATE := to_date(’21-JUL-2008′, ‘DD-MON-YYYY’); up_adj_rec.LAST_UPDATE_DATE := SYSDATE; up_adj_rec.LAST_UPDATED_BY := 1290; up_adj_rec.POSTING_CONTROL_ID := -3; up_adj_rec.SET_OF_BOOKS_ID := 1001; up_adj_rec.STATUS := ‘A’; up_adj_rec.TYPE := ‘LINE’; up_adj_rec.PAYMENT_SCHEDULE_ID := 16061; up_adj_rec.APPLY_DATE := SYSDATE; up_adj_rec.RECEIVABLES_TRX_ID := 1603; — this is rec activity up_adj_rec.CODE_COMBINATION_ID := 60810; — pass the CCID up_adj_rec.CUSTOMER_TRX_ID := 48208; — Transaction for which adjustment is made – up_adj_rec.ADJ_TAX_ACCT_RULE := 33; /* api- data adjustments mapping record - End */ AR_ADJUST_PUB.Create_Adjustment ( p_api_name => up_api_name, p_api_version => up_api_version, p_init_msg_list => up_init_msg_list, p_commit_flag => up_commit_flag, p_validation_level => up_validation_level, p_msg_count => up_msg_count, p_msg_data => up_msg_data, p_return_status => up_return_status, p_adj_rec => up_adj_rec, p_chk_approval_limits => up_chk_approval_limits, p_check_amount => up_check_amount, p_move_deferred_tax => up_move_deferred_tax, p_new_adjust_number => up_new_adjust_number, p_new_adjust_id => up_new_adjust_id, p_called_from => up_called_from, p_old_adjust_id => up_old_adjust_id ); DBMS_OUTPUT.PUT_LINE(’New Adjustment Number: ‘ || up_new_adjust_number); DBMS_OUTPUT.PUT_LINE(’New Adjustment ID: ‘ || up_new_adjust_id); IF up_msg_count >=1 THEN FOR I IN 1..up_msg_count LOOP dbms_output.put_line(I||’. ‘||SUBSTR(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255)); END LOOP; END IF; END;
Once record get successfully created you will get adjustment id.
3. Final Verification
Go to Oracle pull the transaction detials and click the ‘Adjust’ button.
You can see adjustment created.
Oracle Documentation
11i Oracle Receivables API User Notes - PDF format
R12 Oracle Receivables API User Notes - PDF format
Similar Post
-
AR Adjustments : API - Sample code


