Is it possible to pass a subquery with variable value ?

Hi
Is it possible to pass a subquery with variable as date ....which inturn is used to retrieve the value from the main query .
For ex, this query is used to obtain the forecast details based on month and i need to obatain the month value from the sub query where the user need to select the forecast date as one of the  parameter
select OFCT.Name,Fct1.ItemCode,sum(fct1.Quantity) as S_Qty,month(Fct1.date)as For_Month
from Fct1,OFct
where  Fct1.absid = ofct.absid
and fct1.ItemCode = '26259939'
and month(fct1.date) in (select month(fct1.date)from fct1 where fct1.date =<b> '[1%]'</b>)
Hope somebody will respond
Regards
Mini

Hi Owen,
I have tried this query in Query Generator after trying it SQL Query Analyzer for syntax error as you had mentioned ,
The query i have tried and is working with Analyser is :
select OFCT.Name,Fct1.ItemCode,sum(fct1.Quantity) as S_Qty,month(Fct1.date)as For_Month
from Fct1,OFct
where  Fct1.absid = ofct.absid
and FCT1.ItemCode = '4/4650017/2'
and month(fct1.date) = '11'
group by FCT1.itemcode,OFCT.NAme,FCT1.date
In Query Generator when i try the same query,the Itemcode and Month need to be entered as variable, Iam able to take the item.Even the variable window shows me the Forecast date but the query throws an error 8180.
Any help will be appreciated.
Thank you
Mini

Similar Messages

  • Is it possible to create purchase order with zero value ?

    Is it possible to create purchase order with zero value ?

    Hi,
    There are two scenarios where the purchase order is created with zero value.
    1. Standard Purchase order with Free tick indicator.
    Whenever we expect a material with free of cost from vendor, we use to put the free indicator in item overview.  This means the material is valuated at zero price irrespective of price control in material master. Quanitiy is updated while receipts.
    Conditions tab in item detail doesnt appear.
    2. Consignment PO.
    While creating a purchase order for consignment, the system doesnt ask us the price and the condition tab doesnt appear in item detail.
    An info record for consignment must be maintained before making the GR.
    Hope i have clarified.  If you want any further clarification. please do reply.

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • Issue with variable values while adding report to Bookmarks/Favorites

    Hello All,
    I am able to save the reports from my portal as bookmarks with the appropiate navigation state & variable values for reports which do not have a mandatory value variable with no default value. For all other queries like queries with no mandatory variables or queries containing mandatory variables with default values, this is working fine. Any inputs is appreciated. We are in BI7.0 with SP12.
    Thanks,
    Danny

    What's your question, because from your statement, it seems like everything is fine ??
    Cheers,
    Andrew

  • Is is possible to pass EDI X12 GS 02 value to B2B via BPEL?

    Hello Oracle B2B Gurus,
    We currently have a trading partner with 900 different group ids.
    I have created a reference table from which I would like to pass the GS02 segment for B2B via a BPEL process. B2B would then consume the Group ID and forward that to the VAN.
    Since the ISA sender id and reciever id is the same for all 900 group ids, I was wondering if B2B has the option of not setting a group id and consuming it via a paramater using either AQ or default?
    Thanks

    Does this mean that I need to add the 855 with GS headers at the Version level? Will this effect all other 4010 transactions that I have? Yes, it will affect all the 4010 transactions however if you want to use separate group or interchange ecs for a particular partner, then override the group and interchange ecs at partner level (Remote Partner Name --> Documents --> select document definition --> Override Version Param)
    Or do I just create a GS group ecs file with only the GS segments and place that at the version level? If you want to use common group ECS for all the partners then upload it at the version level otherwise override it at the partner level.
    Can you provide a sample of the default GS file that is currently in B2B? I can provide but it's simple to create a group and interchange ecs -
    Group ECS must have only GS and GE segments.
    Interchange ECS must have only ISA and IEA segments.
    You may create a transaction set ecs with envelope parameters and delete all the segments except required one to prepare a group/interchange ecs.
    Regards,
    Anuj

  • Is it possible to pass command line as variable.

    Hi to all,
    I have an application(java based) which upon execution asks for database name after selection thru file dialog, it spawns dos window and executes batch file (and the batch file contain command line java programm).
    Now my question is how can i pass the database name to this spawned java application in dos prompt.
    Anybody's suggestion is welcomed.
    Regards
    Khizer

    Two ways, as a property or as an argument.
    You can set it as a property like this using the -D option:
    java -Ddatabase.name=MyDatabase ....
    Then you can read it from the application as
    System.getProperty("database.name");
    Passing it as an argument goes like this:
    java ... MyMainClass MyDatabase
    and read it as
    public class MyMainClass {
      public static void main(String[] args) {
        if (args.length == 1) {
          System.out.println("Database name is: "+args[0]);
        } else {
          System.out.println("Usage: java ... MyMainClass <database name>");
    }

  • Passing Configuration Details with Dynamic Value - SFTP Adapter

    Hi:
    We are using SFTP adapter to get and load the files to a secured location. Now there is one more secured location which has IP address where we need to load the same file in that location.
    So is it possible to make the configurations in Deployments --> FTP Adpter in Weblogic server as dynamic, so that we can use the same JNDI while configuring in JDeveloper to connect different secured locations
    Oracle SOA Suite - 11.1.1.4
    Weblogic - 10.3.4
    JDeveloper - 11.1.1.4
    Regards
    RK
    Edited by: RK.. on Mar 26, 2013 5:30 PM

    Hi,
    I think it's unlikely you can achieve this by the way FtpAdapter is configured, it's done via deployment plan, so it is at deployment time.
    It seems like you need something able to be aware of modifications at run time, maybe if you can find the FtpAdapter mbean there may be something you can do at runtime.
    But I tend to think that SFTP servers don't appear and disappear overnight, so it wouldn't worth the effort to build something that wouldn't change that often.
    Cheers,
    Vlad

  • Purchase order with variable value line item

    Hello experts,
    In SRM 7.0 extended classic scenario after PO approval Is it possible to create a line item with such that even if we change the value(increase/decrease) it wont trigger approval workflow .We needed this because we don't know the exact value for transport such that if the value is modifiable it would help us.At the time of GR it is possible if value is below but if value is more than tolerance then we have to re order the PO then it will go through full approval cycle again we dont want that.Please tell is there any way to create such line item.
    Thanks and Regards,
    Shiva

    Hello,
    Are you integrating SUS also for the follow on processes after PO creation or you will be doing the same in ERP ?
    If yes then you can achieve this with SRM - SUS integration scenario, by making use of the Limits items with transport as service, where the PO will be created with the certain limit value defined by the purchaser and later vendor can consume the same against the services like varying transport costs within that defined limit in the Purchase order response.
    This will not trigger the Approval process again. 
    Best Regards,
    Rahul

  • How to pass a hierarchy node variable value over OpenDocument?

    Hello,
    I have been unable to link to an instance with matching parameters with opendocument with hierarchy node variables.
    Has anyone attempted this or been successful?
    Please reference this post I had in the Web Intelligence forum.  sInstance=Param not working for sap bw query based reports (FWM 02020)
    Here's some background information
    We've created 2 new crystal reports based of sap queries.
    Report 1, single prompt, no hierarchy.
    Result : Can link to specific instance with matching parameters. Great!
    Report 2, single prompt, hierarchy based.
    Result: Cannot link to specific instance with matching parameters
    Parameter list for report 2
    [!V000001} : Cost Center/Gr{oup (Multiple) = {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    However when I go into the history and look at the successful instance parameters used, it seems to be picking up an extra parameter ( my guess is node)
    XXX, XXX & XXX; {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    We have attempted to use the entire string, the first portion, second portion, and just the technical response. No luck.
    Any help or pointers would be appreciated!
    Nick

    Hello  Ingo,
    I'll explain the situation more clearly,
    Report 2, single prompt, hierarchy based.
    Result: Cannot link to specific instance with matching parameters with a response from the Bus Objects server
    An error has occurred: The object with ID -1 does not exist in the CMS or you don't have the right to access it (FWM 02020)
    We have 1 parameter for report 2
    {!V000001} : Cost Center/Group (Multiple)
    We selected a single value:
    {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    (The XXX, XXX, & XXX is the description)
    We ran a successful instance.
    However when I go into the history and look at the successful instance parameters used it displays the following: 
    XXX, XXX & XXX; {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    An extra description seems to appear (The first XXX, XXX & XXX;) Our original selection was only {0COSTCENTER   XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    We attempted to build variations of the open document strings
    1. We tried the entire parameter response,
    XXX, XXX & XXX; {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    2. The first description that was not part of the original selection,
    XXX, XXX & XXX
    3. The technical name and description
    {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE} - XXX, XXX & XXX
    4. The technical name
    {0COSTCENTER XXXXXXXX.BGT3}.{XXXXXXXXX.BGT3 0HIER_NODE}
    Please let me know if you need more details.
    Regards,
    Nick

  • Issue with variable value

    Apologies for my mistakes, I am learning pl/sql as I have to fix something at work that's broken.
    I have this bit of code:
    DECLARE
        l_x_contract VARCHAR2(100);
    BEGIN
    SELECT DISTINCT wiav.text_value
           INTO l_x_contract
       FROM apps.wf_item_attribute_values wiav
          , apps.wf_item_attributes wia
          , apps.wf_items wi
          WHERE wiav.item_type = wia.item_type
        AND wi.item_type = wiav.item_type
        AND wi.item_key = wiav.item_key
        AND wiav.NAME = wia.NAME
        AND wiav.text_value IS NOT NULL
        AND wiav.item_type = 'POAPPRV'
        AND wia.NAME = 'X_CONTRACT_IN_PLACE'
        AND wi.user_key = TO_CHAR(l_this_doc_num);
    EXCEPTION
    WHEN no_data_found THEN    
         l_x_contract := 'OLD';
         INSERT INTO XX.XTMP(l_id, l_name, l_value) VALUES (APPS.XSEQ.NEXTVAL, 'l_x_contract no_data_found', l_x_contract);
         COMMIT;
    END;
    IF l_x_contract = 'N' THEN
         l_supplier_flagged := FALSE;
    END IF;
    IF l_x_contract = 'Y' THEN
         l_supplier_flagged := TRUE;            
    END IF;
    IF l_x_contract = 'OLD' THEN
         l_supplier_flagged := l_supplier_flagged;                 
    END IF;
    INSERT INTO XX.XTMP(l_id, l_name, l_value) VALUES (APPS.XSEQ.NEXTVAL, 'l_x_contract end', l_x_contract);
    COMMIT;When it runs, and I then select * from XX.XTMP, I see this:
    l_id  | l_name                       | l_value
    1     | l_x_contract no_data_found   | OLD
    2     | l_x_contract end             | Meaning that in the BEGIN block, the code knows the value of "l_x_contract".
    Outside the block, by the time the 2nd debug insert runs, it doesn't know the value of "l_x_contract", hence the no value in the debug table for the 2nd insert.
    I naively tried changing the top block to:
    DECLARE
        l_x_contract VARCHAR2(100);
    BEGIN
    SELECT DISTINCT wiav.text_value
           INTO l_x_contract
       FROM apps.wf_item_attribute_values wiav
          , apps.wf_item_attributes wia
          , apps.wf_items wi
          , po.po_headers_all pha
      WHERE wiav.item_type = wia.item_type
        AND wi.item_type = wiav.item_type
        AND wi.item_key = wiav.item_key
        AND wiav.NAME = wia.NAME
        AND wi.user_key = pha.segment1
        AND wiav.text_value IS NOT NULL
        AND wiav.item_type = 'POAPPRV'
        AND wia.NAME = 'X_CONTRACT_IN_PLACE'
        AND wi.user_key = TO_CHAR(l_this_doc_num);
        RETURN l_x_contract;
    EXCEPTION
    WHEN no_data_found THEN
        l_xccc_contract := 'OLD';
        RETURN l_x_contract;
        INSERT INTO XX.XTMP(l_id, l_name, l_value) VALUES (APPS.XSEQ.NEXTVAL, 'l_x_contract no_data_found', l_x_contract);
        COMMIT;
    END;But that returns this error:
    PLS-00372: In a procedure, RETURN statement cannot contain an expressionHaving googled that, I think I need to create a function in order to return something, as it's not possible to include a return in my block.
    Is that right? Is there no other way for the block to let the rest of the code know what the value of the l_x_contract, other than to use a function? I tried to write a function, but made a total mess of it.
    Any advice much appreciated, and apologies for being useless, lazy, stupid etc. etc.
    Thank you

    Given that you say this is a snippet from a procedure in a package, I suspect that the whole procedure has a structure similar to this.
    PROCEDURE x
       variable declarations
    BEGIN
       some code
       DECLARE
          l_x_contract VARCHAR2(100);
       BEGIN
          SELECT text_value
       EXCEPTION
       END;
       IF l_x_contract = 'N' THEN
       END IF;
    END IF;If my assumtion is correct. then the variable l_x_contract is only visible between the DECLARE and the END following the exception block. Just move the declaration of l_x_contract to the main declaration section for the procedure (where I have variable declarations in the skeleton above), then lose the declare altogether. You can have a begin exception end block anywhere without requiring a declare block.
    John

  • How use replace all grid row with variable value

    hi master
    sir i have master detail form
    in detail form i have 5 column grid thate have 25 row at time
    one column name id
    such as id have value 23
    but i want replace all id row with 555
    how i replace all id in grid with 555 befor commit_form
    how i use loop for grid
    or any other method
    please give me idea
    thank's
    aamir

    Go_Block('Detail');
    First_Record;
    Loop
      :detail.item := '...' ;
      Exit when :system.last_Record = 'TRUE' ;
      Next_record;
    End loop;
    First_Record ;Francois

  • How to have a submit button with variable values

    i have a jsp form which is like
    while(itr.hasNext()){
          b=(Book)itr.next();
          int code=b.getBookCode();
           %>
            <tr>
             <tr>
                 <form action="temp.jsp" method="post">
              <td align="center"><%=b.getBookCode()%></td>
              <td align="center"><%=b.getBookName() %></td>
             <td align="center"><%=b.getAuthor().getName() %></td>
              <td align="center"><%=b.getAuthor().getAuthorCode() %></td>
              <td align="center"><%=b.getPublisher().getName()%></td>
              <td align="center"><%=b.getPublisher().getPublisherCode() %></td>
              <td align="center"><%=b.getPrice() %></td>
              <td><input type="submit" name="Submit" value="Add"></td>
              <input type="hidden" name="code" value=+*i want to get the book code here (b.getBookCode())*+>
              </form >
            </tr>
            </tr>
            <%
        %> here i want to get variable values for submission in submit button
    can anyone help
    can i use request.addheader() for this -it doesn't seem to be working always returns -1

    This inept has crossposted the question over all places. Someone else already gave the answer.
    Don't crosspost. Stick to one topic. Continue here: http://forum.java.sun.com/thread.jspa?threadID=5254517
    AmitChalwade: you find it still hard to write "u" as "you", "r" as "are" and "u r" (you are) as "your" ?

  • Passing a cookie with a URL call

    Hi there,
    Is it possible to pass a cookie with a url call?
    Thanks in advance!
    Ryan

    I should probably clarify a bit. The goal is to pass a cookie to a url call in order to keep a session alive. It's for a part of an AIR app that pulls in a html frame that requires a login.

  • Passing SQL Server identity attributes values into adf entity objects

    Hi all.
    I'm using Jdeveloper 10g for developing an ADF Swing application based on MS SQL Server DB.
    Does anyone know if it is possible to pass SQL Server identity attributes values into the correspondent attrributes of adf entity objects, like we do with Oracle DB Sequence.
    The problem is that i should somhow implement cascade deleting of detail view objects, so i should use the composition association. But since i cant fill the primary key attribute with appropriate value (that is actually a ms sql server db sequence value) i always get
    the following exception: oracle.jbo.InvalidOwnerException: JBO-25030 as i try to create a new pair of master/detail objects.
    Thanks in advance.
    Alex.

    The approach is good. but i still dont understand how i can address the sql server db sequence (identity field) programmatically...
    The code offered
    SequenceImpl sequence = new SequenceImpl("PRODUCTS_SEQ",getDBTransaction());
    setProdId(sequence.getSequenceNumber());
    generates something like this:
    select deq_name.nextval from dual
    but this syntax works for oracle only... and not for sql server...
    Edited by: Timin on Mar 26, 2009 6:34 AM
    Edited by: Timin on Mar 26, 2009 10:25 AM

  • Flex char 100% with negative values.

    Hello.
    I have in my app a chart (cartessianchart) with a columnset
    of 100% columseries.
    All is fine until negative values appear in the series. For
    those negative values, the representation dissapears.
    I have ported my app to use "stacked" series instead of 100%
    ones and i make the 100% conversion programatically.. but this
    seems to me like reinventing the wheel..
    Perhaps it is not possible to use 100% bars with negative
    values...
    Could you take a look to the code i submit and send me your
    ideas?
    Thanks

    Hi Aman,
    DB not restarted during this time.. we don't have production access. we will get awr report automatically from customer daily. also i am getting issue in our local environment v$rowcache view gets values is negative for dc_users and dc_tablespaces parameter may be it's related production issue...

Maybe you are looking for

  • BI Beans Portal sample cache error

    Hi, I have tried to implement the BI Beans Portal sample, I have followed the instructions and everything has worked, however if I try and display a Portlet, I get the message "This view has not been cached yet". I have cached all the Dataviews with

  • Can't Install Render Engine as per Help file

    I was able to install the render engine and use it in the past. I have updated to CS5.5 and I am trying to install the render engine. i am being asked for a code or trial option before it will install. If I choose "trial" I won't be able to use the r

  • Error in RSA5

    Hi, I have a problem. i try to enhance 0figl_4 data source using append option when activated it is given me an error message. closed the screen and run again rsa6 and duble click on data source it is given me an error so i delete the datasource and

  • Weblogic portlet lifecycle?

    Could anybody explain the lifecycle of WebLogic portlet (for example, a pageflow portlet)? I know a JSR-168 portlet has a lifecycle similar to servlet (init, service, destroy, etc). Not sure about Weblogic portlet. Thanks!

  • Having trouble with mobile me sending email.

    i get a long loading... message in the "mail message" window. but it never does load. does anyone have a fix for me?