Query with SPASCRIPT parameters

Hi Champs,
I am creating a SAP SCRIPT which will be clone of MR_PRINT and will be driven by TCode MR90. Hence I cannot make changed in the driver program.
In my requirement I need one more field to be represented in my SAP Script that is VTEXT(payment terms) field of LFM1. But when I debug the existing MR_PRINT SAPSCRIPT it seems as if there is no parameter like LFM1-VTEXT.
My Query is is it possible to create your own parameter in SAP Script and then Populate it.
I know there a syntax
/: DEFINE &lfm1-vtext& *
But can this varibale be used for display purpose.
Thanks
Regards
Nishant

Hi Nishant,
you can add your desired field in SAPACRIPT.
you need to write subroutine program for this.
e.g.
perform get_quant_char in ZMM_TRANSFER_ORDER using intab structure itscy.
FORM GET_QUANT_CHAR TABLES INTAB STRUCTURE ITCSY
                           OUTTAB STRUCTURE ITCSY.
  DATA : QUANT(13) TYPE C,
         QUANT1 TYPE I.
  READ TABLE INTAB INDEX 1.
  QUANT1 = INTAB-VALUE .
  QUANT = QUANT1.
  CONDENSE QUANT.
  READ TABLE OUTTAB INDEX 1.
  OUTTAB-VALUE = QUANT.
  MODIFY OUTTAB INDEX 1.
ENDFORM.                    "Get_quant_Char
Regards,
Vijay

Similar Messages

  • 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

  • How to write XSJS Select Query with input parameters

    Hello Experts,
    I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View
    I have tried it the following way:
    var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'
        + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'
      + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';
    But it gives me the "Mixed spaces and tabs error".
    How should I write XSJS Select Query with input parameters?
    Regards,
    Rohit

    >But it gives me the "Mixed spaces and tabs error".
    Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.
    The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

  • Extract Sql Query with Actual Parameters from Report

    Hi
    I am able to extract query from Crystal Report using the following code :
    ReportDocument.ReportClientDocument.RowSetController.GetSqlStatement(new GroupPath, out tmp);
    But the sql query retrieve comes in the following format :
    select name , trans_code, account_code from command_query.accounts
    where account_code = {?Command_query_Prompt0}  and effective_date < '{?Command_query_prompt1 }'
    The parameters which I m using in the reports are :
    Account_Code and Effective_Date .
    Why does my extracted sql translates it into {?Command_query_Prompt0} and '{?Command_query_prompt1 }' .
    Is there any way to map this to the actual parameter values ?
    OR
    Can we extract the query after assigning the values ?
    Any help is appreciated ... 
    Thanks
    Sanchet

    hi,
    You can create nested sql query with conditional parameters,
    For example
    Select Code From OITT Where Code IN (Select ItemCode From OITM
    Where ItemName LIKE '[%0]' + '%%')
    Edited by: Jeyakanthan A on Jun 9, 2009 12:31 PM

  • Content presenter: datasource based on CMIS query with URL parameters

    Hi all,
    I am trying to create a page containing a content presenter taskflow that is based on a CMIS query containing URL parameters. In my component properties I define the following query for my datasource:
    +SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xqblIntranetSubGroep='${param.qblSubGroep}'+
    I have a URL parameter qblSubGroep containing the value "Nieuws".
    Somehow my page does not show any content. It looks like the parameter value is not passed to the data source query. When I change my query to
    SELECT * FROM ora:t:IDC:GlobalProfile WHERE ora:p:xqblIntranetSubGroep='Nieuws'
    so, I hardcode the value of my URL parameter in my query, the expected content items are shown.
    Also, I have another page containing a content presenter taskflow for a single item, based on the data source:
    +${'WebCenterSpaces-UCM#dDocName:'}${param.dDocName}+
    In this case, URL parameter values for dDocName are passed correctly and content presenter is showing the document with dDocName as entered in the URL.
    Does anybody have any idea on how to solve this probem?
    regards,
    Harold

    hi all
    when i try using cmis query with Arabic characters it display no results .
    SELECT * FROM ora:t:IDC:GlobalProfile WHERE AND ora:p:xAgrPressMag LIKE'جريدة الرياض'
    this is the query i am using and the value inside ora:p:xAgrPressMag is correct and i try search this value inside content presenter normal search and it display results i am afraid that cmis query doesnt accept arabic characters
    any suggestion please its top urgent
    best regards
    Edited by: 975169 on Feb 26, 2013 12:59 AM

  • Native TopLink named query with named parameters

    Hello,
    Defining my metadata in native TopLink xml and using the native TopLink's Session interface I can access and successfully execute a named query using positional parameters (parameters passed to match the ?1 ?2 etc). I used for this the Session.executeQuery(String, Class, List) method e.g.
    select p from Person p where p.name = ?1
    Now, how can I get the same Session to execute named queries using named parameters? None of the Session.executeQuery methods seem suitable ... Am I missing anything here? e.g.
    select p from Person p where p.age = :age
    I can't find in Session http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/b13698/oracle/toplink/sessions/Session.html a good match for this use-case. I would expect something like:
    Session.executeQuery(String queryName, Class target, List argNames, List argValues)
    or
    Session.executeQuery(String queryName, Class target, Map argsKeyedByName)
    but can't find any good match, can anyone please enlighten me?
    Thanks in advance,
    Best regards,
    Giovanni

    Hello Chris,
    Many thanks for your response. I am sorry if I did not explain my problem properly.
    Suppose I already defined a named query in the metadata XXXProject.xml using the <opm:querying ... this JPQL named query "customFinder" already exists and would look something like:
    select p from Person p where p.firstname=:firstname and p.lastname=:lastname and p.birthdate=:birthdate
    now say you want to execute this query from the Session:
    Vector args = new Vector();
    // how do you know the order? you shouldn't know the order!
    // you know only the parameter names and that's what I mean
    // about named parameters
    // This args setup is wrong ... I need a way to specify to which
    // parameter name each argument corresponds to. In other words
    // if the named query where criteria order of parameters is modified
    // perhaps because of pruning composite keys etc you won't break the
    // existing code ...
    args.add(new Date());
    args.add("Azua");
    args.add("Giovanni");
    Session session = ...
    session.executeQuery("customFinder", Person.class, args);
    JPA supports both type of queries positional parameters and named parameters. Your explanation above is only for the first, my question refers to the later.
    I have not yet found the api for this ... though I am investigating along the lines of:
    Query query = session.getQuery("customFinder");
    and then try to assign the arguments in the same order that the parameters are defined in query or?
    Thanks in advance,
    Best regards,
    Giovanni
    Edited by: bravegag on 29.05.2009 08:06

  • MDM ABAP API: Query with Multiple Parameters

    I would like to query MDM repository passing multiple parameters. I used the following code, however, it didn't work.
    If I pass only one parameter, it works fine.
    DATA lt_query                  TYPE mdm_query_table.
    DATA ls_query                 TYPE mdm_query.
    DATA lv_search_text       TYPE string.
    DATA lt_result_set            TYPE mdm_search_result_table.
    DATA ls_result_set           LIKE LINE OF lt_result_set.
    * Fill query structure with FIRST parameter
        ls_query-parameter_code  = 'Name'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = 'BMW'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    * Fill query structure with SECOND parameter
        ls_query-parameter_code  = 'Model'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = '2009'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    * Query on records (search for value 'BMW' model '2009' in table Products)
        CALL METHOD lr_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Products'                  
            it_query            = lt_query
          IMPORTING
            et_result_set       = lt_result_set.

    Hi,
    I see you are not clearing your local structure "ls_query".  This could be reason of problem,  try this and let us know the result:
    DATA lt_query                  TYPE mdm_query_table.
    DATA ls_query                 TYPE mdm_query.
    DATA lv_search_text       TYPE string.
    DATA lt_result_set            TYPE mdm_search_result_table.
    DATA ls_result_set           LIKE LINE OF lt_result_set.
    Fill query structure with FIRST parameter
        ls_query-parameter_code  = 'Name'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = 'BMW'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Fill query structure with SECOND parameter
        ls_query-parameter_code  = 'Model'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = '2009'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Query on records (search for value 'BMW' model '2009' in table Products)
        CALL METHOD lr_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Products'                  
            it_query            = lt_query
          IMPORTING
            et_result_set       = lt_result_set.

  • How to construct query with null parameters in jpa 2.0

    Hi,
    I am creating a jpa 2.0 application. I have an entity with a large number of fields
    @Entity
    @Table(name="notations")
    public class Notation implements Serializable {
         private static final long serialVersionUID = 1L;
         @Id
         private Integer id;
         @Column(name="action_count")
         private Integer actionCount;
         @Column(name="adaptability_comment")
         private String adaptabilityComment;
         @Column(name="adaptability_score")
         private Integer adaptabilityScore;
         private String comment;
         @Column(name="compatibility_comment")
         private String compatibilityComment;
         @Column(name="compatibility_score")
         private Integer compatibilityScore;
         @Column(name="consistency_comment")
         private String consistencyComment;
         @Column(name="consistency_score")
         private Integer consistencyScore;
         @Column(name="controlpoint_name")
         private String controlpointName;
         @Column(name="device_brand")
         private String deviceBrand;
         @Column(name="device_name")
         private String deviceName;
         @Column(name="error_management_comment")
         private String errorManagementComment;
         @Column(name="error_management_score")
         private Integer errorManagementScore;
         @Column(name="explicit_control_comment")
         private String explicitControlComment;
         @Column(name="explicit_control_score")
         private Integer explicitControlScore;
         @Column(name="functionality_name")
         private String functionalityName;
         @Column(name="guidance_comment")
         private String guidanceComment;
         @Column(name="guidance_score")
         private Integer guidanceScore;
         @Column(name="is_available")
         private Boolean isAvailable;
         private String protocol;
         @Column(name="significance_comment")
         private String significanceComment;
         @Column(name="significance_score")
         private Integer significanceScore;
         @Column(name="tester_name")
         private String testerName;
         @Column(name="use_case_name")
         private String useCaseName;
         @Column(name="workload_comment")
         private String workloadComment;
         @Column(name="workload_score")
         private Integer workloadScore;
            getters, settersI am using a method to update this entity as the user changes different fields. My method takes (almost) all fields, but only one (or few) have values, the others are null.
    public Notation updateNotation(Integer id, Boolean isAvailable, String protocol, String deviceBrand,
                   String deviceName,String testerName, Date ratingDate, String functionalityName,
                   String useCaseName,     String controlPointName, Integer actionCount, String comment,
                   Integer adaptabilityScore, Integer compatibilityScore, Integer consistencyScore,
                   Integer errorManagementScore, Integer explicitControlScore, Integer guidanceScore, Integer significanceScore,
                   Integer workloadScore, String adaptabilityComment, String compatibilityComment,
                   String consistencyComment, String errorManagementComment, String explicitControlComment,
                   String guidanceComment, String significanceComment, String workloadComment) throws PersistenceException{
              String setString = "";
              if(isAvailable != null)
                   setString += "n.isAvailable = '" + isAvailable + "',";
              if(!(protocol==null||protocol.isEmpty()))
                   setString += "n.protocol = '" + protocol + "',";
              if(!(deviceBrand==null||deviceBrand.isEmpty()))
                   setString += "n.deviceBrand = '" + deviceBrand + "',";
              if(!(deviceName==null||deviceName.isEmpty()))
                   setString += "n.deviceName = '" + deviceName + "',";
              if(!(testerName==null||testerName.isEmpty()))
                   setString += "n.testerName = '" + testerName + "',";
              if(!(functionalityName==null||functionalityName.isEmpty()))
                   setString += "n.functionalityName = '" + functionalityName + "',";
              if(!(useCaseName==null||useCaseName.isEmpty()))
                   setString += "n.useCaseName = '" + useCaseName + "',";
              if(!(controlPointName==null||controlPointName.isEmpty()))
                   setString += "n.controlPointName = '" + controlPointName + "',";
              if(actionCount != null)
                   setString += "n.actionCount = '" + actionCount + "',";
              if(!(comment==null||comment.isEmpty()))
                   setString += "n.comment = '" + comment + "',";
              if(adaptabilityScore != null)
                   setString += "n.adaptabilityScore = '" + adaptabilityScore + "',";
              if(compatibilityScore != null)
                   setString += "n.compatibilityScore = '" + compatibilityScore + "',";
              if(consistencyScore != null)
                   setString += "n.consistencyScore = '" + consistencyScore + "',";
              if(errorManagementScore != null)
                   setString += "n.errorManagementScore = '" + errorManagementScore + "',";
              if(explicitControlScore != null)
                   setString += "n.explicitControlScore = '" + explicitControlScore + "',";
              if(guidanceScore != null)
                   setString += "n.guidanceScore = '" + guidanceScore + "',";
              if(significanceScore != null)
                   setString += "n.significanceScore = '" + significanceScore + "',";
              if(workloadScore != null)
                   setString += "n.workloadScore = '" + workloadScore + "',";
              if(!(adaptabilityComment==null||adaptabilityComment.isEmpty()))
                   setString += "n.adaptabilityComment = '" + adaptabilityComment + "',";
              if(!(compatibilityComment==null||compatibilityComment.isEmpty()))
                   setString += "n.compatibilityComment = '" + compatibilityComment + "',";
              if(!(consistencyComment==null||consistencyComment.isEmpty()))
                   setString += "n.consistencyComment = '" + consistencyComment + "',";
              if(!(errorManagementComment==null||errorManagementComment.isEmpty()))
                   setString += "n.errorManagementComment = '" + errorManagementComment + "',";
              if(!(explicitControlComment==null||explicitControlComment.isEmpty()))
                   setString += "n.explicitControlComment = '" + explicitControlComment + "',";
              if(!(guidanceComment==null||guidanceComment.isEmpty()))
                   setString += "n.guidanceComment = '" + guidanceComment + "',";
              if(!(significanceComment==null||significanceComment.isEmpty()))
                   setString += "n.significanceComment = '" + significanceComment + "',";
              if(!(workloadComment==null||workloadComment.isEmpty()))
                   setString += "n.workloadComment = '" + workloadComment + "',";
              if(setString!="") setString = setString.substring(0, setString.length()-1);
              String queryString = "UPDATE Notation n SET " + setString + " WHERE n.id = ?1";
              Query q = em.createQuery(queryString);
              q.setParameter(1, id);
              q.executeUpdate();
              return (Notation) em.createQuery("SELECT n FROM Notation n WHERE n.id = ?1").setParameter(1, id).getResultList().get(0);
         }So my question I think is somewhat obvious. What is a good way to construct my query, so that I am not forced to have such an ugly and laborious code (again, knowing that most of the arguments are null)?
    Thanks in advance
    Edited by: StefanC on Jan 27, 2010 3:01 AM

    That is a good point, I will do the operations directly on the entity. However, that still doesn't save me from having to write all those if statements and having an ugly code.
    Husain.AlKhamis wrote:
    Exactly, this is the concept behind JPA --> you have to write zero SQL queries.It's true that you don't have to write any queries for update and remove, however you still have to write JPQL queries (pretty much like SQL) to selections.

  • Query with input parameters (as int)

    Hello all,
    I am trying to run the following query but i keep getting the following message:
    Conversion failed when converting the varchar value '[%0]' to data type int.
    in SQL 2005.
    I understand what the error is saying i just cant find a way to pass a parameter as a int?
    Any help would be appreciated.
    declare @PONum int
    declare @DocEntry int
    declare @POLine int
    declare @WONum int
    declare @WOLine int
    SELECT @PONum = T0.DocNum FROM OPOR T0 WHERE T0.DocNum = '[%0]'
    SELECT @DocEntry = T1.DocEntry FROM OPOR T1 WHERE DocNum  =  @PONum
    SELECT @POLine = T2.LineNum FROM POR1 T2 WHERE T2.DocEntry = @DocEntry and T2.LineNum  = '[%1]'
    select @WONum = T3.U_WO from [@CDIJCHDR] T3 WHERE T3.U_WO = '[%2]'
    select @WOLine = T4.U_Line from [@CDIJCHDR] T4 WHERE T4.U_WO = @WONum and T4.U_Line ='[%3]'
    Update [@CDIPOWO]
    set   [@CDIPOWO].U_WO = @WONum,
           [@CDIPOWO].U_WOLine = @WOLine
    where [@CDIPOWO].U_PO = @PONum
      and [@CDIPOWO].U_POLine = @POLine
      and [@CDIPOWO].U_QtyRecvd = 0
    and @WONum > 0
    update [@CDIJCEST]
    set [@CDIJCEST].U_WO = @WONum,
         [@CDIJCEST].U_Line = @WOLine
    from [@CDIJCEST]
    where [@CDIJCEST].U_3DREF = 'P'
       and [@CDIJCEST].U_3DDocNum = @PONum
       and [@CDIJCEST].U_3DDocLn = @POLine
       and @WONum > 0
    -Chuck

    Hi Charles,
    Where are you running this query (ie SBO or SQL Management Studio)? This is exactly the error you will get if you try running this query in SQL Management Studio, outside of SBO. This is because [%0] is SBO syntax and is not recognised as a parameter in SQL.
    Kind Regards,
    Owen

  • Portlet Chart error message with page parameters

    I have a perplexing problem.
    We're using portal 9.0.4. I've created a chart from a sql query using the portal builder tools. It's a complicated query with two parameters that have default values defined. The chart will run as a portlet from the portal provider edit page just fine.
    I can place the chart portlet on a page without hooking up the page parameters and it runs just fine from the default values. However, when I hook up the page parameters to the chart parameters from the page properties area, the chart no longer works. It displays "Error Message" in the portlet header area with no other error messages. The other portlets continue to work just fine.
    I've double checked the page parameter settings. I've built a second chart, and the same thing happens when I hook up the page parameters to the portlet on the page.
    I traced through the portlet code in the generated package, and it seems to be failing on this statement:
    l_cursor := PORTAL.wwv_user_utilities.bind_query (
    p_module_id => 1182363588,
    p_query => l_query,
    p_arg_names => l_arg_names,
    p_arg_values => l_arg_values,
    p_bind_vars => PORTAL.wwv_standard_util.string_to_table2('p_grp_id:p_org_id'),
    p_var_types => PORTAL.wwv_standard_util.string_to_table2('ARRAY:ARRAY'),
    p_bind_null => true,
    p_mode => p_mode,
    p_prefix => p_reference_path);
    If I comment this line and everything after it out, the portlet runs, although none of the chart is displayed the portlet header shows the correct title. If I uncomment this particular line, then the portlet errors out with a "Error: The listener returned the following Message: 404 Not Found" message.
    Anyone have any ideas please??

    Look at your code. Count <body> tags. How many do you
    get? Yeah - that's
    wrong. You didn't follow the video....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "camelbreath" <[email protected]> wrote in
    message
    news:g680gh$3c$[email protected]..
    > I'm not sure if this is a PM issue or a DWCS3 issue. The
    only way to find
    > out
    > is to ask.
    > I have gone through the process of creating a a library
    item of a
    > PopMagic menu according the the video provided by P7.
    Works well.
    > Then I added the library item to an existing DWCS3
    template and saved
    > it. When I attempt to create "new from template" page
    from the template
    > menu, I get this error message
    >
    >
    http://www.jdcdemo.com/blf/error.html
    >
    > If I do the same with a template without the menu, the
    > error message goes away.
    >
    > If I create a page with from a template where I've left
    an editable
    > region for the menu and then insert the menu and save
    the page, I also
    > get the error message, but the page seems to work ok.
    >
    > Since I can't create a new page with the template, I
    opened it and saved
    > it as
    > a page:
    >
    >
    http://www.jdcdemo.com/baim/BLF8/error-message.html
    >
    > What is going on here and is there a fix?
    >
    > Thanks,
    > Joe
    >

  • How to write sql query with many parameter in ireport

    hai,
    i'm a new user in ireport.how to write sql query with many parameters in ireport's report query?i already know to create a parameter like(select * from payment where entity=$P{entity}.
    but i don't know to create query if more than 1 parameter.i also have parameter such as
    $P{entity},$P{id},$P{ic}.please help me for this.
    thanks

    You are in the wrong place. The ireport support forum may be found here
    http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=showcat&catid=9

  • How to write a SQL query in SAP B1 2007 B with input parameters?

    How to write a SQL query in SAP B1 2007 B with input parameters, on execution of which will ask for some input value from the user and the values will be selected from a list such as item list?

    The syntax like
    SELECT * FROM OITM T0 WHERE T0.ItemCode = '[%0\]'
    Thanks,
    Gordon

  • How do I create a folder or report from a query with a union and parameters

    I have created folders with unions but I am having difficulty coverting a query with a union and parameters.
    The following works great in SQL*Developer without parameters, but I want to change to use parameters for the year and quarter and use it in Discoverer:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
      AV.FIRM_NAME VENDOR_NAME,
      AV.BIDCLASS CONTRACT_CODES,
      AV.AWAMT AWARD_AMOUNT,
      AV.SOL_MODE FORMAL_INFORMAL,
      AV.CERT BUSINESS_ENTITY,
      AV.ETHNICITY ETHNICTY,
      AV.PO_NUMBER_FORMAT CONTRACT,
      SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
      CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID       = VP.VENDOR_ID ) )
    AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')
    AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
      AV.FIRM_NAME,
      AV.BIDCLASS,
      AV.AWAMT,
      AV.SOL_MODE,
      AV.CERT,
      AV.ETHNICITY,
      AV.PO_NUMBER_FORMAT
      union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
      AV2.FIRM_NAME VENDOR_NAME,
      AV2.BIDCLASS CONTRACT_CODES,
      AV2.AWAMT AWARD_AMOUNT,
      AV2.SOL_MODE FORMAL_INFORMAL,
      AV2.CERT BUSINESS_ENTITY,
      AV2.ETHNICITY ETHNICTY,
      AV2.PO_NUMBER_FORMAT CONTRACT,
      0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
                  FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
                 WHERE av2.po_number = vp2.po_number
                       AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = '4')
                       AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = '2009' ))
    AND (TO_CHAR(AV2.AWDATE,'Q') = '4')
    AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
      AV2.FIRM_NAME,
      AV2.BIDCLASS,
      AV2.AWAMT,
      AV2.SOL_MODE,
      AV2.CERT,
      AV2.ETHNICITY,
      AV2.PO_NUMBER_FORMAT Can someone provide a solution?
    Thank you,
    Robert

    Hi,
    You can take the parameters to the select so that you will be able to create conditions over them.
    Try to use this SQL instead of your and in the discoverer workbook create the conditions and parameters:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
    AV.FIRM_NAME VENDOR_NAME,
    AV.BIDCLASS CONTRACT_CODES,
    AV.AWAMT AWARD_AMOUNT,
    AV.SOL_MODE FORMAL_INFORMAL,
    AV.CERT BUSINESS_ENTITY,
    AV.ETHNICITY ETHNICTY,
    AV.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
    CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID = VP.VENDOR_ID ) )
    --AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')*
    --AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )*
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
    AV.FIRM_NAME,
    AV.BIDCLASS,
    AV.AWAMT,
    AV.SOL_MODE,
    AV.CERT,
    AV.ETHNICITY,
    AV.PO_NUMBER_FORMAT ,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
    AV2.FIRM_NAME VENDOR_NAME,
    AV2.BIDCLASS CONTRACT_CODES,
    AV2.AWAMT AWARD_AMOUNT,
    AV2.SOL_MODE FORMAL_INFORMAL,
    AV2.CERT BUSINESS_ENTITY,
    AV2.ETHNICITY ETHNICTY,
    AV2.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
    FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
    WHERE av2.po_number = vp2.po_number
    AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = TO_CHAR(VP.PAYMENT_DATE,'Q') )
    AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = TO_CHAR(VP.PAYMENT_DATE,'YYYY') ))
    --AND (TO_CHAR(AV2.AWDATE,'Q') = '4')*
    --AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')*
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
    AV2.FIRM_NAME,
    AV2.BIDCLASS,
    AV2.AWAMT,
    AV2.SOL_MODE,
    AV2.CERT,
    AV2.ETHNICITY,
    AV2.PO_NUMBER_FORMAT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    Tamir

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • ADF how can i execute a query with parameters when the page renders

    hi
    i am using ADF web 11g
    i need to execute a query with parameters when the page renders
    thanks

    hello,
    I'm a fan of Java code, I really am.
    But when you use ADF, you decided to move to a more declarative environment.
    So why not do it declarative, the adf way?
    In your pagedef insert a action binding.
    This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
    Create an invokeAction in your pagedef and set the condition.
    This example refreshes(Action 2 is execute query) the data.
    First the method binding:
        <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
                DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
        <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
    -Anton
    PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

Maybe you are looking for

  • CRviewer do not show anything when click button to show report with VS2013

    First of all I must say, My English language skill is not good but I'll try to communicate as best as possible. I am using Visual Studio 2013Ultimate with Update4  on .NetFramework 4.5.1  and Crystal Reports SP13.0.13.1597 When installed complete. (

  • What's the best way to trim a video file?

    I have a big mov file (143 GB). I just need to trim a part of that file quickly. I tried to trim and save it as an mp4 but the quality turned out awful. I just trimmed and saved it as an mov but it's taking forever. Is there any quicker way I can do

  • Add Managed By AD value to Local Administrator group.

    Hi, I'd like to add the user account of the AD computer's Managed by attribute to the Local Administrator Group. Could that  be done via GPP? Thanks in advance.

  • Forecast on Material Components

    Hello. I am executing a forecast on a simple project to try and understand the functionality of the forecast. There is 1 WBS with an Internal Activity with a Material Component assigned. There is no work (ie. work center and hours) on the internal ac

  • IMac 27" screen size without Stand

    Hi there, well I just wanna know the actual size without the stand, the size that appears on the site are with the stand, and I need to know the size without it since I´m going to place the iMac in a Vesa Mount, it would be great if someone can provi