Query object

Hi Experts,
I am really stuck on this issue now.
I am trying to get an attribute of BuilMarketing object(Industry attribute) on my lead screen corresponding to the prospect selected.
I am using query object for this.I am writing this code in the event handler EH_ONSEL_PROSPECT(I have redefined it).I am writing such code for the first time and i m really stuck.I am getting syntax error:
Method "GET_PROPERTY_AS_VALUE" is unknown or PROTECTED or PRIVATE.     
Is my approach correct.
Please help me!!!     
method EH_ONSEL_PROSPECT.
CALL METHOD SUPER->EH_ONSEL_PROSPECT
  EXPORTING
    HTMLB_EVENT    = HTMLB_EVENT
   HTMLB_EVENT_EX = HTMLB_EVENT_EX
DATA : industry(4) type c,
       query_service      TYPE REF TO  cl_crm_bol_dquery_service,
       query_result        TYPE REF TO if_bol_entity_col,
       lr_builheader       TYPE REF TO cl_crm_bol_entity,
       lv_builbc           TYPE REF TO if_bol_entity_col,
       lr_partnerno        TYPE string.
query_service = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
  IF query_service IS BOUND.
    CALL METHOD query_service->add_selection_param
      EXPORTING
        iv_attr_name = 'PARTNER'
        iv_sign      = 'I'
        iv_option    = 'EQ'
        iv_low       = lr_partnerno.
    query_result = query_service->get_query_result( ).
    lr_builheader = query_result->get_first( ).
    endif.
CHECK lr_builheader IS BOUND.
    lv_builbc = lr_builheader->get_related_entities( iv_relation_name = 'BuilMarketingRel').
lv_builbc->get_property_as_value( EXPORTING iv_attr_name = 'INDUSTRY'
                         IMPORTING ev_result    = industry ).
call method lv_builbc->set_property (iv_attr_name = 'INDUSTRY' iv_value = ev_result ).
endmethod.

the query object implements a lot of interfaces, including "DataSource":
So best way is retrieve the Query object is by using the MDRoot: this one has a lookup method, which can be used to "load" the query object. afterwards you can assign it to a crosstab,graph,etc...
regards,
thomas

Similar Messages

  • Problem with return a ColdFusion query object from a Java class

    Hi!
    I need to return a ColdFusion query object from a Java class
    using a JDBC result set ( java.sql.ResultSet);
    I have tried to pass my JDBC result set in to the constructor
    of the coldfusion.sql.QueryTable class with this code:
    ColdFusion code
    <cfset pra = createObject("java","QueryUtil").init()>
    <cfset newQuery = CreateObject("java",
    "coldfusion.sql.QueryTable")>
    <cfset newQuery.init( pra.getColdFusionQuery () ) >
    My java class execute a query to db and return QueryTable
    Java code (QueryUtil.java)
    import coldfusion.sql.QueryTable; // (CFusion.jar for class
    QueryTable)
    import com.allaire.cfx //(cfx.jar for class Query used from
    QueryTable)
    public class QueryUtil
    public static coldfusion.sql.QueryTable
    getColdFusionQuery(java.sql.ResultSet rs)
    return new coldfusion.sql.QueryTable(rs);
    but when i run cfm page and coldfusion server tries to
    execute : "<cfset pra =
    createObject("java","QueryUtil").init()>" this error appears:
    Object Instantiation Exception.
    An exception occurred when instantiating a java object. The
    cause of this exception was that: coldfusion/sql/QueryTable.
    If i try to execute QueryUtil.java with Eclipse all it works.
    Also I have tried to return java.sql.ResultSet directly to
    coldfusion.sql.QueryTable.init () with failure.
    Do you know some other solution?

    ok
    i print all my code
    pratica.java execute a query to db and return a querytable
    java class
    import java.util.*;
    import java.sql.*;
    import coldfusion.sql.*;
    public class Pratica {
    private HashMap my;
    private String URI,LOGIN,PWD,DRIVER;
    private Connection conn=null;
    //funzione init
    //riceve due strutture converite in hashmap
    // globals
    // dbprop
    public Pratica(HashMap globals,HashMap dbprop) {
    my = new HashMap();
    my.put("GLOBALS",globals);
    my.put("DBPROP",dbprop);
    URI = "jdbc:sqlserver://it-bra-s0016;databaseName=nmobl";
    LOGIN = "usr_dev";
    PWD = "developer";
    DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    try{
    // Carico il driver JDBC per la connessione con il database
    MySQL
    Class.forName(DRIVER);
    /* Connessione alla base di dati */
    conn=DriverManager.getConnection(URI,LOGIN,PWD);
    if(conn!=null) System.out.println("Connection Successful!");
    } catch (ClassNotFoundException e) {
    // Could not find the database driver
    System.out.print("\ndriver non trovato "+e.getMessage());
    System.out.flush();
    catch (SQLException e) {
    // Could not connect to the database
    System.out.print("\nConnessione fallita "+e.getMessage());
    System.out.flush();
    //funzione search
    //riceve un hash map con i filtri di ricerca
    public QueryTable search(/*HashMap arg*/) {
    ResultSet rs=null;
    Statement stmt=null;
    QueryTable ret=null;
    String query="SELECT * FROM TAN100pratiche";
    try{
    stmt = conn.createStatement();// Creo lo Statement per
    l'esecuzione della query
    rs=stmt.executeQuery(query);
    // while (rs.next()) {
    // System.out.println(rs.getString("descrizione"));
    catch (Exception e) {
    e.printStackTrace();
    try {
    ret = Pratica.RsToQueryTable(rs);
    } catch (SQLException e) {
    e.printStackTrace();
    this.close();
    return(ret);
    // ret=this.RsToQuery(rs);
    // this.close(); //chiude le connessioni,recordset e
    statament
    //retstruct CF vede HashMap come struct
    //METODO DI TEST
    public HashMap retstruct(){
    return(my);
    //conversione resultset to querytable
    private static QueryTable RsToQueryTable(ResultSet rs)
    throws SQLException{
    return new QueryTable(rs);
    //chiura resultset statament e connessione
    private void close(){
    try{
    conn.close();
    conn=null;
    catch (Exception e) {
    e.printStackTrace();
    coldfusion code
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN">
    <html>
    <head>
    <title>Test JDBC CFML Using CFScript</title>
    </head>
    <body>
    <cftry>
    <cfset glb_map =
    createObject("java","java.util.HashMap")>
    <cfset dbprop_map =
    createObject("java","java.util.HashMap")>
    <cfset glb_map.init(glb)> <!---are passed from
    another page--->
    <cfset dbprop_map.init(glb["DBPROP"])>
    <cfset pra =
    createObject("java","Pratica").init(glb_map,dbprop_map)>
    <cfset ourQuery
    =createObject("java","coldfusion.sql.QueryTable").init(pra.search())>
    <cfcatch>
    <h2>Error - info below</h2>
    <cfdump var="#cfcatch#"><cfabort>
    </cfcatch>
    </cftry>
    <h2>Success - statement dumped below</h2>
    <cfdump var="#ourQuery#">
    </body>
    </html>
    error at line <cfset pra =
    createObject("java","Pratica").init(glb_map,dbprop_map)>
    An exception occurred when instantiating a java object. The
    cause of this exception was that: coldfusion/sql/QueryTable.
    -----------------------------------------------------------------------

  • Query object problem

    I create a query object and then I'm trying to populate the
    object with data, but I get the following error:
    "Query objects cannot be modified, they can only be
    displayed".
    \wwwroot\bracketWinners\publish\publish3.cfm: line 27
    25 : <cfset a = evaluate("FORM.#i##j#")>
    26 : #a#<br />
    27 : <cfset qMatches[ i ][ j ] = a />
    28 : </cfloop>
    29 : </cfloop>
    Here is my code:

    Holy cow! Nevermind.

  • How to enhance Dynamic Query Object TerrSearch (Territory Management)?

    Hello Friends,
    In the TerrSearch dynamic query object, There are 2 fields Territory_ID and Level_ID. Now i have a requirement to Enhance the Search object using the new field called TERRITORY PATH ID. using which we can search all the entities not only for the terrritory level which we have selected (for example we have assigned the value '01' to LEVEL_ID) but also all the below territory levels of selected territory level.
    If we enhance the search object structure CRMST_TMIL_SEARCH (structure of TerrSearch object) using AET to add the Z field called TERRITORY_PATH_ID then which is the suitable BADI where we can add the necessary code to select all the entities based on all the territory levels below the selected territory level.
    Please guide me friends how to enhance the TerrSearch object.

    Hi friend,
    Try using MACRO and dynamic WHERE condition.
    Group simialr Select statements under a Macro.
    Build a dynamic where by checking conditions
    Call macro passing dynamic where condition.
    TABLES afpo.
    DATA: str TYPE string.
    *Macro definition
    DEFINE operation.
      select single *
           from afpo into afpo
           where (&1).    " Dynamic condition
    END-OF-DEFINITION.
    *Build dynamic WHERE by checking some conditions
    *If conditon 
    CONCATENATE 'AUFNR = ''000000700008''' 'AND POSNR = ''0001''' INTO str SEPARATED BY space.
    *Else
    CONCATENATE 'AUFNR = ''000000700008''' 'AND POSNR = ''0002''' INTO str SEPARATED BY space.
    *Endif.
    *Call Macro passing dynamic WHERE condition
    operation str.

  • Translation of all query objects

    Hello,
    We have a requirement to translate all the query objects in 10 languages and this needs to be done for many queries. So manual translation of all the query objects is not a feasible solution.
    We have checked the table RSZELTXREF and it seems that we are getting all the query elements belonging to the multiprovider. Although all these objects are not present in the text table RSZELTTXT. So we are not able to identify all the text elements belonging to certain query.
    It would be nice if someone can help with any quick method for translating the texts for all query elements.
    Thank you.
    Prithwish

    Actually links are not suppose to be asked in SCN. Since you asked, I am giving you now..I have simply searched with the title which I gave you in SCN search and got it.
    How To Translate Business Intelligence Objects (NW7.0)

  • Query object in main page available to iframe?

    Hello, everyone.
    What is the best way to make a query object in a document available to an iframe (with a .cfm file as the source of the iframe) in that document?
    Thanks,
    ^_^

    >> So, which is best, Application scope, or Session scope?
    If the data is user specific, then probably the session scope. Performance-wise, either one should be fine.
    >> And will a simple CFSET SESSION.VariableName = CFQUERYOBJECT work?  I didn't think a simple variable could contain a complex object?
    What makes a variable simple or complex is its content. 
    <cfset session.key = 1 /> Creates a simple variable
    <cfset session.key = structNew() /> Creates a complex variable
    Yes, session.key = queryObject will work just find.

  • Difficulty parsing XML document into query object

    Background: Using CFMX 6.1 to take an XML file exported from
    MS-Access and parse it into a query object.
    Problem: Of the 6 columns defined in the target query, one of
    the columns is only populated in the XML file a very low percentage
    of the time. When trying to populate the column for a record that
    has no volume I was getting the following error:
    Element KEY6.XMLTEXT is undefined in a Java object of type
    class coldfusion.xml.XmlNodeMap referenced as...
    To get around this I made this code change:
    Before
    <cfset temp = QuerySetCell(mcquery, "CuKey6",
    #mydoc.root.dataroot.qTop1000
    .Key6.XmlText#, #i#)>
    After
    <cfif
    StructKeyExists(mydoc.root.dataroot.qTop1000.XMLAttributes,"Key6")>
    <cfset temp = QuerySetCell(mcquery, "CuKey6",
    #mydoc.root.dataroot.qTop1000
    .Key6.XmlText#, #i#)>
    </cfif>
    The new code gets around the error, but when the template is
    executed, columns that DO have values
    show up as "[empty string]".
    I am trying to figure out why when the record has a actual
    value it is now overwritten instead of populated
    normally?

    Use XmlChildren[1], XmlChildren[2],... etc., in place of
    Key1, Key2, etc.

  • BOL Search/Query Object for Schema Search!.

    Hi All,
    I have to do search for categorization schemas, as the first step I opened the standard schema search component ( GS_MCAT ) and found that the Dynamic Search Object responsible for the same is:   'MC_DynaQSchemaByAttributes'.
    Now, I have 2 questions 4u
    1.  If I run the BOL browser by giving the component set as 'all' I couldnt see this query!. how can I find
    this in BOL/MODEL browser
    2. Is there any standard BOL Search/Query Object on which I can perform a search on Schema based on the product assigned at the categorization level!.
    Any help/hint highly appreciated!,
    Thanks in Advance, Sudeep..

    Also solved.
    As SAP tends to confuse people with the "ALL" component set, ...
    I debugged the "CL_CRM_CATEGO_GENIL" class. Here's the component set you need to load:
        lv_core->start_up( 'ONEORDER' ).

  • Can you use a query object in QOQ Query?

    Hi, I have a component with two functions. One does a query
    and simply returns the query object (getItem), the other function
    in this CFC needs to query this query object by using a QOQ.
    However, it's choking on the part of the "FROM" in the getItemTitle
    function. Am I calling the internal function incorrectly?
    If I dump the results of the getItem function it returns the
    query correctly. So the problem is definately with the QOQ query. I
    have attached my CFC code.
    Thanks,
    Mikey.

    Heya Dan,
    Taking away the #'s doesn't solve it, cos it then throws an
    error about the ()'s I also tried taking them out but no luck.
    Here's my latest code, which STILL gives the same error. I'm
    confused. Porbably missing something really simple here.
    Thanks,
    Mikey.
    <cfcomponent hint="item" displayname="item"
    output="false">
    <cffunction name="init" returntype="item" output="false"
    access="public">
    <cfargument name="itemID" type="numeric" required="true"
    />
    <cfset variables.itemID = arguments.itemID />
    <cfreturn this />
    </cffunction>
    <cffunction name="getItem" returntype="query"
    output="true" access="public" displayname="getItem">
    <cfset var local = {} />
    <cfquery name="local.item" datasource="#request.dsn#"
    username="#request.username#" password="#request.password#">
    SELECT *
    FROM items
    WHERE itemID = <cfqueryparam value="#variables.itemID#"
    cfsqltype="cf_sql_integer" />
    </cfquery>
    <cfreturn local.item />
    </cffunction>
    <cffunction name="getItemTitle" returntype="string"
    output="true" access="public" displayname="getItemTitle">
    <cfset var local = {} />
    <cfset local.itemObject = getItem() />
    <cfquery name="local.item" dbtype="query">
    SELECT itemTitle
    FROM #local.itemObject#
    </cfquery>
    <cfreturn local.item.itemTitle />
    </cffunction>
    </cfcomponent>

  • Enhancing a Dynamic Query Object

    Hi All,
    I've added a new field to the contract header using the EEWB, I then added the field to an append on the dynamic query object BTQSrvCon. The entry in CRMC_REPDY and the BADI implementation of BADI CRM_RF_SEARCH_EEW have been created automatically.
    This is working fine when I use the 'IS' separator on the search screen and enter the field exactly.
    I would like to use the dynamic query separators (contains, starts with etc.) but when I try I get the error message
    Search contains fields where wild card search is not allowed
    Has anyone implemented this functionality?
    Thanks,
    Gregor

    The range operator is in the generated code:
    method IF_EX_CRM_RF_SEARCH_EEW~EXTEND_RF_QUERY.
    INCLUDE crm_object_names_con.
    DATA: lv_fieldname       TYPE name_komp,
           ls_qupart          LIKE LINE  OF ct_quparts,
           ls_qupart_and      LIKE LINE  OF ct_quparts,
           ls_range_value     TYPE crmt_bsp_range.
    READ TABLE it_range_value INDEX 1
       INTO ls_range_value.
    IF sy-subrc <> 0.
       RETURN.
    ENDIF.
    CHECK NOT ls_range_value-low IS INITIAL.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_token  = 'AND'
       IMPORTING
         ev_qupart = ls_qupart_and-querypart.
    lv_fieldname = flt_val.
    CALL METHOD cl_crm_report_qupart=>get_qupart_by_token
       EXPORTING
         iv_entityname = gc_objectname_reporting-ORDERADM_H
         iv_fieldname  = lv_fieldname
         iv_token      = 'RAN'
         it_rangetab   = it_range_value
       IMPORTING
         ev_qupart     = ls_qupart-querypart.
    APPEND ls_qupart     TO ct_quparts.
    APPEND ls_qupart_and TO ct_quparts.
    endmethod.
    I've put a break in the code which is not being triggered so something may be up with the BADI implementation.

  • Ora-00942 when querying object privs

    Hi, I have a OEM 9.2 accessing an Oracle 9.2 instance. When querying object privs I get error 942. All else works OK. I have 07_dictionary_accesibility=true and the OEM user has DBA and select any dictionary privs. oms.nohup does not show anything unusual neither dbsnmp.log . Any ideas?

    there will still be some sys objects that may throw this

  • Maximum Query Objects within a report...

    Hello Everyone,
    We have done several reports that contained one or two data model query objects, however, we are presented with the following task:
    We have to output the following:
    a) a single PDF document, approx. 200 pages generated from a web (url) request.
    -----> piece of cake, we do this for smaller reports now.
    b) this document will have about 50 sources, e.g. 50 queries necessary to run it.
    Question 1: is it possible to to have one "master" report that calls a bunch of other oracle reports AND maintains one page number sequence for the whole thing being output to the resultant PDF?
    Question 2: if we can NOT get sequential page numbers via the method above, what is the maximum number of
    ----> data model query objects
    ----> data model user parameters
    per report.
    Question 3: is it possible to have multiple modules for a single report call that would maintain page numbers across module outputs? Further, would parameters supplied to this big call make it to the proper modules-- module1 needs parms 1,2 and 3... module2 needs parms 4,5, and 6... module3 needs parms 5,6 and 7 for example.
    Any insight available would be greatly appreciated,

    Question 1: is it possible to to have one "master" report that calls a bunch of other oracle reports AND maintains one page number sequence for the whole thing being output to the resultant PDF?It's possible to have one master report that calls other reports, but it's not possible to do this and have one single PDF file produced.
    Question 2: if we can NOT get sequential page numbers via the method above, what is the maximum number of
    ----> data model query objects
    ----> data model user parameters
    per report.There aren't any published maximums for this (and you should be okay with 50 queries - although I can't vouch for the performance of this!)
    Question 3: is it possible to have multiple modules for a single report call that would maintain page numbers across module outputs? Further, would parameters supplied to this big call make it to the proper modules-- module1 needs parms 1,2 and 3... module2 needs parms 4,5, and 6... module3 needs parms 5,6 and 7 for example.Not sure that I understand the question.
    Just one more thing to think about - if you're running this on the web you should probably run it on a schedule and serve up a cached version 'on demand' - this way the users aren't waiting for this mammoth report to complete.
    Hope this helps,
    Danny

  • Query object java method issue

    MyUsernameQuery['userNames'].indexOf('tomjones') will find
    the tomjones
    value in the query.
    BUT:
    MyUsernameQuery['id'].indexOf(99) won't find the numeric
    index value, even
    though it's in the record set.
    BUT WAIT, THERE'S MORE:
    If I manually build a query object with integer values and
    try a similar
    search for the numeric id value,it finds it!
    What's up with that?
    If it was a casting issue, why would it find it in the
    manually built object
    and NOT in the query object?
    I tried casting the integer as a string but no luck.
    I'm in over my head with these methods. Any help much
    appreciated.
    Cheers,
    Lossed
    __when the only tool you have is a hammer, everything looks
    like a nail __

    I should point out that the relative processing speeds are
    dependant upon
    the size of the recordset and position in that recordset of
    the value being
    searching for.
    "Lossed" <[email protected]> wrote in message
    news:eucai4$lhj$[email protected]..
    > It was indeed the casting.
    > I had to cast it as 'long'.
    > There are other ways to find if the value exists:
    > convert column array to list and listfindnocase(), Q of
    Q, loop over
    > query. I was trying to find the fastest. the underlying
    java indexOf()
    > method seems to leave the others in it's dust :).
    >
    > "cf_dev2" <[email protected]> wrote in
    message
    > news:euc51t$epr$[email protected]..
    >>> I'm in over my head with these methods
    >>
    >> Doesn't answer your question, but is indexOf()
    really the only way to get
    >> the
    >> job done? Just wondering if there is an easier way.
    >>
    >> The undocumented stuff is neat, but the java methods
    tend to be stricter
    >> about
    >> object type and case than many of the standard CF
    functions. Two things
    >> may
    >> appear the same but that doesn't mean they are the
    same to java. It can
    >> trip
    >> you up ;)
    >>
    >> That could be the problem with your number column.
    You didn't mention the
    >> column type but some numeric data types don't map to
    a java integer. For
    >> example a biginteger column might map to a java
    long. In which case
    >> searching
    >> for an integer wouldn't work. So it could still be a
    casting
    >> problem
    >>
    >>
    >
    >

  • What is Dynamic query object ?

    Hi All,
    I want to know what is the exact purpose of a Dynamic Query object ?
    Why cant we use a simple Query object instead ?
    Regards,
    Ashish

    Hello experts,
    i modified the method EH_ONSEARCH in the class ZL_BT111S_O_SEARCH_IMPL. This is the opportunity search.
    We want to exclude the process type ZCRA. I realized this with following code snippet:
    CALL METHOD lr_qs->add_selection_param
          EXPORTING
            iv_attr_name = 'PROCESS_TYPE'
            iv_sign      = 'I'
            iv_option    = 'NE'
            iv_low       = 'ZCRA'.
    There is also a field in the search mask for selecting the process type. For example, i select the process type ZOPP in the mask. If i do this, i get ALL opportunites. I found the reason. The search query looks like this:
    PROCESS_TYPE      I      NE     ZCRA
    OR <--- this is the error
    PROCESS_TYPE     I       EQ      ZOPP
    How can i make an AND-conjunction? The dynamic search object BTQOPP has an parameter MATCH_TYPE but i dont know how to fill out this parameters?
    Best regards
    Sascha Federau

  • Relation between Query Object and InfoObject

    Someone know the sap bw 3.5 table with the association between Query Object and InfoObjects/Calculated Variables used in?
    Thanks a lot!
    Emiliano

    Can you explain what you mean with try rsrt->query name?
    There are no interesting tables with RSRT prefix name.
    Thanks
    Emiliano

Maybe you are looking for

  • Using image data read out from a file

    Hi, Having used the GetBitmapFromFileEx(), GetBitmapInfoEx() to acquire the necessary image data (most of them is the .png format), then using the FileToArray() to put the image data in my own binary file, e.g., "mypicture.dat". My idea is that whene

  • How to update a list item through Sharepoint Designer Workflow?

    Hi, I have a created a list, in which "Completion date" column is there. Now I want to update column "Completion Date" through SPD, specifies value(date) after 10 days of created date of a record in list. Please help. Thanks in advance

  • Dynamic DDL execution using DBMS_SQL

    Hello, I've done a set of PL/SQL blocks that helps me to automate some tasks of my schema for better productivity. It concerns the most of the time : - activate/deactivate foreign keys and constraints - delete and recreate a set of objects - etc My r

  • ABAP for CRM

    Hi, I like to know about CRM ABAP. I know, it's a language and there is nothing like CRM ABAP. More specifically, I like to know the way and the rules for writing a program in ABAP for CRM. It will be very helpful if any one can provide some  documen

  • Can iCloud be used as a backup for iBank data?

    can iCloud be used as a backup for iBank data?