How to change a Query in a DataProvider

Hi.
I am trying to chante DataProvider´s Query during runtime. I have tried this:
Did anyone could help me?
Thanks

Hi.
I have tried your suggestion but i got the same error.
Something like this: "The filter´s item RADIOGROUP_1 specified a not valid characteristc 41I6LBPF9JKHCC5YLXH9LXC0Z"
This characteristc (41I6LBPF9JKHCC5YLXH9LXC0Z) is set to the radiogroup during the development of the template, but when i use the following command:
It seems like system get lost when i change the DataProvider´s Query to one which not have that characteristic. That command should change the Query and the RadioGroup´s IOBJNM, but seems that only the Qurey is changed.
Do you have any idea how to solve this problem?
Thanks

Similar Messages

  • How to change the query ?

    Gurus,
    Please clarify this
    Select ils.item,(nvl(sum(decode(tdh.loc_type,'S',decode(tdh.tran_code, 1,tdh.units,0),
    'W',decode(tdh.tran_code,30,0,31,0,32, tdh.units,33, tdh.units,37,0,38, tdh.units,20,0,1,0))),0))"result"
    from tran_data_history tdh, item_loc_soh ils
    where tdh.item = ils.item
    and ils.item in('100002513','100002484')
    and trunc(tdh.TRAN_DATE)
    between (*select first_date from (select item,min(trunc(first_received)) first_date From Item_loc_soh*
    where item in('100002513','100002484') and first_received is not null
    group by item ))
    and trunc(sysdate)
    group by ils.item
    Problem with this query is, the block mentioned in BOLD is returning two rows, and I am writing between and clause .. since the query in bold is returning more than one row, it is throwing error stating that single query returns more than one row .. Requirement is, whatever date which is returned with value 100002513 should be compared with sysdate, and other value 100002484 should be compared with sysdate .. Irrespective of number of items (whether 1 or more than 1) should simultaneously be compared with sysdate
    How to change my query
    Regards

    Inner query
    Select First_Date From (Select Item, Min(Trunc(First_Received)) First_Date
                                        From Item_Loc_Soh *
                                        Where Item In ('100002513', '100002484')
                                        And First_Received Is Not Null
                                        Group By Item)
    this will return 2 rows for each of the item id 2513 and 2484 because you write query for this 2 rows
    and select min date
    which means
    item id 2513  min date
    item id 2482  min date
    if you want to compare just a date to sysdate then do it directly,
    Select Ils.Item,
           (Nvl(Sum(Decode(Tdh.Loc_Type,
                           'S',
                           Decode(Tdh.Tran_Code, 1, Tdh.Units, 0),
                           'W',
                           Decode(Tdh.Tran_Code,
                                  30,
                                  0,
                                  31,
                                  0,
                                  32,
                                  Tdh.Units,
                                  33,
                                  Tdh.Units,
                                  37,
                                  0,
                                  38,
                                  Tdh.Units,
                                  20,
                                  0,
                                  1,
                                  0))),
                0)) "result"
      From Tran_Data_History Tdh, Item_Loc_Soh Ils
    Where Tdh.Item = Ils.Item
       And Ils.Item In ('100002513', '100002484')
       And Trunc(First_Received)  = Sysdate;
    however i dont understand importance of Tdh.Tran_Date and which date you exactly want to compare
    hope this helps,
    if not plz clarify more on the questionsEdited by: Nicloei W on Sep 24, 2008 11:51 PM

  • HOW TO CHANGE SQL QUERY TO GET SPECIFIC RESULT

    I HAVE FOLLOWING QUERY AND ITS FUNCTIONING BUT I WANT ALL THOSE RECORD SHOULD BE DISPLADE WICH HAVE NO TRANSACTION IN SALES ANS SALES RETURN WHILE RETREVING DATA FROM DATABASE.
    I TRIED TO USE + OPERATOR BUT I DON'T KNOW HOW TO CHANGE THE QUERY TO GET THE RESULT
    MAIN TABLE IS BEING USED TO FETCH RECORD
    SALES_HEADER,SALES_DETAIL
    SALES_HEADERR,SALES_DETAILR
    STOCK_REG
    AND THE QUERY IS
    select s.item_code,S.DESCR,s.GRAND_TOTAL,
    sum(decode(d.dayno,01,NVL(S.QTY,0),0)) DAY1,
    sum(decode(d.dayno,02,NVL(S.QTY,0),0)) DAY2,
    sum(decode(d.dayno,03,NVL(S.QTY,0),0)) DAY3,
    sum(decode(d.dayno,04,NVL(S.QTY,0),0)) DAY4,
    sum(decode(d.dayno,05,NVL(S.QTY,0),0)) DAY5,
    sum(decode(d.dayno,06,NVL(S.QTY,0),0)) DAY6,
    sum(decode(d.dayno,07,NVL(S.QTY,0),0)) DAY7,
    sum(decode(d.dayno,08,NVL(S.QTY,0),0)) DAY8,
    sum(decode(d.dayno,09,NVL(S.QTY,0),0)) DAY9,
    sum(decode(d.dayno,10,NVL(S.QTY,0),0)) DAY10,
    sum(decode(d.dayno,11,NVL(S.QTY,0),0)) DAY11,
    sum(decode(d.dayno,12,NVL(S.QTY,0),0)) DAY12,
    sum(decode(d.dayno,13,NVL(S.QTY,0),0)) DAY13,
    sum(decode(d.dayno,14,NVL(S.QTY,0),0)) DAY14,
    sum(decode(d.dayno,15,NVL(S.QTY,0),0)) DAY15,
    sum(decode(d.dayno,16,NVL(S.QTY,0),0)) DAY16,
    sum(decode(d.dayno,17,NVL(S.QTY,0),0)) DAY17,
    sum(decode(d.dayno,18,NVL(S.QTY,0),0)) DAY18,
    sum(decode(d.dayno,19,NVL(S.QTY,0),0)) DAY19,
    sum(decode(d.dayno,20,NVL(S.QTY,0),0)) DAY20,
    sum(decode(d.dayno,21,NVL(S.QTY,0),0)) DAY21,
    sum(decode(d.dayno,22,NVL(S.QTY,0),0)) DAY22,
    sum(decode(d.dayno,23,NVL(S.QTY,0),0)) DAY23,
    sum(decode(d.dayno,24,NVL(S.QTY,0),0)) DAY24,
    sum(decode(d.dayno,25,NVL(S.QTY,0),0)) DAY25,
    sum(decode(d.dayno,26,NVL(S.QTY,0),0)) DAY26,
    sum(decode(d.dayno,27,NVL(S.QTY,0),0)) DAY27,
    sum(decode(d.dayno,28,NVL(S.QTY,0),0)) DAY28,
    sum(decode(d.dayno,29,NVL(S.QTY,0),0)) DAY29,
    sum(decode(d.dayno,30,NVL(S.QTY,0),0)) DAY30,
    sum(decode(d.dayno,31,NVL(S.QTY,0),0)) DAY31,
    sum(S.qty) TU
    FROM
    (select nvl(sales_detail.qty+sales_detail.bonus,0) as qty,
    sales_detail.item_code AS ITEM_CODE,
    stock_reg.descr AS descr,
    s_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
    SALES_DETAIL,SALES_HEADER,STOCK_REG
    WHERE SALES_DETAIL.S_ID = SALES_HEADER.S_ID AND
    SALES_DETAIL.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
    STOCK_REG.COMCODE='C1'
    UNION all
    select -1*nvl(sales_detailR.qty+sales_detailR.bonus,0) as qty,
    sales_detailR.item_code AS ITEM_CODE,
    stock_reg.descr AS descr,
    RETURN_date as sale_date,stock_reg.GRAND_TOTAL AS GRAND_TOTAL FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.ITEM_CODE = STOCK_REG.ITEM_CODE(+) AND
    STOCK_REG.COMCODE='C1') S,
    (select level as dayno
    from dual
    connect by level <= 31) d
    where d.dayno = to_char(s.sALE_date, 'DD') AND TO_DATE(S.SALE_DATE) BETWEEN '&FROMDATE' AND '&TODATE'
    GROUP BY S.ITEM_CODE,S.DESCR,S.GRAND_TOTAL

    well my query running successfully just the quesion was that i wanted to bring some changes in the query to retrieve the complete record which has no transaction in sales
    for exmple
    if i write the quey
    select dept.deptno,sum(sal) from emp,dept
    where dept.deptno = emp.deptno
    group by dept.deptno
    the recult comes as
    DEPTNO SUM(SAL)
    10 8750
    20 10875
    30 9400
    though there is another deptno which is deptno no 40
    have no sal
    and when i use this query
    select dept.deptno,sum(sal) from emp,dept
    where dept.deptno = emp.deptno(+)
    group by dept.deptno
    it shows the dept no 40 also
    DEPTNO SUM(SAL)
    10 8750
    20 10875
    30 9400
    40
    so to get this i posted query which was to long to understand easily.
    i accept that i sholud post short query to make other understand
    so check out this
    select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
    FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE
    AND RETURN_DATE = '01-APR-08'
    GROUP BY STOCK_rEG.item_code
    ORDER BY TO_NUMBER(ITEM_CODE) ASC
    when i execute this query i get the following result
    ITEM_CODE QTY
    84 2
    102 3
    108 3
    116 6
    166 3
    170 3
    thoug there is other items are aalso available in stock which transaction
    yet not been done or not been sold out/
    so when i use the outer join i get the same result
    select STOCK_rEG.item_code AS ITEM_CODE,SUM(qty) as qty
    FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE(+) = STOCK_REG.STOCKCODE
    AND RETURN_DATE = '01-APR-08'
    GROUP BY STOCK_rEG.item_code
    ORDER BY TO_NUMBER(ITEM_CODE) ASC
    ITEM_CODE QTY
    84 2
    102 3
    108 3
    116 6
    166 3
    170 3
    hope i tried to make u understand on better way

  • BEx: How to change a Query Variable that is not visible in Filters List?

    Hello Experts,
    Good day, I'm currently editing an old query, I am changing the Query Variables with new ones, but I found one variable that I cannot replace.
    Please see the screenshot below, in the Query Properties Window [Variable Sequence Tab (right side of picture)] the Variable that I am trying to replace (Unit) is visible. But when I look for the variable in the "Filter Tab" (left side of picture) under Characteristic Restrictions, it doesn't exist in the list.
    How can I find this Variable and replace it with a new one?
    Other reports are still using this variable so it will impact the other reports if I simply edit the variable. So I need to replace it with a new variable instead.
    Thank you for your time.

    Hi,
            SInce you are searching for a variable for Unit, look into below screenshot and navigate to the variables.
    First click on drop down and select 'Entry for variable' then you will get lisl (after you click on drop down in 'Target Unit' drop down option.
    Normally these type of variable called 'Formula Variable' try editing any of the formula and locate the option as shown below,
    Hope it helps! don't forget to update the final solution and mark the correct/helpful answers.
    Remember it will help others to find the solution and motivate the members to answer your question.
    Thanks,
    Umashankar

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • How to change the query of detailVO,

    Hi,
    I have 2 VOs, say HeaderVO and LinesVO, these VOs are used to create a view link - HeaderToLinesVL - HeaderVO is Master VO and LinesVO is DetailVO. These VOs and VL are used in HGrid. Depending on the search criteria entered by user I have to change the query of HeaderVO and LinesVO. I am able to change query of HeaderVO using setQuery, but when setQuery used on LinesVO, it is throwing an exception saying Query can't be changed because it is detail VO. Is there any other way to change the query. Or any other idea to implement this functionality.
    Thanks
    Shaneed

    Hi,
    I have 2 VOs, say HeaderVO and LinesVO, these VOs are used to create a view link - HeaderToLinesVL - HeaderVO is Master VO and LinesVO is DetailVO. These VOs and VL are used in HGrid. Depending on the search criteria entered by user I have to change the query of HeaderVO and LinesVO. I am able to change query of HeaderVO using setQuery, but when setQuery used on LinesVO, it is throwing an exception saying Query can't be changed because it is detail VO. Is there any other way to change the query. Or any other idea to implement this functionality.
    Thanks
    Shaneed

  • How to change VO query dynamically

    Hi,
    Iam trying to change the VO query dynamically. My req. is I have 6 columns in a header page 3 columns(default single column) for sorting purpose and another 3 columns(default single column) for data querying purpose.
    al these are in one view so I have created one VO.
    Sorting Searching
    A A
    B B
    C C
    When I give any values in Sorting and hit submit button VO query should change dynamically.
    I have searched older post regarding this.
    My query is some thing like this
    SELECT * from cust_table where a = NVL(:1 ,a)
    UNION
    SELECT * from cust_table where a<> NVL(:1 ,a)
    order by a
    Iam trying to pas the below part dynamicaly in my AM method
    vo.setWherecaluse("where a = NVL(:1 ,a)
    UNION
    SELECT * from cust_table where a<> NVL(:1 ,a)
    order by a ")
    and trying to pass the params to that query. But it is not working.Giving error "Bind variable could not find"
    Can any one suggest how to solve the issue.
    Thanks,
    Mahesh

    Hello Ajay,
    THanks for your response.
    My vo query is select col1,col2,col3,col4,col5,col6 from cust_table;
    and and changing vo.setwhereclause dynamically based on different scenerios.
    in one scenerio i need my query to be some thing like
    SELECT col1,col2,col3,col4,col5,col6 from cust_table where a = NVL(:1 ,a)
    UNION
    SELECT col1,col2,col3,col4,col5,col6 from cust_table where a <> NVL(:1 ,a)
    order by a
    so can i concatenate my vo.setwhereclause like *"where a = NVL(:1 ,a) UNION SELECT col1,col2,col3,col4,col5,col6 from cust_table where a NVL(:2 ,a) order by a"*
    in the setwhereclause iam setting bind variables is this method correct? Hope it is clear pleaselet me know if it is not clear I will explain in detail.
    Thanks,

  • How to change a query created in other id into my id......

    first they have given me one id, and asked me to develop a query. i did it. now i got my id. now i want that query to be on my name.? how can i do it?( i have saved that query as local object when i created it).

    Hi,
    Open the query & save as ( change the description & technical Name).
    Regards
    CSM Reddy

  • Need help how to change LOV query

    Hi All,
    Can some one help me how to use the LOV Query based on responsibility (I am using form personalization)
    When the user logs in with XX_Payables Super user with say (Responsibility id =500) then the LOV should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    but if the user logs in with any other responsibilits then the lov should be
    Select BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    from CE_BANK_ACCOUNTS ba
    where BA.multi_currency_allowed_flag = 'Y'
    step 1
    I have created a built in builtin type : Create Record group from query
    Arugument : Select statement
    Group name : XX_Group
    step 2
    Property
    Object type : LOV
    target object : PAY_ACTIVE_BANK_ACCOUNTS
    property name : Group name
    value XX_GROUP
    Using this method i am able to select only one query
    How can i control this based on responsibility.
    Appreciate if some one can help me to resolve this issue.
    Regards,
    Rajini

    Thanks for your reply, I tried to use this query but i am getting error as FRM-41076 Error populating group and FRM-41072 Cannot create group
    but if i use any one of the query or either of the query it works fine. but i dont see any issues when i run only any one of the query in argument in form personalization. Union all is returing rows in database.
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name = 'XX PAYABLES SUPER USER'
    AND CBB.bank_name_alt = 'Head office bank'
    UNION ALL
    SELECT BA.bank_account_name,
    BA.bank_account_num,
    BA.bank_Account_id,
    BA.currency_code bank_currency_code,
    CBAU.bank_acct_use_id ,
    BA.multi_currency_allowed_flag bank_multi_currency_flag,
    BA.zero_amount_allowed bank_zero_amounts_allowed,
    BA.account_owner_org_id legal_entity_id,
    CBB.bank_name,
    CBB.bank_branch_name
    FROM
    CE_BANK_ACCOUNTS BA,
    CE_BANK_BRANCHES_V CBB,
    CE_BANK_ACCT_USES_OU_V CBAU
    WHERE ((BA.multi_currency_allowed_flag = 'Y' AND
    (BA.currency_code = :pay_sum_folder.functional_currency_code or
    BA.currency_code = :parameter.pay_in_full_currency_code )) or
    BA.currency_code = nvl( :parameter.pay_in_full_currency_code, BA.currency_code))
    AND CBAU.BANK_ACCOUNT_ID = BA.BANK_ACCOUNT_ID
    AND sysdate between TRUNC(CBB.start_date) and nvl(TRUNC(CBB.end_date), sysdate + 1)
    AND CBB.branch_party_id = BA.bank_branch_id
    AND SYSDATE < NVL(BA.END_DATE,SYSDATE+1)
    AND BA.ACCOUNT_CLASSIFICATION = 'INTERNAL'
    AND CBAU.ap_use_enable_flag = 'Y'
    AND CBAU.org_id = :pay_sum_folder.org_id
    AND NVL(BA.netting_acct_flag, 'N') <> 'Y'
    AND fnd_global.resp_name != 'XX PAYABLES SUPER USER'

  • How can change the query where clause values in formatted search

    Hi
    I have a formatted search with the below sql
    Select ItemCode,ItemName from OITM
    where ItemCode like 'FX%'
    how can I change 'FX%' to another value
    I tried to make it as paramter
    where ItemCode like $[ItemCode]
    but I am receiving an error
    sincerely yours
    Riade Asleh

    Try this:
    Select ItemCode,ItemName from OITM
    where ItemCode = $[$5.0.0]
    5 = Item number of form (On item master data 5 is item-number)
    0 = Column of item... since item 5 is no matrix 0 shoul be used.
    0 = Casting type (0 is default, but int, string and date is possible)

  • How to change the reference of a Workbook to a Query

    I have a Query Q1 and I have a workbook W1 for this query in 3.5,  I copied query Q1 to a new Query Q2,  and copied workbook W1 to a new workbook W2. (using RSZC)
    Now I have Queries Q1 and Q2 and Workbooks W1 and W2. But as the workbook W2 is a copy of W1, it still has the reference to query Q1. Is there any way to change the reference of a workbook to a query ?
    My requirement is, workbook W2 should refer to query Q2.
    Appretiate your help.
    Regards,
    R. Vodnala

    Go to design mode of the second workbook and change the query using the edit option to Q2 then your workbook W2 will refer to query Q2
    Just to get the idea go through this link here it is shown how to change the query.
    https://wiki.sdn.sap.com/wiki/display/BI/Issue%20with%20Migrating%20BEx%20Query%20and%20Workbook

  • How to change the QueryRowSet in early access 2?

    hi everybody,
    I do know how to change the query but I want to add a condition on a variable got from a text field, and use by button action.
    I don't know where to initialize this variable exactly?
    provided that the query is created in the session bean.
    please, reply as soon as possible.
    thanx.

    Hi,
    The tutorials under the section Access Databases will answer your question. In particular the tutorial "Using Databound Components to Access Databases". These tutorials can be found at:
    http://developers.sun.com/prodtech/javatools/jscreator/ea/jsc2/learning/tutorials/index.html
    Please post any further Creator 2 EA 2 related queries at:
    https://feedbackprograms.sun.com/login.html
    Cheers
    Giri

  • Change a query variant using a program for APD

    Hello everyone,
    Some background:
    We have a complex reporting based on calculated key figures (CKF). However, the business rules do change over time, and the formulas for CKF get outdated. So the business meaning of CKF remains the same, but the way it gets calculated - changes.
    Yesterday CKF "A" = B + C
    Today CKF "A" = B + D - F
    Since the customer requires reporting for the former periods, maintaining several CKF of the same business meaning but calculated differently for each period becomes a problem.
    Instead of having several versions of CKF "A", we decided to use APD, to periodically run the query with valid CKF, save the query results to transactional ods, then move it to another infocube. Now we will have the infocube with figures and dates, and the customer needs to maintain just one CKF "A".
    After trying this out we've encountered following issue:
    Since the query will run periodically we must use a time period filter (in fact - variable on a time characteristic - APD is not working with filter) to select CKF valid for this month for example.
    The query in APD can work with variables only via query variants.
    Now, the question is how to change the query variant automatically?
    We can not force the customer to create new query variants each month for dozens of reports.
    We plan to integrate APD in the process chain (although we haven't check how it works), where the query variant will be changed using a program.
    so please advice:
    1) is there any function module to change query variants in the background
    2) which tables contain the query variant, so we can change it using abap
    3) may be you can suggest other options to make it work
    thank you
    Message was edited by:
            Northern

    Hi,
    here it is.
    write this code in SE38.
    REPORT  ZDATE_CAL..
    DATA: itab_tvarvc like tvarvc,
          l_date like sy-datum,
          l_monthyear_low type /BI0/OICALMONTH,
          l_monthyear_high type /BI0/OICALMONTH,
          l_day(2) type c,
          l_month(2) type c,
          l_year(4) type c,
          l_mandt(3) TYPE c VALUE '010',
          l_type(1) type c VALUE 'S',
          l_numb(4) type N value '0000'.
          l_day = sy-datum+6(2).
          l_month = sy-datum+4(2).
          l_year = sy-datum+0(4).
          concatenate l_day l_month l_year into l_date.
          concatenate '01' l_year into l_monthyear_low.
          concatenate l_month l_year into l_monthyear_high.
    variable for current month interval
    itab_tvarvc-mandt = l_mandt.
    itab_tvarvc-name  = 'ZDATE_INV'.
    itab_tvarvc-type  = l_type.
    itab_tvarvc-numb  = l_numb.
    itab_tvarvc-sign  = 'I'.
    itab_tvarvc-opti  = 'BT'.
    itab_tvarvc-low   = l_monthyear_low.
    itab_tvarvc-high  = l_monthyear_high.
    update TVARVC from itab_tvarvc.
    This code will always maintain the entry for the variable 'ZDATE_INV' as range from the start of month till current month.
    you can modify it store anything yuou want.
    Now when creating the variant by clicking the create variant option when running the query.
    you have the option in the "selection variable" column here you will find only TVARVC table as option select it and then in "name of variable" use the Z variable you have just created.
    This will automatically pick the current value for the variant for that variable.
    So anytime the variant is used in any of the scheduling it will pick the inout from here.
    make sure that the variable for time interval is of same type as that of the entry in the TVARVC table.
    That if it is of type calmonth then TVARVC table should have variable entry of type calmonth.
    thanks

  • Need to change my query

    I have a query like this
    select * from table1
    where entitlement in (select sno from table2 where )----------1
    and category in (select sno from table2 where)----------2
    and clazz in (select sno from table2 where)----------3
    and subclass in (select sno from table2 where)----------4
    the inner select statements will return either a single row or no rows at all
    when it returns no rows i want to equade the outer where clause filter column to NULL.
    i.e example
    when the inner select return no row for the line marked -----1
    the query should be
    select * from table1
    where entitlement is null ---------------------------------------------------------------------------------------> i want some thing like this if the inner select doesnt return any rows
    and category in (select sno from table2 where)----------2
    and clazz in (select sno from table2 where)----------3
    and subclass in (select sno from table2 where)----------4
    i tried to use decode statement in side the inner select but when it returns null i have to use "is " clause in the outer where condition
    when it returns a value i cannot use "is" clause
    how to change the query
    regards
    raj

    Rewrite your example as a couple of 'create table' statements and a handful of insert statements. Then use the "code" tags (see footnote) to make and SQL readable (see code samples from other posters above) and someone may decide that it's worth spending a little time to help you.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to change the graph results selections in a query?

    Hi,
    i want to change the graphical representaions of a workbook which were based on the past year 2007
    now i want to have the results for the year 2008. how the year selections can be made for graphical results?
    Raj

    If your table and graph are using the same query as the dataprovider then selection made for the table will be reflected for graph as well.

Maybe you are looking for