EBS Common Development and finishing

Source: Internet
Author: User

1. Query the name of the value set by the code number
– Take Flex_value description
FUNCTION Get_flex_value_desc (p_flex_value_set_name in varchar2,– value set code
P_flex_value in VARCHAR2)
RETURN VARCHAR2 is
V_flex_value_desc Fnd_flex_values_vl.description%type;
BEGIN
SELECT v.description
Into V_flex_value_desc
From Fnd_flex_values_vl V, fnd_flex_value_sets s
WHERE v.flex_value_set_id = s.flex_value_set_id
and s.flex_value_set_name = P_flex_value_set_name
and v.flex_value = P_flex_value;

RETURN v_flex_value_desc;

EXCEPTION
When OTHERS Then
RETURN NULL;
END Get_flex_value_desc;

2, the asset belongs to the responsibility center, the organization and so on Common association table
From
Gl_code_combinations GCC,
Fa_distribution_history FDH
where
and gcc.code_combination_id=fdh.code_combination_id
and (V_respon_from is NULL OR to_number (gcc.segment2) >= v_respon_from)
and (V_respon_to is NULL OR to_number (gcc.segment2) <= v_respon_to)

3. Formatted date
V_date_from Date: = To_date (P_date_from, ' yyyy/mm/dd ');

4, related to asset changes, scrap, new and other Operations related table
Fa_transaction_headers
5, take accumulated depreciation
function Get_deprn_reserve (p_asset_id number, P_book_type_code varchar2)
return number is
Dummy_num number;
Dummy_char varchar2 (10);
Dummy_bool Boolean;
V_reval_reserve number;
V_YTD_DEPRN number;
V_ytd_production number;
V_ltd_production number;
V_bonus_deprn_reserve number;
V_BONUS_YTD_DEPRN number;
V_deprn_reserve number;
V_book_type_code varchar2 (30);
L_IMPAIRMENT_RSV number;–bug#7293626
l_set_of_books_id Number: = Fnd_profile. VALUE (' gl_set_of_bks_id ');
L_log_level_rec Fa_api_types.log_level_rec_type;
Begin

--Take the current accumulated depreciation of the asset if (P_book_type_code is null) then select Book_type_code to V_book_type_code from Fa_books where as set_id = p_asset_id and Date_ineffective is null;else v_book_type_code: = P_book_type_code;end If;FA_QUERY_BALANCES_P KG. Query_balances (x_asset_id = p_asset_id, X_book = V_book_type_code, x_period_                    CTR = 0, x_dist_id = 0, X_run_mode = ' standard ', x_cost = Dummy_num, X_DEPRN_RSV = v_deprn_reserve, X_REVAL_RSV = V_reval_re         SERVE, x_ytd_deprn = v_ytd_deprn, X_ytd_reval_exp = Dummy_num, x_reval_deprn_exp = Dummy_num, X_deprn_exp = dummy_num, X_reval_amo = Dummy_ NUM, X_prod = Dummy_num, X_ytd_prod =& Gt V_ytd_production,        X_ltd_prod = v_ltd_production, X_adj_cost =&G T Dummy_num, x_reval_amo_basis = dummy_num, x_bonus_rate = DU Mmy_num, X_deprn_source_code = Dummy_char, X_adjusted_flag = Dummy_b        OOL, x_transaction_header_id = 1, X_BONUS_DEPRN_RSV = V_bonus_deprn_reserve,        X_BONUS_YTD_DEPRN = v_bonus_ytd_deprn, X_bonus_deprn_amount = Dummy_num, X_IMPAIRMENT_RSV = dummy_num, x_ytd_impairment = Dummy_num, X _impairment_amount = dummy_num, x_capital_adjustment = Dummy_num, X_general_f               UND = dummy_num, X_mrc_sob_type_code = null, x_set_of_books_id = L_set_of_books_id, P_log_level_rec = L_log_level_rec); return (v_deprn_reserve); exception when others then return (null); end Get_deprn_reserve;

6. Get the small class name of the asset and associate it with the asset class
FUNCTION CUX_GET_FLEX_DESC2 (V_flex_set VARCHAR2,
V_flex_value VARCHAR2,
V_flex_value2 VARCHAR2) RETURN VARCHAR2 is
V_description VARCHAR2 (240);
BEGIN
SELECT ffvv.description
Into V_description
From Fnd_flex_value_sets FFVs, FND_FLEX_VALUES_VL ffvv
WHERE Ffvs.flex_value_set_name = V_flex_set
and Ffvv.flex_value = V_flex_value
and ffvv.flex_value_set_id = ffvs.flex_value_set_id
–and FFVV. Parent_flex_value_low = V_flex_value2
and FFVV. Enabled_flag = ' Y ';
RETURN v_description;
EXCEPTION
When OTHERS Then
RETURN NULL;
END CUX_GET_FLEX_DESC2;

– Call CUX_GET_FLEX_DESC2 (' Fa_min ', Fc.segment2, fc.segment1) Cate_small_desc

6 set of values with context affinity
WHERE (asset_category_segment1>=: l e x . Cux_fa_category_big_from)

7. Generate random Auto-numbering

SELECT Cux_order_headers_s.nextval to x_header_id from dual;

8, the parameters of the report settings
Concurrent_program_name= "Cuxfacatsum" program_appl_short_name= "Cux" submit_once= "Y"

9. For Silent Box submission
PROCEDURE Do_commit is
Old_level VARCHAR2 (2);
BEGIN
Old_level:=name_in (' SYSTEM. Message_level ');
COPY (' 5 ', ' SYSTEM. Message_level ');
COMMIT;
COPY (Old_level, ' SYSTEM. Message_level ');
END Do_commit;

10, forms after the addition and deletion of the change, you need to join a commit, will be executed into the database.
11, Form-lov Mutual relations between the reference
SELECT Fvv.flex_value VALUE_CODE,FVV. DESCRIPTION
From Fnd_flex_value_sets Fvs,
FND_FLEX_VALUES_VL FVV,
cux_fa_bill_lookup_t CFB
WHERE Fvs.flex_value_set_name = Cfb.lookup_code
and fvs.flex_value_set_id = fvv.flex_value_set_id
and Cfb.lookup_type = ' Category_flexfield '
and cfb.lookup_name = ' SEGMENT1 '
and cfb.is_enable = ' Y '
and Fvv.enabled_flag = ' Y '
and FVV. Flex_value like NVL (substr (: Query_find. asset_category_segment2,1,3), '% ')

12. Output exception statements in PL/SQL
exception
When others then
INSERT into testinfo values (dbms_utility.format_error_backtrace);
Commit

Or
Dbms_output.put_line (L_sql); – can be output when testing

13. PL/SQL Test if you need to initialize parameters
At the entrance of the PL and SQL program, begin typing the following code:
Fnd_global. Apps_initialize (user_id =>1130, resp_id =>50724, resp_appl_id =>20003);
Inside the parameter specific value, can be queried in the form interface diagnosis.
14, according to the responsibility to configure the function authority control
(1) New responsibilities, in the application of products-function, new functions
(2) Write code validation responsibilities in form and write more censored control statements
IF fnd_function. TEST (' cux_fa_query ') then
Set_block_property (' Bill_head ', insert_allowed,property_true);

15, the call between the FORM
App_navigate. EXECUTE or Fnd_function. EXECUTE
Example: App_navigate. EXECUTE (' hek_discount_period_new ', ' y ', ' y ', null);
Which app_navigate. EXECUTE with Fnd_function. The difference between EXECUTE:
App_navigate. EXECUTE only hits a form, and fnd_function. How many times does the EXECUTE call open?
A.

16. Traverse Data Block
Go_block (' Blockname ');
First_record;
IF:SYSTEM.block_status <> ' NEW ' then
Loop
If:system.last_record = ' TRUE ' Then
Exit
Else
Next_record;
End If;
End Loop;
End If;

17.
Common methods of Fnd_profile
Begin
Fnd_message.debug (' user_id= ' | | fnd_profile.value (' user_id ')); – Take the current login EBS user ID
Fnd_message.debug (' User_name= ' | | Fnd_profile.value (' USERNAME ')); – Take the current logged-on EBS user name
Fnd_message.debug (' Fnd_global.user_name= ' | | Fnd_global.user_name); – Take the current logged-on EBS user name
Fnd_message.set_string (' gl_set_of_bks_id= ' | | Fnd_profile.value (' gl_set_of_bks_id '));
Fnd_message.show; – Take the current set of accounts
End
18.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

EBS Common Development and finishing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.