Input query with dynamic actual & forecast values by month per year

Hello,
I am working on a Input ready query for a forecasting application which shows both actuals and forecast numbers and the user will revise the forecast numbers by month
Requirement: I want to build a Input query for monthly forecasting for the current year. It will be dynamic rolling of months with actuals & forecast data.
E.g. My report has 12 months for the current year
and if run the report in May, the months before May has to show the actuals and the months after May has to show the old forecast data so that the user will revise the numbers again in each month and save the data to the real time cube.
Jan.Feb.Mar.Apr.May.Jun.Jul.Aug.Sept.Nov.Dec
Act Act  Act Act Act  Old frcst for the remaining months
  user will revise forecast for these months
So, i am able to create Input query with all restricted key figures( plan kf has change mode set to change, actual kf are not set change) and calculate key figures and all the logic is done on dynamically moving/rolling the data based on the input month of the year.
But the problem is that i am using cal kf to dynamically roll months, i was not able to set the change option for the cal kf.
So, how can i make sure that the dynamically changed plan months will open for entering forecast and the actuals months not to change?
Do you guys have any better solutions in implementing it?
I really appreciate it your input....:)
Thanks,
Srini

Hi,
Please look at the following DOC which may be useful to you and if so please grant me point.
Regards,
SUbha'
Input-Ready Query
Use
You use input-ready queries to create applications for manual planning. These can range from simple data entry scenarios to complex planning applications.
Integration
You define a query that you want to use for manual planning in the BEx Query Designer (see Defining New Queries).
In the Web Application Designer or the BEx Analyzer, you can combine the input-ready queries with other queries and planning functions to create complex planning applications.
Prerequisites
You can define an input-ready query on any of the following InfoProviders:
●     Aggregation levels (see Aggregation Levels)
●     MultiProviders that include at least one simple aggregation level
The aggregation levels are created in the planning modeler; MultiProviders are defined in the modeling functional area of the Data Warehousing Workbench.
Features
Definition of an Input-Ready Query
Once you have defined a query on an InfoProvider, you see the Planning tab page under the Properties of structural components (for example, in key figures or restricted key figures). The options provided there allow you to determine which structural components of an input-ready query are to be input ready at runtime and which are not. With structural components that are not input ready, you can also determine whether these components are viewed as reference data or are just protected against manual entry.
For the structural components, you also have the following options:
Input readiness of structural components of a query
Option
Description
Not input ready (reference data)
If they are being used as reference data, the structural components are not protected by data locks to ensure exclusive access for one user because this data serves as a reference for many users.
This is the default setting.
Not input ready (no reference data)
If you want to protect structural components against manual entries but allow changes by planning functions, you can use locks to protect this data for one particular user. In this way you can ensure that the planning function works with the displayed data only and not with data that has been changed by other users.
Input ready
You can also determine whether an input ready query is to be started in change mode or in display mode. You find this property in the Query Properties on the Planning tab page. If there is at least one input-ready query component, the query (as long as it has not been determined otherwise) is started in display mode.
In BI applications that use input ready queries as data providers, you can enter data manually at runtime. For more information, see Performing Manual Planning and Creation of Planning Applications.
Example
You want to create an input-ready query for manual planning for a plan-actual comparison of revenues for a set of products. You want the plan data in a real-time-enabled InfoCube and the actual data in a standard InfoCube.
       1.      Create a MultiProvider that includes the InfoCubes for the plan and actual data.
       2.      Define an aggregation level on the MultiProvider which contains the characteristic Product and the key figure Revenue.
       3.      On the aggregation level, create two restricted key figures Plan Revenue and Actual Revenue. For restriction, choose the characteristic 0INFOPROV and restrict it to the plan or actual InfoCube.
       4.      Add the restricted key figures to the key figure structure. Insert Product into the rows. For Plan Revenue, choose Input Ready for the input-readiness option. For Actual Revenue, choose the option Not Input Ready (Reference Data).
       5.      In the query properties, set the indicator that determines whether the queries are started in display or change mode as required.
Example of an input-ready query
Product
Plan Revenue
Actual Revenue
P01
20
P02
30
If you want to keep actual and plan data in a real-time enabled InfoCube, you do not require a MultiProvider for the task described above. Create an aggregation level on the InfoCube and define the input-ready query for the aggregation level. In the example above, a version characteristic acts as the InfoProvider. Create restricted key figures with the plan or actual version and proceed as in the previous example.

Similar Messages

  • Input Query with blanks when we press transfer values option

    I have an input query with 12 restricted key figures, but when I enter data and press on 'Transfer Values' or 'Save Values', the cells are blanked out (i.e. the values dissapear) and the data is not updated into the cube. I have done the following:
    In Query Designer, I have checked the attribute 'Start Query in Change Mode' and
    For all restricted key figures that needs to be planned, I have marked as 'Data can be changed using user entries and planning functions...'
    Can you please let me know your thoughts around this.
    Thanks,
    Srini

    Mayank,
    I have 10 characterstics(cost center, cost element, cost type, fiscal year period,fiscal year, version, value type, posting period, detail valye type, currency type+1kf(0amount)) in my aggregation level.
    I have created 12 rkf for each month with the following restrictions
    Plan rkf (sub rkf) with restrictions to
    fiscal year(variable), inforprovider-real time cube, value type 20, kf-0amount,
    jan plan rkf.....dec plan rkf has
    kf--Plan rkf(sub rkf) +  posting period 1...12(one for each month),
    And i have created an input query with the following fields
    unders rows
    Cost type, cost element
    under Columns
    Jan paln rkf to Dec plan rkf
    filters for controlling area EA
    I have change the query defination to "start query change mode" and also set all the rkf properties to "change by user enteries and/or planning options"
    So, is there anything i am missing here?
    Do i have to all characterstics of my aggregation level in my input query? or do i have to restrct my rkf to any curreny/unit fields? Please shed some light in here....:)
    Thanks for your help...
    Srini

  • Creating Query with dynamic columns to show results

    Hi experts,
    I need to know how to create a query with dynamic columns. Meaning, I don't want to create a query with fixed columns representing the 12 periods of the fiscal year to show me actuals as the fiscal year proceeds.
    For example, if I am currently in the middle of period 3 (March) of a fiscal year, when I execute the query, I need it to automatically only show me the 'Actuals' for periods 1 and 2, without seeing the columns from periods 3 to 12 showing blank.
    Then when I am in the middle period 5 (May) the query should ONLY show me the columns for periods 1 to 4 'Actuals', no results should be shown for periods 5 to 12 yet, and I don't want to even see blank columns for period 6 to 12.
    How do I define my columns, to achieve this.
    Maximum points will be awarded.
    Thanks Everyone.

    Hi Josh,
    I'm having a little difficuluty understanding what should be included in my restricted key figures.
    The time characteristics that I have available to use are:
    0FISCPER3 (posting period)
    0FISCYEAR (fiscal year), currently using SAP EXIT to default current fiscal year.
    0FISCVARNT (fiscal year variant).
    In addition, I have the following characteristics available to be used in the columns:
    Value type (10)
    version (currently I'm using variable for it)
    Currency type (020)
    Currency (USD).
    Can you explain what my restricted key figure should be based on and how it should look.
    I tried to create a restircted key figure using 0AMOUNT, and 0FISCPER3. For 0FISCPER3  I created a range from 1 to previous period (using SAP EXIT that supplied previous period).I also had value type, version, currency type, and currency included in that restricted key figure.Then when I tried to drag 0FISCPER3 under the restricted key figure once again, it wouldn't let me, probably because I've already used 0FISCPER3 in the restricted key figure.
    Please let me know if my explanation is not clear.
    Your step by step help would be great.
    Thanks
    Edited by: Ehab Mansour on Sep 23, 2008 2:40 PM

  • Running a SQL Stored Procedure from Power Query with Dynamic Parameters

    Hi,
    I want to execute a stored procedure from Power Query with dynamic parameters.
    In normal process, query will look like below in Power Query. Here the value 'Dileep' is passed as a parameter value to SP.
        Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData 'Dileep'"]
    Now I want to pass the value dynamically taking from excel sheet. I can get the required excel cell value in a variable but unable to pass it to query.
        Name_Parameter = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
        Name_Value = Name_Parameter{0}[Value],
    I have tried like below but it is not working.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData Name_Value"]
    Can anyone please help me with this issue.
    Thanks
    Dileep

    Hi,
    I got it. Below is the correct syntax.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData '" & Name_Value & "'"]
    Thanks
    Dileep

  • Absolute dynamic select query with dynamic join and where

    Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
    I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
    Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
        SELECT (FIELDS) INTO TABLE IT_TABLES
          FROM ( (ME->TABLE1)  inner join ( me->table2 )
          on ( on_condition ) )
          WHERE (me->where_fields).
    Ags.

    It worked for me in a following way:
    select * into corresponding fields of table <result_table>
            from (join_string)
            where (l_where).
    Where the contents of join_string were dynamically build using concatenation. So it will be something like
    concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
    <...>
    add here matching/reference colums, something like
    concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
    concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
    concatenate join_string temp1 '=' temp2 into join_string separated by space.
    <...>
    concatenate join_string ')' into join_string separated by space.
    And then use similar approach for l_where variable.

  • Dynamic select query with dynamic where condition

    Hi all,
    I want to use the dynamic select query with dynamic where condition. For that I used the below code but I am getting dump when using this code.
    Please advice, if there is any other way to achieve this requirement.
    Thanks,
    Sanket Sethi
    Code***************
    PARAMETERS: p_tabnam      TYPE tabname,
                p_selfl1      TYPE edpline,
                p_value       TYPE edpline,
                p_where1      TYPE edpline .
    DATA: lt_where    TYPE TABLE OF edpline,
          lt_sel_list TYPE TABLE OF edpline,
          l_wa_name   TYPE string,
          ls_where    TYPE edpline,
          l_having    TYPE string,
          dref        TYPE REF TO data,
          itab_type   TYPE REF TO cl_abap_tabledescr,
          struct_type TYPE REF TO cl_abap_structdescr,
          elem_type   TYPE REF TO cl_abap_elemdescr,
          comp_tab    TYPE cl_abap_structdescr=>component_table,
          comp_fld    TYPE cl_abap_structdescr=>component.
    TYPES: f_count TYPE i.
    FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
    *                <ls_outtab> TYPE ANY,
                    <l_fld> TYPE ANY.
    struct_type ?= cl_abap_typedescr=>describe_by_name( p_tabnam ).
    elem_type   ?= cl_abap_elemdescr=>describe_by_name( 'F_COUNT' ).
    comp_tab = struct_type->get_components( ).
    comp_fld-name = 'F_COUNT'.
    comp_fld-type = elem_type.
    APPEND comp_fld TO comp_tab.
    struct_type = cl_abap_structdescr=>create( comp_tab ).
    itab_type   = cl_abap_tabledescr=>create( struct_type ).
    l_wa_name = 'l_WA'.
    CREATE DATA dref TYPE HANDLE itab_type.
    ASSIGN dref->* TO <lt_outtab>.
    *CREATE DATA dref TYPE HANDLE struct_type.
    *ASSIGN dref->* TO <ls_outtab>.
    * Creation of the selection fields
    APPEND p_selfl1 TO lt_sel_list.
    APPEND 'COUNT(*) AS F_COUNT' TO lt_sel_list.
    ** Creation of the "where" clause
    *CONCATENATE p_selfl1 '= '' p_value ''.'
    *            INTO ls_where
    *            SEPARATED BY space.
    *APPEND ls_where TO lt_where.
    * Creation of the "where" clause
    APPEND p_where1 TO lt_where.
    * Creation of the "having" clause
    l_having = 'count(*) >= 1'.
    * THE dynamic select
    SELECT          (lt_sel_list)
           FROM     (p_tabnam)
           INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>.
    *       WHERE    (lt_where).

    Hi Sanket,
    The above given logic of mine works for you, put the code in the If condition and try-
    just like below:
    IF NOT P_EBELN IS INITIAL.
    lt_where = '& = ''&'' '.
    REPLACE '&' WITH p_ebeln INTO lt_where.
    REPLACE '&' WITH field_value INTO lt_where.
    SELECT (lt_sel_list) INTO CORRESPONDING FIELDS OF TABLE <lt_outtab>
    FROM (p_tabnam)
    WHERE (lt_where).
    ENDIF.
    thanks\
    Mahesh

  • Sql query with dynamic fiscal year

    Hi,
    I wrote this query with static fiscal year and fiscal period, I need info on making the variables dynamic
    Fiscal year : starts from July1st. So this year until June'30 it is '2011' and from July'1st its '2012'
    Fiscal period: July1st its '1' and June'1st its '12'
    Query:
    select distinct o.c_num, o.ac_num, s.sub_ac_num, o.fiscal_year, o.ac_exp_date, s.sub_ac_ind
                             from org_account o
                                  left outer join sub_account s
                                  on o.c_num = s.c_num and o.ac_num = s.ac_num
                             where (o.ac_exp_date >= CURRENT_DATE or o.ac_exp_date is null)
                             and o.fiscal_year = *'2011'* --> need to be dynamic
                             and o.fiscal_period = *'12'* --> need to be dynamic
    thanks,
    Mano
    Edited by: user9332645 on Jun 2, 2011 6:55 PM

    Hi, Mano,
    Welcome to the forum!
    Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
    Always say which version of Oracle you're using.
    Since this is your first thread, I'll post some sample data for you:
    CREATE TABLE     table_x
    (     dt     DATE
    INSERT INTO table_x (dt) VALUES (DATE '2010-12-31');
    INSERT INTO table_x (dt) VALUES (DATE '2011-01-01');
    INSERT INTO table_x (dt) VALUES (DATE '2011-06-02');
    INSERT INTO table_x (dt) VALUES (DATE '2011-06-30');
    INSERT INTO table_x (dt) VALUES (DATE '2011-07-01');Is this the output you would want from that data?
    DT          FISCAL_YEAR     FISCAL_PERIOD
    31-Dec-2010 2011            06
    01-Jan-2011 2011            07
    02-Jun-2011 2011            12
    30-Jun-2011 2011            12
    01-Jul-2011 2012            01If so, here's one way to get it:
    SELECT       dt
    ,       TO_CHAR ( ADD_MONTHS (dt, 6)
                , 'YYYY'
                )     AS fiscal_year
    ,       TO_CHAR ( ADD_MONTHS (dt, 6)
                , 'MM'
                )     AS fiscal_period
    FROM       table_x
    ORDER BY  dt
    ;Since your fiscal year starts 6 months before the calendar year, you need to add 6 months to the actual date to get the fiscal year and month.
    The query above produces strings for fiscal_year and fiscal_period. If you'd rather have NUMBERs, then use EXTRACT instead of TO_CHAR:
    SELECT       dt
    ,       EXTRACT (      YEAR
                FROM     ADD_MONTHS (dt, 6)
                )     AS fiscal_year
    ,       EXTRACT (      MONTH
                FROM     ADD_MONTHS (dt, 6)
                )     AS fiscal_period
    FROM       table_x
    ORDER BY  dt
    ;The first query will work in Oracle 6 (and higher).
    I'm not sure when EXTRACT was introduced. It definitely works in Oracle 10, and may be available in earlier versions, too.

  • Query with Dynamic SQL

    Hello,
    I would like to create a Dynamic SQL in which change is the name of the table according to the outcome of the first SQL. This is possible?
    'WITH TABLE_X AS(SELECT LEVEL LVL FROM DUAL CONNECT BY LEVEL <= 12)' ||
    'SELECT A.COL1, A.COL2, B.COL1, B.COL7'                              ||
    '  FROM TABLE_A' || TABLE_X.LVL || ' A'                              ||
    '     , TABLE_B' || TABLE_X.LVL || ' B'                              ||
    ' WHERE A.COL1 = B.COL1 AND ...    'tables in database
    TABLE_A1
    TABLE_A2
    TABLE_A12
    TABLE_B1
    TABLE_B2
    TABLE_B12let me know how I can do this
    Regards

    Hi,
    Sorry, I don't see what you're trying to do.
    "Dynamic SQL" is really a mis-nomer. The number of tables and columns in a query, and their names, must be spelled out when the statement is compiled. There is nothing dynamic about it.
    In dynamic SQL, a PL/SQL procedure or another query writes all or part of query just milliseconds before it is compiled, typically using data taken from tables or supplied by a user right then.
    For example, consider this static query:
    SELECT     a.col1, a.col2, b.col1, b.col7
    FROM     table_1     a
    ,     table_2 b
    WHERE     a.col1 = b.col1;Now, say the 1 in "table_1" and the 2 in "table_2" are variables, x and y, that you will want to look up from another table every time you run this query. You can make it dynamic like this:
    sql_txt := 'SELECT  a.col1, a.col2, b.col1, b.col7 '
         || 'FROM    table_' || TO_CHAR (x) || ' a '
         || ',       table_' || TO_CHAR (y) || ' b '
         || 'WHERE   a.col_1 = b.col1';Now let's make it really interesting. Say that instead of 2 tables, and 1 join condition, you''ll have n tables and n-1 join conditions, where n has to be computed at (actually a split second before) run-time. That is, if n=4, you might need to construct a static query with 4 tables and 3 join conditions, like this:
    SELECT     a.col1, a.col2, b.col1, b.col7
    FROM     table_1     a
    ,     table_2 b
    ,     table_12 c
    ,     table_2 d
    WHERE     a.col1 = b.col1
    AND     a.col1 = c.col1
    AND     a.col1 = d.col1;You can do that using dynamic SQL, too.
    Post an example of the static query you need to build, and describe what parts of it are dynamic, and how you get the values for those parts, and someone will help you write the dynamic SQL.

  • User inputted letters with dynamic fields in Report Builder

    I'm proactively trying to get certain aspects off our hands in IT and more specifically, the way letters are generated through ColdFusion.  Right now we are using activeX controls (with some vbscript and asp pages) through IE to do Word mail merges for letter's for our students.  We would like the user to be able to change these letters by themselves through our web application and have them saved in our database so they can be stored as a future template.
    Now I'm new to Report Builder and have a few examples to show my colleagues, but I'm having troubles being able to dynamically insert the student's name (for example) into the report.
    So basically I have an empty template with a huge dynamic box for the text which reads #param.MessageBody# that comes from a textarea within the cfm page.  That works, but taking it one step further, I want to replace all instances of "%%StudentName%%" within that MessageBody with the actual student's name.
    Since I cannot loop over the report and do my usual ReplaceNoCase(lMessageBody, "%%StudentName%%", Trim(ReportQueryLetters.StudentName), "ALL")>, how can I put this into a built-in function into the report?
    I figured the function needs to be in <cffunction name="BeforeExport"> and while a simple display of the message works perfectly, I cannot get my replace line to work.  I am passing the query to Report Builder instead of having it built-in, is that my problem?!  I would prefer if it was external to save my stored procedures if I can.  Is there any way to call the query to get that line to work?!
    The code inside the cffunction (in report Builder):
    <cfargument name="lTextArea">
    <cfset lTextArea = #form.frmTextArea#>
    <cfset lTextArea = ReplaceNoCase(lTextArea, "%%StudentName%%", Trim(ReportQueryLetters.StudentName), "ALL")>
    <cfreturn lTextArea>
    The error:
    Element STUDENTNAME is undefined in REPORTQUERYLETTERS.           

    Sorry for the late reply, just got back from vacation.
    I don't think you use ReportQueryLetters for the query.  it should be
    query.StudentName
    Also, you can have an intermediate step on the page that receives the
    MessageBody and change the MessageBody before passing it as a parameter to the
    report.

  • Report and ready for input Query, with similar shadings are confusing

    Some customers mix report and planning queries in their templates.
    usually the shades for PLAN Queries are
    o white - ready vor input
    o blue- display data (e.g. LY, calc KPI)
    In a Query with NO INPUT ready Cells the query has a zebra shading, blue and white, row by row.
    That is confusion for users if they believe every Number on a white background can be changed.
    Is it possible to change the shading for reporting queries to blue only?
    Best Regards,
    Georg

    Hi.
    You can cancel zebra by setting off for ALTERNATE_STYLES in properties if analysis item in WAD, BUT it sets all cells as WHITE and not blue.
    I dont know how it will be usefull, but you may try ...
    Regards.

  • Query with subquery should return value but doesn't

    When I run this SQL, it returns no value:
    SELECT vfn.cat
    FROM vps_fishery_ner vfn, valid_fishery vf
    WHERE vfn.plan = vf.plan
    AND vfn.cat = vf.cat
    AND vf.permit_year = 2010
    AND vf.moratorium_fishery = 'T'
    AND vfn.vp_num = 211652
    AND vfn.ap_year = 2010
    AND vfn.plan = 'MUL'
    AND vfn.date_issued = (SELECT MAX(date_issued)
    FROM vps_fishery_ner
    WHERE vp_num = 211652
    AND ap_year = 2010);
    In order to test, I take out the subquery and run it separately:
    SELECT MAX(date_issued)
    FROM vps_fishery_ner
    WHERE vp_num = 211652
    AND ap_year = 2010;
    Returns 02-APR-10
    Then I paste this date into the original query (using the TRUNC function, of course, since I hardcode only the DDMMYY part of the date):
    SELECT vfn.cat
    FROM vps_fishery_ner vfn, valid_fishery vf
    WHERE vfn.plan = vf.plan
    AND vfn.cat = vf.cat
    AND vf.permit_year = 2010
    AND vf.moratorium_fishery = 'T'
    AND vfn.vp_num = 211652
    AND vfn.ap_year = 2010
    AND vfn.plan = 'MUL'
    AND TRUNC(date_issued) = TO_DATE('02-APR-10');
    And this returns the required value, 'A'.
    So why doesn't the full query with subquery work, if the value that is returned by the subquery is valid and works when you just paste it in?
    Thanks.

    Hi,
    Not sure about your question.
    But you say when you uss 01-apr-10 you get the expected results.
    So why dont you try using trunc on botht sides
    SELECT vfn.cat
      FROM vps_fishery_ner vfn, valid_fishery vf
    WHERE vfn.plan = vf.plan
       AND vfn.cat = vf.cat
       AND vf.permit_year = 2010
       AND vf.moratorium_fishery = 'T'
       AND vfn.vp_num = 211652
       AND vfn.ap_year = 2010
       AND vfn.plan = 'MUL'
       AND trunc(vfn.date_issued) = (SELECT MAX(trunc(date_issued))
                                FROM vps_fishery_ner
                               WHERE vp_num = 211652
                                 AND ap_year = 2010);Rememeber if you are couting on some Index to be used you might want to recheck.
    IN answer to your question why it does not return with subquery included, because the TIME PART is not the same.
    You yourself proved it by using the supplying only the date part.
    Regards,
    Bhushan

  • Help with dynamic statement returning values into collection

    Hi All
    I am trying to use dynamic statement to return values into a collection using the returning clause. However, I get an ORA-00933 error. Here is a simple setup:
    create table t(
        pk number,
        id_batch varchar2(30),
        date_created date,
        constraint t_pk primary key ( pk )
    create or replace type num_ntt is table of number;
    create or replace type vc2_ntt is table of varchar2(30);
    create or replace
    package pkg
    as
      type rec is record(
          pk        num_ntt,    
          id_batch  vc2_ntt
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
    end pkg;
    create or replace
    package body pkg
    as
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
      is
      begin
          execute immediate '
          insert into t
          select level, ''x'' || level, sysdate
          from   dual
          connect by level <= :p_count
          returning pk, id_batch into :pk, :id_batch'
          using p_count returning bulk collect into p_rt.pk, p_rt.id_batch;
      end p;
    end pkg;
    declare
      r  pkg.rec;
    begin
      pkg.p( 5, r );
    end;
    /

    sanjeevchauhan wrote:
    but I am working with dynamic statement and returning multiple fields into a collection.And using an INSERT...SELECT statement combined with a RETURNING INTO clause still does not work. Whether it's dynamic SQL or not: it doesn't work. The link describes a workaround.
    By the way, I don't see why you are using dynamic SQL here. Static SQL will do just fine. And so you can literally copy Adrian's setup.
    Regards,
    Rob.

  • Query with dynamic variables and customised caption

    How to change the Field label when the query asking dynamic values during the execution?
    for example:  in where condition i want to give a country name during the query execution, but in the small window it will display as 'Name' which is a country name.  i want to display it as 'Country Name' which should be more readable for the end user. How can we achieve this?
    Thanks
    SV Reddy

    Hi,
    Unfortunately, it is not possible to change the system field description.
    Refer to this thread
    Re: Parameter Display Name Reg.
    Regards,
    Vijay Kumar
    SAP Business One Forums Team

  • Sorting grouped values by month and year within chart

    Hello
    I have a really tough problem which I can't seam to figure out.
    I have a table called SOLAR_RETURN which has 4 columns:
    - ID
    - USER_ID
    - DATUM
    - RETURN
    On a page I have 3 links, one for showing the information from the database by day, month or year.
    The hidden field :P25_DATE_FILTER is being set through the URL when clicking one of the 3 links.
    I have a linechart with the following sql statement which pulls the correct data according to the value of :P25_DATE_FORMAT:
    select null link, to_char("SOLAR_RETURN"."DATUM", :P25_DATE_FILTER) as label, max("SOLAR_RETURN"."RETURN") as value from "SOLAR_RETURN"
    WHERE "SOLAR_RETURN"."USER_ID" = :USER_ID
    AND to_char(DATUM, :P25_DATE_FILTER) = decode(:P25_DATE_FILTER,'YYYY',to_char(DATUM, 'YYYY'),'MM-YYYY',to_char(DATUM, 'MM-YYYY'),'DD-MM-YYYY',to_char(DATUM, 'DD-MM-YYYY'))
    GROUP BY to_char(DATUM, :P25_DATE_FILTER)
    Everything is working great, only the sorting is messed up. I need to sort it so that when :P25_DATE_FORMAT is set to DD-MM-YYYY it will be sorted by year desc, month desc, day desc. If the value would be MM-YYYY it would need to sort by year desc, month desc.
    I have tried the following without succes:
    ORDER BY to_char(DATUM, :P25_DATE_FILTER) ASC
    --> This doesnt cut it since it sorts like this: (for example)
    01-2010
    02-2010
    11-2009
    12-2009
    Vice versa for DESC
    Is there any way that I can sort the grouped values by day, month and year seperately?
    Thanks in advance!
    Marc

    Hi,
    What is data type for column DATUM ?
    If it is date did you try ORDER BY DATUM DESC ?
    Br,Jari

  • Dynamic Tag Query  with dynamic tag name.

    Hi,
    In our implementation we have 10+ users. Each one want to monitor only one production line ( eg. one tag value ) in the dashboard by default when they login.
    I was able to design this requirement CONCEPTUALLY but facing some trouble technically.
    Here is my issue.
    Tagname will be coming from one of the BLS Transaction input parameters (Transaction.Tagname). I am able to build tag query using xMII Tag Query block, able to configure repeater. Here is the spot where I was struck. While assigning tag value to XML Row
    i.e IlluminatorRow_0.Tagvalue = Repeater_0.Output{/Row/AssetUtil1}.
    In the above assignment link it requires a hardcoded tagname. In my case it will be dynamic. I tried different ways like
    1. IlluminatorRow_0.Tagvalue = Repeater_0.Output{/Row/@Transaction.Tagname}.
    2.IlluminatorRow_0.Tagvalue = Repeater_0.Output{/@Transaction.Tagname}.
    But no luck.
    Can someone help in how to do this dynamic tagname assignment.
    Thanks,
    Srinivasa.

    Hi Srinivas,
    another option is to use "Dynamic Links" which from your sample code is what you were trying to do. For this, the proper syntax is:
    Repeater_0.Output{/Row/#Transaction.Tagname#}
    Make sure that the tag name you pass to the historian is the same as the tag name returned by the historian as part of the data set, and make adjustments for that. For example, some historians escape non-alphanumeric characters when they process your request (e.g. passing "abc.def 12-rt" as the tag name can be returned from the historian as "ABC.DEF_12_RT", etc.).
    Hope this helps,
    Sascha

Maybe you are looking for

  • Why can't I make a kik account? I have IOS6 and higher and my restrictions are turned off! Please help!

    Why can't I make a kik account? I have IOS6 and higher and my restrictions are turned off! Please help!

  • ME59N - club two PO in to single PO

    Hi, We are using ME59N for PO creation. currently the system create two PO for single PR. based on the condidtion EBAN-KONNR For Item 20 EABN-KONNR values empty For Item 10 and 30  EABN-KONNR have some value. based on the above condition system creat

  • Database is in 'STARTED' state error???

    Hi, Has anyone ran a Job in OEM and encountered this error: Database is in 'STARTED' state If so, how can I correct this problem. I looked on Metalink and it said to connect tot he DB with the dbsnmp account, but that did nothing. Any ideas?

  • Drop down menus and image loading

    Hi there, I have an idea on my site to display photos for consumers to purchase. What I have is 2 drop down menus, the first one has a list of the galleries, the second has a list of the photos. When you select a gallery a corresponding list of photo

  • ADF BC: When to register ViewClearCacheListener?

    Hi All, just a little question. I was wondering when the right time was to register listeners in the ApplicationModule and (DB)Transaction? I'm using the ViewClearCacheListener but are not sure were to add it to have it aroudn all the time. It should