How to map complex queries to ADF

I have an SQL query that I would like to map to ADF business components but am having difficulty.
The query is:
SELECT ENTA.KEYA, ENTA.ATTA1, ENTB.ATTB1 FROM ENTA, ENTB WHERE (ENTA.KEYA = '?') AND (ENTA.ATTA2 = ENTB.KEYB) AND (ENTA.ATTA1 BETWEEN ? AND (SELECT MIN(ENTA.ATTA1) FROM ENTA , ENTB WHERE (ENTA.ATTA2 = ENTB.KEYB) AND (ENTB.ATTB2 = 'D') AND (ENTA.KEYA = '?') AND (ENTA.ATTA1 >= ?)))
I don't know if I should use one view object for the inner query or one view object for the whole query. Whatever I try I still have problems with the ViewLink.
To make matters more complicated parameters 1 and 3 are identical as are parameters 2 and 4.
Can anyone help?

Stephen,
if the problem is that you cannot execute the query in teh BC4J tester, then this is because it doesn't support testing with parameters.
Another way of doing what you want is to create two EO and then have the VO select the attributes from both. However, to do the filtering you still need to add parameters to the query.
Frank

Similar Messages

  • How to write complex queries in ejb2.0

    Hi ,
    i want to write query for search option since query depend on options choosen by user so the query is created dynamically i.e search params(table colums) may differ
    .Hence i cant use ejb-ql ..... can i use hibernate if yes how can i configure ejb to use hibernate ... else is there any other way
    this is related to ejb2.o ,....... i cant upgrade to ejb3.0

    just as u write it in normal reports u can do the same in smartforms but it is suggested tht i u havve a custom print program do it thr and pass it thru interface
    кu03B1ятu03B9к

  • Complex queries in Open SQL

    Moved to performance forum by moderator
    Hi Experts,
    This is more of a discussion rather than a question. I would like to know the advantages of Open SQL. It prevents you from writing complex queries, the kind of queries that you can write in native sql.
    The biggest disadvantage I feel is that you have to fetch data into internal tables and loop. This takes a lot of processing time when you have a report having a lot of lines. A complex query using complex joins and subqueries will always perform better than having to loop and process data and simple things like generating sequence.
    The best thing about open sql is the way it handles select options.
    I would like to get your opinions and suggestions how to write complex queries in ABAP with some code snippets if possible.
    Warm Regards,
    Abdullah
    Edited by: Matt on Jan 21, 2009 6:54 PM

    > select - endselect will query the database repeatedly and wont be any different from using a loop on
    > internal table.
    that is a  very common misunderstanding, but not true, it uses the arry interface, but gives you the possibility to react on every line. But interaction with DB is in blocks.
    The biggest advantage of Open SQL is the implementation of the table buffer, every Open SQL Statement checks the buffers first.
    Other advantage, all statements changing table definitions are not allowed.
    And of course, as already said, it is a set of commands available on all DB platforms certified for SAP software, i.e. IBM, Oracle, Max DB and Microsoft.
    Complex queries, even with the available joins you can write very very complex queries ... sometimes too complex. I see not advantage for a competetion of writing the most complex statement
    Siegfried

  • How to map XSD complex type nodes

    Hello In my XSD I have complex type like this:
    How to map this node to Target filed, I can not see PostalCode node my graphical editor:
    <xs:element name="InternationalAddress" nillable="true" type="tns:InternationalAddress" />
      <xs:complexType name="CanadianAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Province" nillable="true" type="tns:ProvinceCodes" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>

    How to handle this in my graphical mapping:
    <xs:complexType name="Address">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:BusinessObject">
            <xs:sequence>
              <xs:element minOccurs="0" name="City" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Country" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line1" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line2" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line3" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Line4" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="Address" nillable="true" type="tns:Address" />
      <xs:complexType name="InternationalAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="Region" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="InternationalAddress" nillable="true" type="tns:InternationalAddress" />
      <xs:complexType name="CanadianAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string">
              </xs:element>
              <xs:element minOccurs="0" name="Province" nillable="true" type="tns:ProvinceCodes" />
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="CanadianAddress" nillable="true" type="tns:CanadianAddress" />
      <xs:complexType name="AmericanAddress">
        <xs:complexContent mixed="false">
          <xs:extension base="tns:Address">
            <xs:sequence>
              <xs:element minOccurs="0" name="State" nillable="true" type="tns:StateCodes">
              </xs:element>
              <xs:element minOccurs="0" name="ZipCode" nillable="true" type="xs:string">
              </xs:element>
            </xs:sequence>
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
      <xs:element name="AmericanAddress" nillable="true" type="tns:AmericanAddress" />

  • How to upload & Download file in Adf using Jdeveloper 11.1.2 ??

    Hi All,
    I have just started working on Oracle ADF, Thanks a lot guys for solving our queries.
    I'm using Jdeveloper 11.1.2, How to upload and download file in ADF..?
    I have seen couple links on net but none of them worked on jdeveloper 11.1.2......
    Please Help......

    Hi guys,
    I'm able to download file in ADF using af:fileDownloadActionListener.......
    does any one knows how to upload a file using ADF???

  • How to map the permits Scenarios

    Dear Experts,
    Good Morning  to Every to Body.
    I am confusing to map the permits scenario . In my client place they raise the Work permit request to the Safety Officer for getting the approval for doing their work.
    Based on working condition safety officer checks the safety precautions , after verification he approved it and handover to the workperson. if safety officer not satisfied with safety precaustions he deny to give the approving for start the work. this is one scenario. and this work permit valid only for that approved day only. if its not complete that day , next day again workpermit was raised by work person or incharge of the work.
    2. scenario : for any corrective action on running machine or predictive maintenance time , maintenance people gets the work approval from the Relevant department or Concerned persons. Ones relevant department head gives approved , then only maintenance people will start the work.
    i am requesting you please guide me how to map in sap with out complexity. i am waiting for you people response.
    please suggest me.
    thanks & regards
    Jalu

    Hi,
    There are 2 different type of permits.
    1. Safety Permit
    2. Work Permit
    Safety permit will be approved by Safety officer. This is your first scenario. Work permit is approved by Maintenance officer, that is your second scenario.
      IWO10007 Maint.order: Customer enhancement - permits in the order
    As permits are approved in IW32, through above mentioned User Exit, you can develop some logic to restrict the authorisation between Safety officer in case of safety permits & Maintenance Manager in case of work permits.
    Regards,
    Maheswaran.

  • How to map the user to Responsible Person for Proj/ Capital Investment Prog

    Hi All,
    Could you please help me in mapping the user to Responsible Person for Proj/ Capital Investment Prog.
    Here is the scenario. I am trying to restrict the user to access only WBS under a cost center but not to have complete access to the Cost Center. I in my way to do, I found out that we can create a user name using OPS6 tcode and use the reference number of the user we created in CJ20N, so as only the person who was added in the Responsible Person for Proj/ Capital Investment Prog list will be able to access particular WBS.
    Now my question is, How to map the user which I created using OPS6 tcode to user in user master record. I am not able to map the user, as its taking any random name to add in the list. Could some one please help me in mapping the user created in the list with the user master record.
    Hope I managed to put the question clearly. If you have any queries, please feel free to ask. Appreciate your time and thanks in advance.
    Farooq.

    Hi Stephan,
    Thanks for your time and finding SAP note for me. I got the problem fixed. The solution for the above problem is, When we create a responsible person for the project through OPS6 tcode, we have a column called "Offer User", next to the person responsible. We must add the user name next to it. And we can add only the user name which is present in the user master record.
    It solved my problem, but when I pressed F1 for help in this column, there is nothing mentioned about its mapping or anything.
    Thanks again for the help, Cheers,
    Regards,
    Farooq.

  • How to Map Fomulas for Float Glass Process

    Hi All,
    Can anybody suggest how to map formulas for float glass process.
    As in float Glass process continuous production is going on single line, within that continuous ingredients are added in furnace and molten glass mass is coming out. this molten glass is now adjusted to particular thickness and then finally cut into specific sizes as per cusotmer requirment.
    Final product is in various thickness, width and length.
    Entire process is automated.
    If anybody already implemented same scenario, please share knowledge.

    Hi
    The following is the mapping process and it is tricky process need to map carefully.
    You can define this as a single formula.
    Output: Packed - cut to size - Finished Good Item.
    Input: All the Raw materials (Sand, Dolamite, Limestone, Soda Ash, Sodium Sulphate, Carbon, Iron Oxide)
    Packaging materials + Labels + Boxes etc.
    Define Routing:
    Resource: Furnace, Any other importance resource like Equipment that controls thickness, cutter etc, Labor, Associated Overhead
    Create recipe using the formula and routing.
    Various factors that can affect the mapping:
    1) Formula maintenance: You have to define formula for each output item.
    2) Possibility of dynamic determination of output item: If it is possible to produce different combination of thickness/width (and hence different FG item) in the same batch, then this won't be the right mapping.
    3) Process variations: Also formula mapping depends on how accurate is production process. If user wants to produce item X (say thickness 10mm) but due to quality issue produced item Y (say thickness 9mm) and such cases happens very often, this won't be right solution.
    4) Inventory measurement: This will determine the break-points. If you cannot measure the quantity (or even estimate) then you cannot define it as an intermediate item.
    I will explain how point 4 can lead to different way of formula mapping.
    Say you have a furnace that needs to run continuously for better quality or throughput. Hence you will be continuously adding raw materials to furnace and produce different outputs. You can break the single formula into multiple formulas as -
    Formula 1) Output: Molten mass of glass
    Input: All the Raw materials (Sand, Dolamite, Limestone, Soda Ash, Sodium Sulphate, Carbon, Iron Oxide)
    Formula 2) Output: Packed - cut to size - Finished Good Item.
    Input: Molten mass of glass
    To have formula in such fashion you should have a way to measure or estimate the weight of Molten mass of glass.
    If you are estimating the weight, there should be historical data available to determine what should be realistic output quantity for given input quantity. How much will be process loss and loss due to unwanted by product such as slag etc.
    Further you can break formula 2 as
    Output: One large sheet of give thickness
    Input: Molten mass of glass
    Output: Packed - cut to size - Finished Good Item.
    Input: The large sheet of give thickness.
    This kind of different mapping is possible which normally depends on:
    1) Complexity of process
    2) How complex BOM structure user wants to have
    3) Are there any benefits of maintaining such complex system - like accurate costing or accurate production monitoring or facilitating planning process.
    4) Can user maintain the complex system? Are they ready to capture data at finer level. Is it possible to capture the data.
    5) And most important thing is how to handle exceptions. If every thing goes smoothly as planned (less exceptions) then user can have and afford any level of complexity. But if there are many exceptions to the normal process you have to concentrate more on how to handle the exceptions.
    6) Satisfy all users: Accounting, Planning, Production, Quality, Inventory handling. Formula/Recipe touches all these modules.
    Regards
    Raj
    Sierra

  • Create Web Services and return a complex type with ADF

    Hello,
    I've tried tried using ADF BC and service interface to create a Web service, this works well, but I needed to return more complex data types, such as a list of person objects (name, last name, ...), as I reviewed in the ADF BC service interface can return only some types of data :(
    Anyone know how I could do this using ADF BC, or how else do you recommend
    thanks

    How I can access to the AppModule from java class in the Model Project
    I've tried use
    String amDef = "model.services.WsAM";
    String config = "WsAMLocal";
    ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
    WsAMImpl myAm = (WsAMImpl)am;
    but in the Web Service, this throw a exception
    <ns2:exception class="java.lang.NoClassDefFoundError" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
    <message>oracle/jbo/client/Configuration</message>
    please I hope your help
    Thanks.
    Edited by: rmespas80 on 08-jul-2011 16:26

  • How to map Application Roles to Enterprise Roles

    Hello,
    i am having a problem with mapping Application Roles (from ADF Security) to the corresponding Enterprise Roles. I have already seen that it is possible with a tool called Enterprise Manager, but what if i do not have it??
    Can i map the roles in WebLogic Server itself? I have searched for such ability and did not found it. Also have not seen any tutorial on the internet. Someone help me pls.
    The version i am using is 12.1.2.0.0.

    Application roles and permissions defined within WebCenter Portal are stored in its policy store and, consequently, apply to the WebCenter Portal application only.
    Application Roles : Application roles control the level of access a user has to information and services in WebCenter Spaces. Specifically, application roles determine what a user can see and do in their personal space.
    Application Permissions : Again every application role has specific, defined capabilities known as permissions. These permissions allow individuals to perform specific actions in their personal Portal.
    Enterprise roles are different. Enterprise roles are stored within the application's identity store and do not imply any permissions within WebCenter Portal.
    2. How and where do we create these 5 Application Roles in WC 11.1.1.8 version ?
    You can create an application role from WebCenter Portal -> Portal Builder -> Administration tab -> Security -> Roles -> Create Role
    See : Managing Security Across Portals for more info :
    http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27738/wcadm_ps_security.htm#WCADM398
    3. Last, where and how do we MAP these Application Roles TO Enterprise Roles in 11.1.1.8 version ?
    First, You can grant privileges to a specified group (say sales group) of users by granting Enterprise Roles in Enterprise LDAP.
    Next, Create custom application roles (say Contributor, Moderator, UIDesigner, Application Specialist, etc) and assign the appropriate permissions as explained above.
    Then, You can assign one or more Application Roles to a specified group (say sales group) from WebCenter Portal -> Portal Builder -> Administration tab -> Security -> users & Groups
    I hope it helps.

  • Differentiate between Simple, Medium and Complex Queries.

    Hi Gurus,
    I am a Tech. Architect on this new project. I would like to know how to differentiate between Simple, Medium and Complex Queries in BW because I need this info to work on the Estimates. Has this differentiation got anything to do with the Backend config also?
    Thanks in Advance.
    Chandu.

    Hi
    You need to understand the requirements and consider the following before you classify........
    1) Queries that are based on multiple key figures--which may result in cell definition.
    2) Queries with complex calculations.
    3) Queries that are based on Variable Exits
    Regards
    Srinivas Bandi

  • IMPLEMENTING PAGEWISE CONCEPT FOR COMPLEX QUERIES FOR WEB BASED TECHNOLOGIES

    Dear Friends
    how do i implement Page Wise concept for complex queries. Complex queries includes 'Group by', 'from selects'. Mere Rownum selection doesnt solve my problem. I have 3 buttons 'Previous', 'Next' and 'display of No. of records' . Kindly suggest me with a solution.

    The only widespread way is dynamically bild a SQL clause then parse and execute it using dynamic sql (package dbms_sql) or native dynamic sql (execute immediate clause).
    You can go through your already built cursor and display only those records you need (for example from 10th to 20th). I think there is no way to leave cursor open and reuse it another time. Every time You hit next, back or count button you need build new cursor (either selecting context columns to show some records or selecting count(*) to show number of records). You can generate this code with Oracle Designer, making webserver modules. Of course this will cost rather many $$$. Another tip - Designer makes this code for all situations and therefore it is somewhat difficult to understand it in the beginning. If you really need some example I can send something to you.

  • Documenting complex queries

    I'd like to start providing better documentation along with the database objects I produce. What's the best way to document what's going on in complex queries? I've started trying out different techniques of documenting source/target in a spreadsheet, but it seems to be lacking. I was wondering what others do? Any suggestions or references you could point me to? I could probably improve upon my inline comment practices, so any suggestions there are also welcome. Thanks

    I’ve encountered the problem before and got some good advice here: Re: Documentation help:  Procedural logic Vs Set logic
    Because SQL is an explicit language, and programmers being in the mental state that they are when programming, it’s difficult for us to deconstruct our perfectly explicit, self-documenting SQL statement into something that someone else will understand.
    The diagram linked in the above forum thread is an example where to explain what I’m doing, I’ve had to change the set-based logic of the SQL statement into a procedural loop type explanation. I hated doing this, but it was the best way I could think of to explain it to someone.
    More recently I’ve had to document a query that is fairly simple logically (to me anyway) but due to the number of tables and the fact that the audience doesn’t necessarily understand spatial queries, I found it easier to break it down using the following diagram:
    http://img.photobucket.com/albums/v115/whitehat/work%20related/query1.jpg
    tables probably won’t mean anything to you, but you can see how I’ve broken it down into business-logic “Retrieve criteria for exception checking”, “select providers”, “restrict providers” etc. the arrows represent the join criteria and the boxes split up the driving tables and the restriction tables.
    I’ve found this particular diagram very useful as part of the current project that I’m involved with. Even the System Testers are relying on this diagram to direct them in how everything fits together.
    Each situation is different however and you’ll just have to experiment with each bit of code as it comes along.
    Hope this helps!

  • Complex Queries.

    Hi Gang,
    I was in an interview last week and was asked to give an example of a complex queries I have worked with. I was really cought off guard and could not give a very intelligent answer other than mumbling. Can someone please help me out with real life examples? May be I will be asked the same in my next interview.
    Thanks,
    Kara.

    There are many features available in BEx querying, I would think that being able to discuss how / why you used some of them in the same query is what they are looking for, e.g. 
    - Creating RKFs with restrictions on several characteristics
    - Using variable offsetsto get KFs form different time periods
    - A case where using Constant Selection was needed.
    - Using some of the various totaling options.
    - Use of MultiProvider that includes Cube, ODS, and Master Data.
    Now if you haven't actually designed any quereis, this can be a challenge........

  • Information on how to run SQL queries on the CUCM itself please

    Good Day All,
    I need to run an sql query on the CUCM to list all of my directory numbers, their partition, and their external mask values.
    I came across this excerpt below earlier so I have a bit of an idea how to do it but iw would be great to see some other examples of sql queries.
    Any assistance is most appreciated.
    Also, is there a document somewhere to tell me how to run these queries?
    Thanks in advance
    Regards
    Amanda
    Currently Being Moderated
    05/04/2011 5:18 AM (in response to Joshua Royle)
    Re: Is there a way of pulling a report off CM showing all phones that have diverts on?
    Try if running this SQL query from the CLI helps you, it should list all DN's that have CFA enabled to VM or a DN:
    run sql select dnorpattern,cfadestination,cfavoicemailenabled from CallForwardDynamic c, numplan n where c.fknumplan = n.pkid and (cfadestination != '' or cfavoicemailenabled ='t')

    Hi Amanda
    Basically it's standard SQL, so it wouldn't hurt to google 'informix select statements' and do a little reading to get the basics. There are millions of permutations of queries so it's a matter of understanding the syntax, and then applying that to the database in question. The only difference when running commands from the CLI are that:
    - You prefix the standard informix SQL statement with 'run sql'
    - You don't get any help from CUCM with the syntax, so you might be well advised to use something that understands SQL a little and colorises it as you type, and then paste the resulting commands into the CUCM SSH window. I use a text editor named JEdit, if you create a text file and save it as a file ending in .sql it will highlight your syntax.
    - Other programs are available that do reasonable syntax highlighting (e.q. SquirrelSQL) that are designed for querying the DB directly, but you can't actually query directly against the DB for security reasons. You'd still have to copy/paste the commands.
    Now... to understand the DB you'll need a reference describing all the tables etc. This is here:
    http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_programming_reference_guides_list.html
    Pick your version of CUCM and download the 'Data Definition' document.
    A few notes on the command:
    run sql : is just the CLI command that tells the shell to run the following text as SQL.
    select : the SQL command to retrieve data
    dnorpattern,cfadestination,cfavoicemailenabled : the column names to retrieve
    callforwarddynamic c, numplan n : the names of two tables, and the abbreviations you want to refer to them as
    where c.fknumplan = n.pkid : this tells SQL to return values from the two tables where these fields match up. In the data definition you'll see notes that c.fknumplan (i.e. the fknumplan column in the callforwarddynamic table, as noted by the c. prefix) refers to the PKID column in the numplan field. This is a very standard type of join in the CCM DB.
    and (cfadestination != '' or cfavoicemailenabled ='t') : another clause, basically in this query we want to see only rows where cfadestination isn't blank or cfavoicefmailenabled is set to 't' for true).
    Most tables are linked in one of two ways in this database:
    - a column prefixed 'fk' refers to the pkid field (there is always only one pkid field per table) in the table following the 'fk' prefix. E.g. above fknumplan refers to the numplan table, pkid field. fkdevice would refer to the device table, pkid field.
    - a column prefiex 'tk' refers usually to an enum table which is prefixed with 'type'. This is a table that maps the number value in the 'tk' field to a string. An example would be tkmodel - this represents the phone physical model type (e.g. 7962), and maps to a table called typemodel, and the 'enum' column in that table.
    Regards
    Aaron HarrisonPrincipal Engineer at Logicalis UK
    Please rate helpful posts...

Maybe you are looking for

  • How to Restore a SharePoint 2010 Sitecollection from Prod to Pre-Prod?

    How to Restore a SharePoint 2010 Sitecollection from Prod to Pre-Prod? The patching levels are different from each environment. Tools installation is same. Note: Suggest me to restore a site from site template without content. If you have any better

  • IMac G5 iSight - Resolution problems when using s-video output.

    Good afternoon all. I have an iMac G5 and the only video output it has is a mini VGA socket. I have used this with a mini VGA to S-Video converter cable from Apple and am getting some odd results. The Mac is running Leopard 1.5.7 and I'm outputting t

  • Location of mapes stored that are created in Import Manager

    Hi SDNers, I need to delete some maps that I have created in MDM Import Manager, can you please tell me where are the stored in the MDM Repository or server? Please Guide, Gautam Purohit.

  • Field restriction for ME22N using BADI

    Dear All, i had a requirement in which i had to restrict ME22N transaction for a particular user for a particular document type so i used BADI ME_PROCESS_PO_CUST now the requirement has changed and the user wants the restriction only on three fields

  • Internal table for basic price in PO

    hi in which table i wil get Basic Price for the perticular PO ? i checked in EKKO bt all the PO Basic price are not stored... Regards Smitha