Cost Allocation Flexfield with Table Value Sets

Hi
I am setting up Costing for Payroll. I have a requirement where I want to use Table Validated value sets for Cost Allocation Flexfield. In the Administrator Guide it is written that we should not use Table validated value sets for any KFFs.
I still tried the same (defining Table validated value sets) and my process errored out. It was giving following error
Value 381 for the flexfield segment Cost Center does not exist in the value set
SJR_COST_CENTER_LIST.
invalid code combination:
381SJR_COST_CENTER_LIST is name of the value set.
Then I changed the value set and keep the code and meaning in the value set table as same and my process worked fine.
Now I want to know that should I use Table validated value set or not. As Oracle does not support these in KFFs

Hi Thierry
Thanks for the reply
have you used cross validation rules?I am not sure about cross validation rules and how we can use in my case.
An other thought: there is an action parameter available parameter_name=COST_API_IMODE
Set the parameter_value = 'Y'In my case my costing process is working fine, even when I define my table validated value sets. My question is should we define table validated values sets or not as Oracle does not support it now? Oracle use to support this for KFFs some time back but now they are saying they does not support.
Are there any known issues if we use Table validated value sets? Why Oracle does not support it for KFFs?

Similar Messages

  • Problem with Table Value Set

    Hi,
    i have created a Table value Set for showing Vendor_site_code in DFF
    XXXX_VENDOR_NAME
    Table Application :Purchasing
    Table Name:PO_VENDORS
    Value:VENDOR_NAME
    ID:VENDOR_ID
    XXXX_VENDOR_SITECODE
    Table Application :Purchasing
    Table Name:PO_VENDORS PV, PO_VENDOR_SITES_ALL PVS
    Value:PVS.VENDOR_SITE_CODE
    ID:PVS.VENDOR_SITE_ID
    where/order by: where PV.VENDOR_ID=PVS.VENDOR_ID
    XXX_ITEM
    Table Application :IVENTORY
    Table Name:MTL_SYSTEM_ITEMS_B
    Value:PVSSEGMENT1||'-'||SEGMENT2||SEGMENT3
    ID:PVS.INVENTORY_ITEM_ID
    where/order by:WHERE ORGANIZATION_ID = cs_std.get_item_valdn_orgzn_id
    i am facing the below error when opening the Form related to that DFF
    APP-FND-01564: ORACLE error 1722 in FDFGVD
    Cause: FDFGVD failed due to ORA-01722: invalid number.
    The SQL statement being executed at the time of the error was: SELECT PVS.VENDOR_SITE_ID,PVS.VENDOR_SITE_CODE VALUE, PVS.VENDOR_SITE_CODE DESCRIPTION, NVL('N', 'N'), NVL(TO_NUMBER(NULL), -1), NULL, NVL('Y', 'Y'), NVL(TO_CHAR(TO_DATE(NULL), 'J'), 0), NVL(TO_CHAR(TO_DATE(NULL), 'J'), 0) FROM PO_VENDORS PV, PO_VENDOR_SITES_ALL PVS WHERE ( PV.VENDOR_ID=PVS.VENDOR_ID) AND PVS.VENDOR_SITE_ID = :X and was executed from the file &ERRFILE.

    Can you say where have you placed this valueset - which DFF, in which form?

  • Fnd_request.submit_request issue with PA_SRS_DATES2 value set.

    Hi,
    We are applications 12.0.6 with 10.2.0.3.0 database. I'm trying to submit the "PRC: Generate Draft Revenue for a Single Project" through fnd_request.submit_request and is erroring out with "PA: Error - Entered Accrue through date is not within open/future PA period". I'm able to run the same program from the application with the same parameters. I'm passing Accue date of 2009/08/31 00:00:00 from the program and I can see the same value when submitted frm the applications also.
    Value set for this Accrue date parameter is "PA_SRS_DATES2". It is setup as format type "Standard Date" and maximum size is 11.
    Thanks for your help,
    Shree.
    Here is the script
    SELECT TO_CHAR (rec1.per_end_date, 'RRRR/MM/DD HH24:MI:SS')
    INTO v_rev_accrue
    FROM DUAL;
    fnd_file.put_line (fnd_file.LOG,
    'Revenue Accrue Date is :' || v_rev_accrue
    fnd_file.put_line (fnd_file.LOG, 'Parameters for GDR :');
    fnd_file.put_line (fnd_file.LOG,
    'Argument1 is :' || TO_CHAR (rec1.project_id)
    fnd_file.put_line (fnd_file.LOG, 'Argument4 is :' || v_rev_accrue);
    v_fc_req_id :=
    fnd_request.submit_request (application => 'PA',
    program => 'PARGDR_SINGLE',
    sub_request => FALSE,
    start_time => NULL,
    argument1 => rec1.project_id,
    argument2 => 'N',
    argument3 => 'Y',
    argument4 => v_rev_accrue,
    argument5 => NULL,
    argument6 => NULL,
    argument7 => NULL,
    argument8 => NULL,
    argument9 => NULL,
    argument10 => NULL,
    argument11 => 'Y',
    argument12 => 'N',
    argument13 => NULL,
    argument14 => NULL,
    argument15 => NULL,
    argument16 => NULL,
    argument17 => NULL,
    argument18 => 'N',
    argument19 => 'N',
    argument20 => 'N'
    IF NVL (v_fc_req_id, 0) = 0
    THEN
    gv_debug_name :=
    'Error in Submitting the draft revenue program program. ';
    fnd_file.put_line (fnd_file.LOG, gv_debug_name);
    RAISE general_error;
    ELSE
    COMMIT;
    fnd_file.put_line (fnd_file.LOG,
    'draft revenue program. Request Id:'
    || TO_CHAR (v_fc_req_id)
    END IF;
    Here is the log for the request submitted via fnd_request.submit_request.
    Projects: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    PARGDR_SINGLE module: PRC: Generate Draft Revenue for a Single Project
    Current system time is 13-AUG-2009 18:59:19
    Entering parmai()
    ...Connected to Oracle
    Accrue Thru date from Command line is : 2009/08/31 00:00:00
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    PA: Error - Entered Accrue through date is not within open/future PA period
    Exceptions posted by this request:
    Concurrent Request for "PRC: Generate Draft Revenue for a Single Project" has completed with error.
    Concurrent request completed
    Current system time is 13-AUG-2009 18:59:20
    Here is the log for the request submitted via the application
    Projects: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    PARGDR_SINGLE module: PRC: Generate Draft Revenue for a Single Project
    Current system time is 10-AUG-2009 17:12:11
    Entering parmai()
    ...Connected to Oracle
    Accrue Thru date from Command line is : 2009/08/31 00:00:00
    project:196 delete:N regenerate:Y acc_thru_dt:2009/08/31
    start project: end project:
    Operating unit is 153Revenue is running in Normal revenue mode
    Revenue is not based on specific project type...
    Revenue is not based on specific organization...
    Revenue is not based on specific customer...
    Revenue is not based on specific Agreement...
    Revenue is running for MCB/Non MCB projects...
    Revenue is running for Unrelease revenue mode...
    Revenue is not creating the detail report ...
    Revenue Processing Parameter List
    =================================
    -------------- < parameter list > -----------------------
    Accru Through Date ----------------------------------------> 2009/08/31
    Project ID ------------------------------------------------> 196
    From Project Number --------------------------------------->
    To Project Number ----------------------------------------->
    Adjusting Revenue Run -------------------------------------> No
    Project Type ID -----------------------------------------> 0
    Organization ID ------------------------------------------> 0
    Customer ID ----------------------------------------------> 0
    Agreement ID ----------------------------------------------> 0
    Multi Currency Projects -----------------------------------> No
    Release Draft Revenue -------------------------------------> No
    Include Detail Report -------------------------------------> No
    -------------- < End of parameter list > -----------------------
    ...Request ID = 714111
    This concurrent request is not being rescheduled
    Current system time is 10-AUG-2009 17:12:11
    ...about to delete revenue for project id 196
    ...0 draft revenues deleted
    Current system time is 10-AUG-2009 17:12:11
    ...about to process adjustments
    SELECT p.project_id, p.segment1,
    p.distribution_rule, p.project_level_funding_flag,p.project_currency_code,
    p.project_bil_rate_date_code,
    p.project_bil_rate_type,
    to_char(p.project_bil_rate_date,'YYYY/MM/DD'),
    p.project_bil_exchange_rate,
    p.projfunc_currency_code,
    p.projfunc_bil_rate_date_code,
    p.projfunc_bil_rate_type,
    to_char(p.projfunc_bil_rate_date,'YYYY/MM/DD'),
    p.projfunc_bil_exchange_rate,
    p.revproc_currency_code,
    p.funding_rate_date_code,
    p.funding_rate_type,
    to_char(p.funding_rate_date,'YYYY/MM/DD'),
    p.funding_exchange_rate,
    p.multi_currency_billing_flag,
    p.assign_precedes_task,
    p.enable_top_task_customer_flag,
    p.enable_top_task_inv_mth_flag,
    nvl(p.inv_by_bill_trans_curr_flag, 'N'),
    nvl(p.revtrans_currency_type, 'PROJ_FUNC_CURR_ONLY')
    FROM pa_projects p, pa_project_types t
    WHERE p.project_id = :project_id
    AND pa_project_utils.check_prj_stus_action_allowed(p.project_status_code,'GENERATE_REV') = 'Y'
    AND :start_project_number||'x' != :end_project_number||'y'
    AND p.project_type = t.project_type
    AND t.project_type_class_code = 'CONTRACT'
    AND EXISTS (SELECT /*+ INDEX(pf pa_summary_project_fundings_u1)*/ NULL
    FROM pa_summary_project_fundings pf
    WHERE pf.project_id = p.project_id
    AND nvl(pf.revproc_baselined_amount, 0) != 0)
    AND NOT EXISTS
    (SELECT NULL
    FROM pa_draft_revenues r2
    WHERE r2.project_id = p.project_id
    AND r2.released_date||'' is null
    AND r2.generation_error_flag||'' = decode(:mass_gen,
    1, 'Y', r2.generation_error_flag)
    AND (EXISTS (SELECT NULL
    FROM pa_expenditure_items_all i
    WHERE i.project_id = p.project_id
    AND i.cost_distributed_flag ||''= 'Y'
    AND i.revenue_distributed_flag = 'N'
    AND i.expenditure_item_date
    <= NVL(TO_DATE(:acc_thru_dt,'YYYY/MM/DD'),sysdate)
    AND (EXISTS (SELECT /*+ LEADING(l)*/ NULL
    FROM pa_draft_revenues r, pa_cust_rev_dist_lines l
    WHERE r.project_id = i.project_id
    AND ((l.expenditure_item_id = i.adjusted_expenditure_item_id AND i.adjusted_expenditure_item_id is not null )
    OR (l.expenditure_item_id = i.expenditure_item_id))
    AND NVL(l.reversed_flag,'N') = 'N'
    AND l.line_num_reversed IS NULL
    AND r.project_id = l.project_id
    AND r.draft_revenue_num = l.draft_revenue_num
    AND (r.released_date||'' is not null
    OR r.generation_error_flag||'' = decode(:mass_gen,
    1, 'N', 'E')))
    or exists (
    select 1 from pa_expenditure_items ei2
    where ei2.project_id = i.project_id
    and ei2.expenditure_item_id=i.adjusted_expenditure_item_id
    and ei2.revenue_distributed_flag='Y'
    and ei2.raw_revenue=0))
    union all
    SELECT /*+ LEADING(v)*/NULL
    FROM pa_events v
    WHERE v.project_id = p.project_id
    AND ((v.revenue_distributed_flag = 'N'
    AND v.completion_date
    <= NVL(TO_DATE(:acc_thru_dt,'YYYY/MM/DD'),sysdate))
    OR (substr(p.distribution_rule,1,4) = 'COST'
    AND v.revenue_distributed_flag = 'Y'
    AND v.completion_date
    > NVL(TO_DATE('2009/08/31','YYYY/MM/DD'), sysdate)))
    AND (DECODE(NVL(v.bill_trans_rev_amount, 0), 0 ,
    DECODE(NVL(v.zero_revenue_amount_flag, 'N'), 'Y', 1, 0),1) = 1)
    AND NVL(revenue_hold_flag, 'N') = 'N'
    AND EXISTS (
    SELECT NULL
    FROM pa_tasks t
    WHERE v.task_id is not NULL
    AND t.ready_to_distribute_flag = 'Y'
    AND v.task_id = t.task_id
    UNION ALL
    SELECT NULL
    FROM pa_tasks t1
    WHERE v.task_id is NULL
    AND t1.ready_to_distribute_flag = 'Y'
    AND v.project_id = t1.project_id )
    AND Exists (select null from pa_draft_revenues r,pa_cust_event_rev_dist_lines l
    where l.project_id = v.project_id
    AND ( l.task_id = v.task_id OR v.task_id is NULL )
    AND l.event_num = v.event_num
    AND NVL(l.reversed_flag,'N') = 'N'
    AND l.line_num_reversed IS NULL
    AND r.project_id = v.project_id
    AND r.draft_revenue_num = l.draft_revenue_num
    AND (r.released_date||'' is not null
    OR r.generation_error_flag||'' = decode(:mass_gen,
    1, 'N', 'E')))
    union all
    SELECT /*+ USE_CONCAT */ NULL
    FROM PA_Billing_Extensions be, PA_Billing_Assignments bea
    WHERE bea.active_flag = 'Y'
    AND bea.billing_extension_id = be.billing_extension_id
    AND (bea.project_id = p.project_id
    OR bea.project_type = p.project_type
    OR bea.distribution_rule = p.distribution_rule)
    AND be.calling_process in ('Revenue','Both')
    AND nvl(be.call_after_adj_flag, 'N') = 'Y'
    AND be.trx_independent_flag = 'Y'))
    Current system time is 10-AUG-2009 17:12:11
    ...0 projects processed for adjustments
    Current system time is 10-AUG-2009 17:12:11
    ...about to generate revenue for project id 196
    ...Fetching next project
    Current system time is 10-AUG-2009 17:12:11
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'PRE', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'PRE', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Leaving pauoarchn()
    ...no rows to process for this project.
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for project id 196, number 72DM000001
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    l_inv_by_btc_flag is ...N
    l_mcb_flag is ...Y
    l_rpc_code is ...GBP
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    ...Else loop 1
    ...else loop 2
    ...else loop 4
    ...else loop 5
    ...non_zero_amount
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    ...Else loop 1
    ...else loop 2
    ...else loop 4
    ...else loop 5
    ...non_zero_amount
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for automatic events for project id 196, number 72DM000001 calling loc REG
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'POST-REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'POST-REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for automatic events for project id 196, number 72DM000001 calling loc POST-REG
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'POST', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'POST', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...Fetching next project
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...about to call AutoAccounting
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Entering pafvsu
    Allocating pafvcs structure
    Allocating memory for structure, fdfkai
    Allocating memory for structure, fdfkao
    Allocating flex input and output structure
    Assigning ptype
    Calling pagtfn
    Nullig out
    Setting everything that does not need to be allocated
    Allocating optional arrays
    Checking a_line_id
    Checking a_trans_ind
    Checking a_param_lst
    Checking a_extra_atr
    Allocating required array
    Allocating auto accounting elements
    Describing kff and control processing options
    Tune flex validation system options
    Allocate main cache
    Allocate additional memory for main cache
    Allocate ksv if needed
    Store pointer to text strings in last ksv element so we can free later
    val [¿], segval [00000000]
    val [00000000], segval [000000]
    val [000000], segval [7210OCOA01]
    val [7210OCOA01], segval [0000]
    val [0000], segval [72OXLFTG]
    val [72OXLFTG], segval [66101010]
    val [66101010], segval [7210]
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...returned from AutoAccounting
    ...about to update pe_expenditures_all for intercompany processing
    Current system time is 10-AUG-2009 17:12:11
    Entering parddl()
    ...setting error codes and bad code combination id to null
    ... Update draft revenues for marking autoaccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update draft revenues without generation error to normal state
    Current system time is 10-AUG-2009 17:12:11
    1 rows updated.
    ... Update pa_cust_event_rev_dist_lines for setting bad CCID to null
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_events for marking AutoAccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_events for setting revenue_distributed_flag to 'N'
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_cust_rev_dist_lines for setting bad CCID to null
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_expenditure_items_all for marking AutoAccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_expenditure_items_all for setting revenue_distributed_flag to 'N'
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    Leaving parddl()
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated with Generation error due to ccid=-1
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated with Generation error PA_REV_GEN_ERROR
    Current system time is 10-AUG-2009 17:12:11
    ...1 projects processed for revenue generation
    Deleting automatic event for which revenue has generation error
    Current system time is 10-AUG-2009 17:12:11
    ...about to update proj summary funding amounts
    executing pa_billing.check_spf_amounts('B',196, , ) Calling check_spf_amounts...Inside the Single projects If
    Current system time is 10-AUG-2009 17:12:11
    ...about to generate reports
    SEL-SUC:72DM000001 4 1048 AP Exploration Operating DML 101 31-AUG-09 121659.83
    Current system time is 10-AUG-2009 17:12:12
    ...completed generating reports
    Process completed.
    0 rows deleted from distribution_warnings table.
    Start of log messages from FND_FILE
    Request id is :714111
    Before calling the insert event for top task_id :19839
    Parameters to the insert event API :
    Revenue amount is :12106.73
    Bill amount is :12106.73
    Project id is :196
    Event Type is :BILLING
    Top Task id is :19839
    organization id is :239
    completion date is :31-AUG-2009
    event description is :Financing Fee
    Return status after calling insert event is :0
    error message after calling insert event is :
    Before calling the insert event for top task_id :14612
    Parameters to the insert event API :
    Revenue amount is :109553.1
    Bill amount is :109553.1
    Project id is :196
    Event Type is :BILLING
    Top Task id is :14612
    organization id is :239
    completion date is :31-AUG-2009
    event description is :Expenditure
    Return status after calling insert event is :0
    error message after calling insert event is :
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PRINT   -------------
    Printing output file.
    Request ID : 714111
    Number of copies : 0
    Printer : noprint
    Finished executing request completion options.
    Concurrent request completed successfully
    Current system time is 10-AUG-2009 17:12:12
    ---------------------------------------------------------------------------

    Duplicate thread.
    fnd_request.submit_request error with PA_SRS_DATES2 value set
    fnd_request.submit_request error with PA_SRS_DATES2 value set

  • Cross validation on cost allocation flexfield

    We have setup a cost allocation ff with the option to cross-validate segments. We have correctly defined cross validation rules. Yet, when entering costing information for an element entry, the system allows us to enter a combination which violates our cross-validation rules. We have already checked that this combination was not existing before we created the rule so we do not understand why the rule is not working. Any ideas?

    did u try with the below error message
    ID HRD for the flexfield segment Profit Centre does not exist in the value set PROFIT_CENTRE.
    checking value set which is is referring

  • Cost allocation flexfield

    hi
    after reading payroll UG, i am a bit confused about cost allocation flexfield for payroll, assignment, element link, org,element entry.
    can i consider this flexfield as a T ledger, the first popup field is for Debit, the second one is for Credit purposes, when they are used for those 5 sections?

    the payroll - org - element entry - assignment - element link are levels at which you can define to show a segment or not.
    In case a segment is specified at a higher level, it is inherited from the other levels, so an end user has not to enter all the data all over again. (like a waterfall)
    The most detailed level is the element entry level. Imagine if the end user must enter there for each segment and for each segment all values. Too much work and too error prone.
    So you can set values for a specific segment at a specific level (example company code at payroll level).
    Costing then rolls up all levels to fully qualify all the segments.

  • Change in Cost Allocation Flexfield

    Hello,
    Client is currently using HRMS for the past one year. Now we need to make a small change in the Cost Allocation Flexfield structure. How will this affect the past data. How can we address this scenario. I seek your expert advise to handle this effectively.
    Regards,
    Jeeves

    Hello Gaurav,
    We're trying to change the value of a segment from 4 digits to 5 digits. We want to update the existing values. Is this possible from the back end.
    Regards,
    Jeeva

  • How to change stored procedure with Table Valued Parameter

    I am not sure how to change the normal stored procedure with Table Value Parameter.Do I have to create a separate Table or do I have to create a datatype. Can you please help me with this
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF]
    @dp_id char(32),
    @dv_id char(32),
    @em_number char(12),
    @email varchar(50),
    @emergency_relation char(32),
    @option1 char(16),
    @status char(20),
    @em_id char(35),
    @em_title varchar(64),
    @date_hired datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    MERGE [dbo].[em] AS [Targ]
    USING (VALUES (@dp_id, @dv_id , @em_number, @email, @emergency_relation, @option1, @status, @em_id, @em_title, @date_hired))
    AS [Sourc] (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired)
    ON [Targ].em_id = [Sourc].em_id
    WHEN MATCHED THEN
    UPDATE
    SET dp_id = [Sourc].dp_id,
    dv_id = [Sourc].dv_id,
    em_number = [Sourc].em_number,
    email = [Sourc].email,
    emergency_relation = [Sourc].emergency_relation,
    option1 = [Sourc].option1,
    status = [Sourc].status,
    em_title = [Sourc].em_title,
    date_hired = [Sourc].date_hired
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (dp_id, dv_id, em_number, email, emergency_relation, option1, status, em_id, em_title,date_hired)
    VALUES ([Sourc].dp_id, [Sourc].dv_id, [Sourc].em_number, [Sourc].email, [Sourc].emergency_relation, [Sourc].option1, [Sourc].status, [Sourc].em_id, [Sourc].em_title, [Sourc].date_hired);
    END;

    It's not clear how you would change the procedure. But assuming that you want to replace the existing scalar parameters with tabular input, this is how you would do it. You first create a table type:
    CREATE TYPE  Insertor_type AS TABLE
        (dp_id                char(32),
         dv_id                char(32),
        em_number            char(12),
        email                varchar(50),
        emergency_relation   char(32),
        option1              char(16),
        status               char(20),
        em_id                char(35),
        em_title             varchar(64),
        date_hired           datetime)
    Then you change the procedure header:
    ALTER PROCEDURE [dbo].[uspInsertorUpdateINF] @tvp Insertor_type READONLY AS
    And finally you change the USING clause:
       USING (SELECT dp_id, dv_id , em_number, email, emergency_relation, option1, status, em_id, em_title, date_hired
              FROM   @tvp) AS [Sourc] ON [Targ].em_id = [Sourc].em_id
    The rest is fine as it is.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Fnd_request.submit_request error with PA_SRS_DATES2 value set

    Hi,
    We are applications 12.0.6 with 10.2.0.3.0 database. I'm trying to submit the "PRC: Generate Draft Revenue for a Single Project" through fnd_request.submit_request and is erroring out with "PA: Error - Entered Accrue through date is not within open/future PA period". I'm able to run the same program from the application with the same parameters. I'm passing Accue date of 2009/08/31 00:00:00 from the program and I can see the same value when submitted frm the applications also.
    Value set for this Accrue date parameter is "PA_SRS_DATES2". It is setup as format type "Standard Date" and maximum size is 11.
    Thanks for your help,
    Shree.
    Here is the script
    SELECT TO_CHAR (rec1.per_end_date, 'RRRR/MM/DD HH24:MI:SS')
    INTO v_rev_accrue
    FROM DUAL;
    v_fc_req_id :=
    fnd_request.submit_request (application => 'PA',
    program => 'PARGDR_SINGLE',
    sub_request => FALSE,
    start_time => NULL,
    argument1 => rec1.project_id,
    argument2 => 'N',
    argument3 => 'Y',
    argument4 => v_rev_accrue,
    argument5 => NULL,
    argument6 => NULL,
    argument7 => NULL,
    argument8 => NULL,
    argument9 => NULL,
    argument10 => NULL,
    argument11 => 'Y',
    argument12 => 'N',
    argument13 => NULL,
    argument14 => NULL,
    argument15 => NULL,
    argument16 => NULL,
    argument17 => NULL,
    argument18 => 'N',
    argument19 => 'N',
    argument20 => 'N'
    IF NVL (v_fc_req_id, 0) = 0
    THEN
    gv_debug_name :=
    'Error in Submitting the draft revenue program program. ';
    fnd_file.put_line (fnd_file.LOG, gv_debug_name);
    RAISE general_error;
    ELSE
    COMMIT;
    fnd_file.put_line (fnd_file.LOG,
    'draft revenue program. Request Id:'
    || TO_CHAR (v_fc_req_id)
    END IF;
    Here is the log for the request submitted via fnd_request.submit_request.
    Projects: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    PARGDR_SINGLE module: PRC: Generate Draft Revenue for a Single Project
    Current system time is 13-AUG-2009 18:59:19
    Entering parmai()
    ...Connected to Oracle
    Accrue Thru date from Command line is : 2009/08/31 00:00:00
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    PA: Error - Entered Accrue through date is not within open/future PA period
    Exceptions posted by this request:
    Concurrent Request for "PRC: Generate Draft Revenue for a Single Project" has completed with error.
    Concurrent request completed
    Current system time is 13-AUG-2009 18:59:20
    Here is the log for the request submitted via the application
    Projects: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    PARGDR_SINGLE module: PRC: Generate Draft Revenue for a Single Project
    Current system time is 10-AUG-2009 17:12:11
    Entering parmai()
    ...Connected to Oracle
    Accrue Thru date from Command line is : 2009/08/31 00:00:00
    project:196 delete:N regenerate:Y acc_thru_dt:2009/08/31
    start project: end project:
    Operating unit is 153Revenue is running in Normal revenue mode
    Revenue is not based on specific project type...
    Revenue is not based on specific organization...
    Revenue is not based on specific customer...
    Revenue is not based on specific Agreement...
    Revenue is running for MCB/Non MCB projects...
    Revenue is running for Unrelease revenue mode...
    Revenue is not creating the detail report ...
    Revenue Processing Parameter List
    =================================
    -------------- < parameter list > -----------------------
    Accru Through Date ----------------------------------------> 2009/08/31
    Project ID ------------------------------------------------> 196
    From Project Number --------------------------------------->
    To Project Number ----------------------------------------->
    Adjusting Revenue Run -------------------------------------> No
    Project Type ID -----------------------------------------> 0
    Organization ID ------------------------------------------> 0
    Customer ID ----------------------------------------------> 0
    Agreement ID ----------------------------------------------> 0
    Multi Currency Projects -----------------------------------> No
    Release Draft Revenue -------------------------------------> No
    Include Detail Report -------------------------------------> No
    -------------- < End of parameter list > -----------------------
    ...Request ID = 714111
    This concurrent request is not being rescheduled
    Current system time is 10-AUG-2009 17:12:11
    ...about to delete revenue for project id 196
    ...0 draft revenues deleted
    Current system time is 10-AUG-2009 17:12:11
    ...about to process adjustments
    SELECT p.project_id, p.segment1,
    p.distribution_rule, p.project_level_funding_flag,p.project_currency_code,
    p.project_bil_rate_date_code,
    p.project_bil_rate_type,
    to_char(p.project_bil_rate_date,'YYYY/MM/DD'),
    p.project_bil_exchange_rate,
    p.projfunc_currency_code,
    p.projfunc_bil_rate_date_code,
    p.projfunc_bil_rate_type,
    to_char(p.projfunc_bil_rate_date,'YYYY/MM/DD'),
    p.projfunc_bil_exchange_rate,
    p.revproc_currency_code,
    p.funding_rate_date_code,
    p.funding_rate_type,
    to_char(p.funding_rate_date,'YYYY/MM/DD'),
    p.funding_exchange_rate,
    p.multi_currency_billing_flag,
    p.assign_precedes_task,
    p.enable_top_task_customer_flag,
    p.enable_top_task_inv_mth_flag,
    nvl(p.inv_by_bill_trans_curr_flag, 'N'),
    nvl(p.revtrans_currency_type, 'PROJ_FUNC_CURR_ONLY')
    FROM pa_projects p, pa_project_types t
    WHERE p.project_id = :project_id
    AND pa_project_utils.check_prj_stus_action_allowed(p.project_status_code,'GENERATE_REV') = 'Y'
    AND :start_project_number||'x' != :end_project_number||'y'
    AND p.project_type = t.project_type
    AND t.project_type_class_code = 'CONTRACT'
    AND EXISTS (SELECT /*+ INDEX(pf pa_summary_project_fundings_u1)*/ NULL
    FROM pa_summary_project_fundings pf
    WHERE pf.project_id = p.project_id
    AND nvl(pf.revproc_baselined_amount, 0) != 0)
    AND NOT EXISTS
    (SELECT NULL
    FROM pa_draft_revenues r2
    WHERE r2.project_id = p.project_id
    AND r2.released_date||'' is null
    AND r2.generation_error_flag||'' = decode(:mass_gen,
    1, 'Y', r2.generation_error_flag)
    AND (EXISTS (SELECT NULL
    FROM pa_expenditure_items_all i
    WHERE i.project_id = p.project_id
    AND i.cost_distributed_flag ||''= 'Y'
    AND i.revenue_distributed_flag = 'N'
    AND i.expenditure_item_date
    <= NVL(TO_DATE(:acc_thru_dt,'YYYY/MM/DD'),sysdate)
    AND (EXISTS (SELECT /*+ LEADING(l)*/ NULL
    FROM pa_draft_revenues r, pa_cust_rev_dist_lines l
    WHERE r.project_id = i.project_id
    AND ((l.expenditure_item_id = i.adjusted_expenditure_item_id AND i.adjusted_expenditure_item_id is not null )
    OR (l.expenditure_item_id = i.expenditure_item_id))
    AND NVL(l.reversed_flag,'N') = 'N'
    AND l.line_num_reversed IS NULL
    AND r.project_id = l.project_id
    AND r.draft_revenue_num = l.draft_revenue_num
    AND (r.released_date||'' is not null
    OR r.generation_error_flag||'' = decode(:mass_gen,
    1, 'N', 'E')))
    or exists (
    select 1 from pa_expenditure_items ei2
    where ei2.project_id = i.project_id
    and ei2.expenditure_item_id=i.adjusted_expenditure_item_id
    and ei2.revenue_distributed_flag='Y'
    and ei2.raw_revenue=0))
    union all
    SELECT /*+ LEADING(v)*/NULL
    FROM pa_events v
    WHERE v.project_id = p.project_id
    AND ((v.revenue_distributed_flag = 'N'
    AND v.completion_date
    <= NVL(TO_DATE(:acc_thru_dt,'YYYY/MM/DD'),sysdate))
    OR (substr(p.distribution_rule,1,4) = 'COST'
    AND v.revenue_distributed_flag = 'Y'
    AND v.completion_date
    > NVL(TO_DATE('2009/08/31','YYYY/MM/DD'), sysdate)))
    AND (DECODE(NVL(v.bill_trans_rev_amount, 0), 0 ,
    DECODE(NVL(v.zero_revenue_amount_flag, 'N'), 'Y', 1, 0),1) = 1)
    AND NVL(revenue_hold_flag, 'N') = 'N'
    AND EXISTS (
    SELECT NULL
    FROM pa_tasks t
    WHERE v.task_id is not NULL
    AND t.ready_to_distribute_flag = 'Y'
    AND v.task_id = t.task_id
    UNION ALL
    SELECT NULL
    FROM pa_tasks t1
    WHERE v.task_id is NULL
    AND t1.ready_to_distribute_flag = 'Y'
    AND v.project_id = t1.project_id )
    AND Exists (select null from pa_draft_revenues r,pa_cust_event_rev_dist_lines l
    where l.project_id = v.project_id
    AND ( l.task_id = v.task_id OR v.task_id is NULL )
    AND l.event_num = v.event_num
    AND NVL(l.reversed_flag,'N') = 'N'
    AND l.line_num_reversed IS NULL
    AND r.project_id = v.project_id
    AND r.draft_revenue_num = l.draft_revenue_num
    AND (r.released_date||'' is not null
    OR r.generation_error_flag||'' = decode(:mass_gen,
    1, 'N', 'E')))
    union all
    SELECT /*+ USE_CONCAT */ NULL
    FROM PA_Billing_Extensions be, PA_Billing_Assignments bea
    WHERE bea.active_flag = 'Y'
    AND bea.billing_extension_id = be.billing_extension_id
    AND (bea.project_id = p.project_id
    OR bea.project_type = p.project_type
    OR bea.distribution_rule = p.distribution_rule)
    AND be.calling_process in ('Revenue','Both')
    AND nvl(be.call_after_adj_flag, 'N') = 'Y'
    AND be.trx_independent_flag = 'Y'))
    Current system time is 10-AUG-2009 17:12:11
    ...0 projects processed for adjustments
    Current system time is 10-AUG-2009 17:12:11
    ...about to generate revenue for project id 196
    ...Fetching next project
    Current system time is 10-AUG-2009 17:12:11
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'PRE', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'PRE', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Leaving pauoarchn()
    ...no rows to process for this project.
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for project id 196, number 72DM000001
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    l_inv_by_btc_flag is ...N
    l_mcb_flag is ...Y
    l_rpc_code is ...GBP
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    ...Else loop 1
    ...else loop 2
    ...else loop 4
    ...else loop 5
    ...non_zero_amount
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    ...Else loop 1
    ...else loop 2
    ...else loop 4
    ...else loop 5
    ...non_zero_amount
    Leaving pauoarchn()
    Leaving pauoarchn()
    Leaving pauoarchn()
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for automatic events for project id 196, number 72DM000001 calling loc REG
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'POST-REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'POST-REG', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...generated revenue for automatic events for project id 196, number 72DM000001 calling loc POST-REG
    ...about to call pa_billing.bill_ext_driver( 196, 'Revenue', 'POST', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...exiting pa_billing.bill_ext_driver( 196, 'Revenue', 'POST', '2009/08/31', 714111 )
    Current system time is 10-AUG-2009 17:12:11
    ...Fetching next project
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...about to call AutoAccounting
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Entering pafvsu
    Allocating pafvcs structure
    Allocating memory for structure, fdfkai
    Allocating memory for structure, fdfkao
    Allocating flex input and output structure
    Assigning ptype
    Calling pagtfn
    Nullig out
    Setting everything that does not need to be allocated
    Allocating optional arrays
    Checking a_line_id
    Checking a_trans_ind
    Checking a_param_lst
    Checking a_extra_atr
    Allocating required array
    Allocating auto accounting elements
    Describing kff and control processing options
    Tune flex validation system options
    Allocate main cache
    Allocate additional memory for main cache
    Allocate ksv if needed
    Store pointer to text strings in last ksv element so we can free later
    val [¿], segval [00000000]
    val [00000000], segval [000000]
    val [000000], segval [7210OCOA01]
    val [7210OCOA01], segval [0000]
    val [0000], segval [72OXLFTG]
    val [72OXLFTG], segval [66101010]
    val [66101010], segval [7210]
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    ...returned from AutoAccounting
    ...about to update pe_expenditures_all for intercompany processing
    Current system time is 10-AUG-2009 17:12:11
    Entering parddl()
    ...setting error codes and bad code combination id to null
    ... Update draft revenues for marking autoaccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update draft revenues without generation error to normal state
    Current system time is 10-AUG-2009 17:12:11
    1 rows updated.
    ... Update pa_cust_event_rev_dist_lines for setting bad CCID to null
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_events for marking AutoAccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_events for setting revenue_distributed_flag to 'N'
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_cust_rev_dist_lines for setting bad CCID to null
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_expenditure_items_all for marking AutoAccounting error if any
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    ... Update pa_expenditure_items_all for setting revenue_distributed_flag to 'N'
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated.
    Leaving parddl()
    Current system time is 10-AUG-2009 17:12:11
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated with Generation error due to ccid=-1
    Current system time is 10-AUG-2009 17:12:11
    0 rows updated with Generation error PA_REV_GEN_ERROR
    Current system time is 10-AUG-2009 17:12:11
    ...1 projects processed for revenue generation
    Deleting automatic event for which revenue has generation error
    Current system time is 10-AUG-2009 17:12:11
    ...about to update proj summary funding amounts
    executing pa_billing.check_spf_amounts('B',196, , ) Calling check_spf_amounts...Inside the Single projects If
    Current system time is 10-AUG-2009 17:12:11
    ...about to generate reports
    SEL-SUC:72DM000001 4 1048 BP Exploration Operating DML 101 31-AUG-09 121659.83
    Current system time is 10-AUG-2009 17:12:12
    ...completed generating reports
    Process completed.
    0 rows deleted from distribution_warnings table.
    Start of log messages from FND_FILE
    Request id is :714111
    Before calling the insert event for top task_id :19839
    Parameters to the insert event API :
    Revenue amount is :12106.73
    Bill amount is :12106.73
    Project id is :196
    Event Type is :BILLING
    Top Task id is :19839
    organization id is :239
    completion date is :31-AUG-2009
    event description is :Financing Fee
    Return status after calling insert event is :0
    error message after calling insert event is :
    Before calling the insert event for top task_id :14612
    Parameters to the insert event API :
    Revenue amount is :109553.1
    Bill amount is :109553.1
    Project id is :196
    Event Type is :BILLING
    Top Task id is :14612
    organization id is :239
    completion date is :31-AUG-2009
    event description is :Expenditure
    Return status after calling insert event is :0
    error message after calling insert event is :
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PRINT   -------------
    Printing output file.
    Request ID : 714111
    Number of copies : 0
    Printer : noprint
    Finished executing request completion options.
    Concurrent request completed successfully
    Current system time is 10-AUG-2009 17:12:12
    ---------------------------------------------------------------------------

    Hi srini,
    For the request submitted via the application and for the request submitted by fnd_request.submit_request, argument4 has the same value 2009/08/31 00:00:00
    Thanks

  • Help me in defining Cost Allocation Flexfield

    hi friends,
    i am working on an implementation project...i am facing a typical requirement please help me to solve this issue.... let me explaing the issue...
    We are defining single business group....its has two operating units and two legal entities....the number of setof books also two... as for the benefit of accounting purpose...they have two accounting Key flexfields with two different Chart of Accounts(COA).... now how can i create a common and an single Cost allocation flexfiled whch should has the two Chart of account values.... Please help me to over come this issue.... this is an urgent issue... please address...
    Regards
    Narayanan

    Hi hasoub,
    Please check out our Adobe license management, discounts | Adobe Buying Programs  to find the solution that best fits your organization.
    Best,
    Sara

  • SQL Server Multiple JOINS with Table Value Function - query never ends

    I have a query with 4 joins using a table value function to get the data and when I execute it the query never ends.
    Issue Details 
    - Table value function 
        CREATE FUNCTION [dbo].[GetIndicator] 
          @indicator varchar(50),
          @refDate datetime
    RETURNS 
    TABLE
    AS
    RETURN
    SELECT
    T1.Id ,T1.ColINT_1, T1.ColNVARCHAR_1 collate DATABASE_DEFAULT as ColNVARCHAR_1 ,T1.ColNVARCHAR_2 ,T1.ColSMALLDATETIME_1, T1.ColDECIMAL_1, T1.ColDECIMAL_1
    FROM TABLE2 T2
    JOIN TABLE3 T3
    ON T2.COLFKT3 = T3.Id
    AND T3.ReferenceDate = @RefDate
    AND T3.State != 'Deleted'
    JOIN TABLE4 T4
    ON T2.COLFKT4 = T4.Id AND T4.Name=@indicator
    JOIN TABLE1 T1
    ON T2.COLFKT1=T1.Id
    - Query
        DECLARE @RefDate datetime
    SET @RefDate = '30 April 2014 23:59:59'
    SELECT DISTINCT OTHERTABLE.Id As Id
    FROM 
    GetIndicator('ID#1_0#INDICATOR_X',@RefDate) AS OTHERTABLE
    JOIN GetIndicator('ID#1_0#INDICATOR_Y',@RefDate) AS YTABLE  
    ON OTHERTABLE.SomeId=YTABLE.SomeId
    AND OTHERTABLE.DateOfEntry=YTABLE.DateOfEntry
    JOIN GetIndicator('ID#1_0#INDICATOR_Z',@RefDate) AS ZTABLE
    ON OTHERTABLE.SomeId=ZTABLE.SomeId
    AND OTHERTABLE.DateOfEntry=ZTABLE.DateOfEntry
    JOIN GetIndicator('ID#1_0#INDICATOR_W',@RefDate) AS WTABLE 
    ON OTHERTABLE.SomeId=WTABLE.SomeId
    AND OTHERTABLE.DateOfEntry=WTABLE.DateOfEntry
    JOIN GetIndicator('ID#1_0#INDICATOR_A',@RefDate) AS ATABLE  
    ON OTHERTABLE.SomeId=ATABLE.SomeId
    AND OTHERTABLE.DateOfEntry=ATABLE.DateOfEntry
    Other details:
    - SQL server version: 2008 R2
    - If I execute the table function code outside the query, with the same args, the execution time is less the 1s.
    - Each table function call return between 250 and 500 rows.

    Hi,
    Calling function in general is a costly query. And definitely joining with a function 5 times in not an efficient one.
    1. You can populate the results for all parameters in a CTE or table variable or temporary table and join (instead of funtion) for different parameters
    2. Looks like you want fetch the IDs falling to different indicators for the same @Refdate. You can try something like this
    WITH CTE
    AS
    SELECT
    T1.Id ,T1.ColINT_1, T1.ColNVARCHAR_1 collate DATABASE_DEFAULT as ColNVARCHAR_1 ,T1.ColNVARCHAR_2 ,T1.ColSMALLDATETIME_1, T1.ColDECIMAL_1, T1.ColDECIMAL_1, T4.Name
    FROM TABLE2 T2
    JOIN TABLE3 T3
    ON T2.COLFKT3 = T3.Id
    AND T3.ReferenceDate = @RefDate
    AND T3.State != 'Deleted'
    JOIN TABLE4 T4
    ON T2.COLFKT4 = T4.Id AND T4.Name=@indicator
    JOIN TABLE1 T1
    ON T2.COLFKT1=T1.Id
    SELECT * FROM CTE WHERE Name = 'ID#1_0#INDICATOR_X' AND Name = 'ID#1_0#INDICATOR_Y' AND Name = 'ID#1_0#INDICATOR_Z' AND Name = 'ID#1_0#INDICATOR_W' AND Name = 'ID#1_0#INDICATOR_A' AND ReferenceDate = @RefDate.
    Or you can even simplify more depends on your requirement.
    Regards,
    Brindha.

  • Issue with the value set

    Hi friends,
    am trying to do a percentage calculation from two value sets
    like
    select round((to_number(:$FLEX$.PROP_BONUS)*100)/(12*to_number(:$FLEX$.XX_SAL)),2) FROM DUAL
    this is giving me error ...
    those two are number data type value sets.. and am using this in self service pages
    the error says like this
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: select fnd_number.number_to_canonical(round((to_number(:$FLEX$.PROP_BONUS)*100)/(12*to_number(:$FLEX$.XX_SAL)),2)) FLEX_VALUE
    , to_char(round((to_number(:$FLEX$.PROP_BONUS)*100)/(12*to_number(:$FLEX$.XX_SAL)),2)) FLEX_DISPLAY
    from DUAL
    where (1 = 1)
    and 'Y' = 'Y'
    and nvl(fnd_date.canonical_to_date(:1), trunc(SysDate))
    between nvl(trunc(to_date(null)), nvl(fnd_date.canonical_to_date(:2), trunc(SysDate)))
    and nvl(trunc(to_date(null)), nvl(fnd_date.canonical_to_date(:3), trunc(SysDate)))
    and to_char(round((to_number(:$FLEX$.PROP_BONUS)*100)/(12*to_number(:$FLEX$.XX_SAL)),2)) like :L1
    order by FLEX_DISPLAY
    java.sql.SQLException: ORA-00911: invalid character
    can some one suggest me a solution please

    Please see if (Unable To Use $FLEX$ In Table Name Field While Creating Value Set [ID 1071197.1]) and (Compilation Error ORA-00911 Occurred After Adding To Descriptive Flexfield [ID 445246.1]) help.
    Thanks,
    Hussein

  • How to change table value set using FND_LOAD

    Hi ,
    I need to change my existing " table valueset " tablename .
    As i know we cont change it from front end if it is created once. but i am trying to create same value set in other instance and uploading it using FND_LOAD .
    Is it Possible ?
    IF yes please guide ?
    I feel greate if any one helps me.
    Regards ,
    Azam.

    Hi,
    You could use FNDLOAD to download the values, and edit the ldt file before uploading it back using FNDLOAD.
    Search My Oracle Support for "FNDLOAD afffload.lct", you should get couple of hits which should be helpful.
    Note: 252853.1 - 11i AOL : How to Load Value Set Values When Using Fndload To Load A Concurrent Program
    Note: 274528.1 - How To Download Single Context Using FNDLOAD For Descriptive Flexfield
    Regards,
    Hussein

  • Table Value Set.

    Hi All,
    1)
    I created a Table type value set for concurrent program.
    and i want a add one more value to value set, for that im using union clause in Where/order by Field..
    ex code:
    Where/order by:
    where 1=1
    union
    select 'ALL' name from per_all_positions;
    here name is alias. In lov it is not showing any value.
    2) For this i created a custom view .
    ex code:
    create or replace view XXCS_POPUP_VAL_V as
    (select 'ALL' fsm from per_all_positions
    union
    select name fsm from per_all_positions)
    order by fsm
    I created value set based on custom view , but it is not showing 'ALL' in LOV.
    I want include 'ALL' value in LOV.
    How can i achieve this..
    Thanx in advance..

    I'm not sure how come first one with union in where clause is working for you.
    Check the link ORA-00907 Missing Right Parenthesis in Value Set
    Also I'm not sure why you want to select entire table just to add 'ALL'.
    Try the followingCREATE OR REPLACE VIEW xxcs_popup_val_v AS
    SELECT 'ALL' fsm FROM dual
    UNION
    SELECT name fsm FROM per_all_positions;No need of order by when you are using union, as you want to order on first column.
    What is the ID and value column you have selected in the Value Set?
    By
    Vamsi

  • Table Value Set Definition - Fetch Error

    I am trying to use a TABLE Validated Value Set based on the value set used in the Accounting Key Flexfield using the following query. When you run the test button in the DFF Table definition, it says that it is succesfully tested.
    SELECT FLEX_VALUE, DESCRIPTION
    FROM FND_FLEX_VALUES_VL
    WHERE FLEX_VALUE_SET_ID=1010305
    order by flex_value
    But when I go to the Oracle form to the respective DFF, it throws the below long error.
    APP-FND-01564: ORACLE error 24345 in fdlget
    Cause: fdlget failed due to ORA-24345: A Truncation or null fetch error occurred.
    The SQL statement being executed at the time of the error was: SELECT FLEX_VALUE, FLEX_VALUE VALUE, DESCRIPTION DESCRIPTION, NVL('N','N'), NVL(TO_NUMBER(NULL),-1), NULL, NVL('Y','Y')
    Can anybody help me, how to get this resolved.
    Regards,

    R12 problem - check the definition of your value set being used. If it is defined as List type "List of Values", then try changing to "Long List of Values". Save and try again. If you don't get the error again, then you probably have a column in the value set that is shorter than the defined table size. For example, description is 50 characters long in the value set, but the table column is 240 characters. If you have data that is longer than 50 characters, you will get this error. But if you change the List type to "Long List of Values", it won't throw the error. I've been trying to get Oracle to figure out the problem, but they just want us to increase the size of the value sets.
    Good luck and let me know if this works for you.

  • Automatically populate a Descriptive FlexField with Default Value

    I have 2 Descriptive flexfield segments defined, one is "Start Date" using value set "LS_START_DATE" and the other segment is "End Date" using value set "LS_END_DATE".
    Now when I enter the "Start Date", I want the "End Date" to be populated automatically with the value of "Start Date + 365 days".
    For example:
    If I enter "Start Date" = 25-May-2010
    Then "End Date" should be automatically populated with the value "25-May-2011" (i.e., Start Date + 1 year)
    Is that possible ?
    I tried defining "End Date" segment with "Default Type" as "SQL Statement" and Default Value as "SELECT :$FLEX$.Start Date+365 from dual" , but it's not working.
    Can someone please help ?
    Prashanthi

    I did, the value set created for this segment "Start Date" is "LS_START_DATE" and I changed the sql statement in Default Value to "SELECT :$FLEX$.LS_START_DATE+365 from dual" , but still it is not working ....no luck.
    Prashanthi

Maybe you are looking for

  • How can I add new values only to a column of a spreadsheet?

    I have three "while loops" that are executed in parallel, two generate values and the third while loop write the values in a spreadsheet. The run time of each while loop is different, to synchronize the three while loops I use a "Wait Until Next ms M

  • How can I get a Photoshop CC in English?

    I live in Norway, and just started the trial version to check the CC versions out. Lightroom comes in english by default, but Photoshop only comes in norwegian. is it not possible to get it in English?

  • HELP ME lock problem

    OK... i got my phone locked up and i dont know how to unlock it... the i phone says "iphone disabled,,,connect to itunes".. so i tried that but itunes says it wont load up unless i can get the password . PS.the lock screen goes directly to emergency

  • Buying from Appstore for my company

    Hello I have an issue: I need to make a purchase from Appstore for my company but I only have my own, personal credit card. Can I make the purchase using my own credit card, but have the company selling the software make the invoice for my company? T

  • My pc is used; the previous owner's homepage is still being referred to by firefox. I am trying to reinstall for myself. How do I do this?

    My boyfriend gave me his pc, an e-machine with WindowsXP, and using IE7 I believe. Then, I purchased an Android cellphone, and wanted to run Mozilla Firefox browser to link both the pc and my cell together. For some reason, this doesn't work.