Sunday, August 25, 2019
API to CREATE GL Code combination FND_FLEX_KEYVAL.VALIDATE_SEGS in R12
In this post, we have given a
sample script to create a new code combination based on concatenated segment
values.
This API will first check
whether the given combination already created by checking in
GL_CODE_COMBINATION table, if so, it will simply return the code combination id
from the table. If given combination is not already created, it will create the
code combination id for the given combination provided it satisfies all segment
level validations including cross validation rules.
Test instance: R12.2.4
Script:
SET SERVEROUTPUT ON;DECLARElv_r12_ccd VARCHAR2(2000) DEFAULT SHARE.ABCDEF.2901.000000';lv_ledger_name VARCHAR2(300) DEFAULT 'SHARE Ledger';ln_structure_number NUMBER;lb_sucess BOOLEAN;BEGINSELECT chart_of_accounts_idINTO ln_structure_numberFROM gl_ledgersWHERE name = lv_ledger_name;lb_sucess := fnd_flex_keyval.validate_segs(operation => 'CREATE_COMBINATION',appl_short_name => 'SQLGL',key_flex_code => 'GL#',structure_number => ln_structure_number,concat_segments => lv_r12_ccd,validation_date => SYSDATE);IF lb_sucessTHENDBMS_OUTPUT.PUT_LINE('Successful. Code Combination ID: '||fnd_flex_keyval.combination_id());ELSEDBMS_OUTPUT.PUT_LINE('Error creating a Code combination id for ' ||lv_r12_ccd||' Error:'|| fnd_flex_keyval.error_message());END IF;EXCEPTIONWHEN OTHERS THENDBMS_OUTPUT.PUT_LINE('Unable to create a code combination (OTHERS EXCEPTION) for ' ||lv_r12_ccd||' Error:'|| SQLERRM);END;
Test Results:
Hope it helps!!
Do you think this Article is useful?
Subscribe to:
Post Comments (Atom)
Disclaimer
The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.
1 Responses to “API to CREATE GL Code combination FND_FLEX_KEYVAL.VALIDATE_SEGS in R12”
December 19, 2021 at 2:21 PM
in second screen shot error what is the solution?
Post a Comment