Need ABAP Query Builder Like Ms-SQLQuery Builder for Critical ABAP-Query

Dear ABAP Friends,
I Need ABAP Query Builder which is as flexible as Ms-SQLQuery Builder for building Critical ABAP-Queries e.g. "I have 4 master tables , Each master table having self-join with some condition and these 4 Result-Sets have Innser-Join+Left Outer Join " Please Help.

I have seen TCODE SQ01, But I found that this TCODE may be used to build simple ABAP Query with Selection-screen which can be used for generating simple report. But i think for critical query ??????????
I have build my Query in MS-SQL and got the right output, Now how do I write this in ABAP Using Join statement. Please Help.....................
My SQL Query as below(Remember this is a single Query and verified correct in SQL):
SELECT     P1.PERNR, P1.ENAME, P1.BEGDA AS P1BEGDA, P1.ENDDA AS P1ENDDA, P1.AEDTM AS P1AEDTM, P1.UNAME AS P1UNAME, P1.PERSG, P1.PERSK,
                      P1.PLANS,
       P2.ENDDA AS P2ENDDA, P2.BEGDA AS P2BEGDA, P2.AEDTM AS P2AEDTM, P2.UNAME AS P2UNAME, P2.GESCH, P2.FAMST,
                   P21.ENDDA AS P21ENDDA, P21.BEGDA AS P21BEDDA, P21.AEDTM AS P21AEDTM, P21.UNAME AS P21UNAME, P21.FAMSA, P21.FAVOR, P21.FANAM,
                      P21.FGBDT, P21.FASEX,
                   P0.ENDDA AS P0ENDDA, P0.BEGDA AS P0BEDDA, P0.AEDTM AS P0AEDTM, P0.UNAME AS P0UNAME, P0.MASSN,
                      P0.MASSG
FROM         (SELECT     TOP (100) PERCENT PA0001_2.PERNR, PA0001_2.ENDDA, PA0001_2.BEGDA, PA0001_2.AEDTM, PA0001_2.UNAME, PA0001_2.PERSG,
                                              PA0001_2.PERSK, PA0001_2.PLANS, PA0001_2.ENAME
                       FROM          PA0001 AS PA0001_2 INNER JOIN
                                                  (SELECT     PERNR, MAX(ENDDA) AS ENDDA
                                                    FROM          PA0001 AS PA0001_1
                                                    GROUP BY PERNR) AS Pi1
ON PA0001_2.PERNR = Pi1.PERNR
AND PA0001_2.ENDDA = Pi1.ENDDA
                                           ORDER BY PA0001_2.PERNR) AS P1 LEFT OUTER JOIN
                          (SELECT     TOP (100) PERCENT PA0000.PERNR, PA0000.ENDDA, PA0000.BEGDA, PA0000.AEDTM, PA0000.UNAME, PA0000.MASSN,
                                                   PA0000.MASSG
                            FROM          PA0000 INNER JOIN
                                                       (SELECT     PERNR, MAX(AEDTM) AS Pi0AEDTM
                                                         FROM          PA0000 AS PA0000_1
                                                         GROUP BY PERNR) AS Pi0 ON PA0000.PERNR = Pi0.PERNR AND PA0000.AEDTM = Pi0.Pi0AEDTM
                            ORDER BY PA0000.PERNR) AS P0 ON P1.PERNR = P0.PERNR LEFT OUTER JOIN
                          (SELECT     TOP (100) PERCENT PA0021.PERNR, PA0021.ENDDA, PA0021.BEGDA, PA0021.AEDTM, PA0021.UNAME, PA0021.FAMSA, PA0021.FAVOR,
                                                   PA0021.FANAM, PA0021.FGBDT, PA0021.FASEX
                            FROM          PA0021 INNER JOIN
                                                       (SELECT     PERNR, MAX(AEDTM) AS Pi21AEDTM
                                                         FROM          PA0021 AS PA0021_1
                                                         GROUP BY PERNR) AS Pi21 ON PA0021.PERNR = Pi21.PERNR AND PA0021.AEDTM = Pi21.Pi21AEDTM
                            ORDER BY PA0021.PERNR) AS P21 ON P1.PERNR = P21.PERNR LEFT OUTER JOIN
                          (SELECT     TOP (100) PERCENT PA0002.PERNR, PA0002.ENDDA, PA0002.BEGDA, PA0002.AEDTM, PA0002.UNAME, PA0002.GESCH,
                                                   PA0002.FAMST
                            FROM          PA0002 INNER JOIN
                                                       (SELECT     PERNR, MAX(ENDDA) AS Pi2ENDDA
                                                         FROM          PA0002 AS PA0002_1
                                                         GROUP BY PERNR) AS Pi2 ON PA0002.PERNR = Pi2.PERNR AND PA0002.ENDDA = Pi2.Pi2ENDDA
                            ORDER BY PA0002.PERNR) AS P2 ON P1.PERNR = P2.PERNR
xxxxx----
Edited by: Goutam Roy on May 5, 2009 1:11 PM

Similar Messages

  • Need info on the class that is used for BUILHEADER Genil query

    Hi All,
    Can some one pls let me know the class that is called by executing the query BUILHEADER.
    I m facing a strange error, everytime when i search and open any account other than sold to party in WEBUI, I am noticing soldto party in the Roles Assignment block. But the business partner in the backend is not having hte role sold to party. i am not finding how this defaulting is happening automatically.
    Any pointers/clues on this will be very very helpful.
    Thanks,
    Udaya

    Hello Udaya,
    The class is CL_BUIL_HEADER Copy it and redifine method GET_RESULT_TABLE.
    then goto SPRO I'm not remember exactly where you should change the SAP class into yours.
    Sorry it was on ICWC5.0 and not CRM2007
    Eli Steklov
    Edited by: Eli Steklov on Jul 16, 2008 3:52 PM

  • Frequency of use for an ABAP object  ?

    Hi all,
    i need in ABAP to get the frequency of use for an ABAP object like a program or function module. For example, for a program i would like if it's used often (by week, by month, day) or not.
    Cheers.

    Hi,
    You can use transaction STAT or STAD for finding the statistics of usage regarding report or transaction.
    You can also use the Function module <b>SAPWL_WORKLOAD_GET_STATISTIC</b> for getting the statistics of reports executed.
    You need to get the dir from Function module <b>SAPWL_WORKLOAD_GET_DIRECTORY</b> and loop through the dir returned by the and pass the dir(internal table ) fields to the Function module SAPWL_WORKLOAD_GET_STATISTIC for getting the details
    Hope this helps.

  • Not getting Selection(Prompt) option for the WebI Query.

    Hello Experts,
    I built WebI query for the custom query of SAP BI.I am not getting an selection or prompt for the WebI Query even though there is a selection in BI Query.If i develop WebI report for the standard query of the Bex i am getting selction options.
    Please suggest how can i do this.
    Thanks in Advance,
    Shiva Kumar G.C

    Hi Shiva,
    Where in the Query Designer are the selections defined?
    Selections defined under Characteristic Restrictions should show up when you run the webi report.
    Additional selections created under Default Values won't show running a webi report (that is just an additional filter on the data retrieved from the data warehouse).
    Regards,
    Harry

  • Does oracle 10gr2 has a visual query builder like oracle Express ?

    Hi
    Thank you for reading my post
    does oracle 10gr2 provide a visual query builder like oracle express ?
    Thanks

    SQL Developer<br>
    <br>
    Nicolas.

  • Query not running in report builder 3.0

    hi, i can run my query in mgmt studio (version 2008R2) and within the query designer of report builder 3.0 but it will not run from report builder. i get a generic error message of "an error has occurred during report processing. (rsProcessingAborted)".
    the query uses report parameters and is written with dynamic sql (using a pass-through to oracle). any ideas why the query doesn't execute in report builder ? thanks a bunch,

    Hi KanataPablo,
    According to your description, it seems that you are using linked server to pass value to oracle. Seeing that the query is worked well in Management Studio, you may have the permission to connect to oracle (In this scenario, make sure the users to run the
    query in SSMS and Report Builder are the same user). So this issue can be caused by the user’s permission to connect to report server, the credential of data source and the dynamic query.
    We can add the current user as a Login, then click Properties and navigate to User Mappings page, enable ReportServer and ReportServerTempDB options.
    We can try to type user name and password, and enable “Use as Windows credentials” as the credential used to connect to data source.
    Try with dynamic query:
    ="Select column1, column2 From tableName where ID IN (" + JOIN(Parameters!param1.value, ",") + ")"
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Can not build a Universe based on a SAP/BW Query:

    Hi,
    In Universe Designer I can not build a Universe based on a SAP/BW Query:
    -The Universe Items -> Sight -> Universe Window and -> Sight -> Liste Mode are greyed our
    - Its simply not possible to move Universe "Objects" = "Classes" into the Table, Join or
    Item Plane.
    I am useing:
    -BO XI 3.1
    -BO Solutions for SAP Integration
    -Universe Designer
    Universe Designer based on a Database is ok
    The Connection to the SAP System is stored in BO XI 3.1
    What's missing ?
    Any Rights/Authorizations are Misseing ?
    Thanks a lot !
    Martin

    Hi
    when working with OLAP universes (eg. universes based on SAP BW queries) it is not possible to work as you normally do when you have a universe based on a relational data source. The data madel is the one from the OLAP source (cube) so it is not possible to create your on joins, tables etc. In this case you can only add/modify the objects in the object browser (left panel).
    Regards,
    Stratos
    PS: The Data Federator will allo you to create relational universes on an SAP BW source. Still this is a product that must be licensed seperately and currently does not support SAP logon ticket-based SSO.

  • Need to frame a query using like

    can anyone help me in framing aquery using like :
    need to fetch from a table passing acct_nbrof another select query in like tag
    my query is :
    select from unbld_usage_sum where event_data like %(select acct_nbr from sbscrp_asgm where acct_nbr='0032581922')%;*

    It didint work :(
    Actually there are 12 rows coming when I used the query like this :
    select from unbld_usage_sum where event_data like'%04045000325819226789%';*
    but when I used the query you just mentioned no rows are returned from it:(

  • Concatenate results SQL query and CASE use Report Builder Reporting Services

    I need to concatenate the results from a SQL query that is using CASE.  The query is listed below.  I do not need permitsubtype but I need to concatenate the results from the permittype. 
    I tried deleting the permitsubtype query and it would not run correctly.  Please see the query and diagram below.  Any help is appreciated.
    select  PERMIT_NO
    ,(case when
      ISNULL(PERMITTYPE,'') = ''
      then 'Unassigned'
      else (select LTRIM(RTRIM(PERMITTYPE)))
      END) AS PERMITTYPE
    ,(case when
      ISNULL(PERMITSUBTYPE,'') = ''
      then 'Unassigned'
      else (select LTRIM(RTRIM(PERMITSUBTYPE)))
      END) AS PERMITSUBTYPE
     ,ISSUED
     ,APPLIED
     ,STATUS 
     ,SITE_ADDR 
     ,SITE_APN
     ,SITE_SUBDIVISION
     ,OWNER_NAME
     ,CONTRACTOR_NAME
     ,ISNULL(JOBVALUE,0) AS JOBVALUE
     ,FEES_CHARGED
     ,FEES_PAID
    ,BLDG_SF
    from Permit_Main
    where ISSUED between @FromDate and @ToDate

    Hi KittyCat101,
    As per my understanding, you used case when statement in the query, you do not need to display permitsubtype in the report, but when you tried to delete permitsubtype from the query, it could not run correctly. In order to improve the efficiency of troubleshooting,
    I need to ask several questions:
    “I tried deleting the permitsubtype query and it would not run correctly.” As we can see, it has no effect to delete permitsubtype from the query you provided, could you please provide complete sql query for the report?
    Could you please provide detailed information about the report? I would be appreciated it if you could provide sample data and screenshot of the report.
    Please provide some more detailed information of your requirements.
    This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
    Thanks,
    Wendy Fu

  • Need to find SAP query for corresponding ABAP program.

    Hello SAP Experts,
    I have an ABAP program "AQDESYSTQV000001ORDERDETAILS==" in ECC 4.7. We had a client copy recently from ECC 4.7 to ECC 6.0. Now in ECC 6.0 I am unable to find this program in SE38.
    Can you please tell me how to create this program in ECC 6.0 ? Also, by the name of this program it is clearly seen that this program is automatically created by using SAP query.
    I tried to generate the program using SQ01, but system asks me for the SAP query.
    Can you please tell me how to find the SAP Query for the corresponding abap program ? Also, the steps as in how to generate the program in ECC 6.0.
    Thanks.

    Hi Danish,
    In the program name, the query name is always attached.
    For example : The program name is , AQ10SD==========Z10SD_INVPRODL=
                           Here the query name is Z10SD_INVPRODL and if you go to transaction SQ01 and enter the query name
    then you can find the infoset.
    And also you can gernate the program with the help of query name.
    Please try the same and let me know if any details are required.
    Regards,
    Darshana

  • SQLEception using Complex SQL Query with Java Studio Creator2 Build(060120)

    I am evaluating Java Studio Creator2 for a WEB base application project that will be making SQL queries to an Oracle Database but I have stumble into a problem using complex SQL queries.
    I am getting an SQLException "org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: [sunm][Oracle JDBC Driver][Oracle]ORA-00923: FROM keyword not found where expected". I looks like it cut my sql.
    The SQL that I am trying to execute is
    Select part_name
    from table1, table2
    where table1.part_nbr = table2.part_nbr
    and table2.row_add_dt = (select max(table3.row_add_dt)
    from table3
    where table3.ser_part_id =table2.ser_part_id)
    This is a valid query that it is using 2 different selects to get a part number.
    If posible, point me to the best solution were I will be able to make complex SQL queries like the one above and bigger.
    Is there any way that I can read an SQL query file instead of inserting the SQL query string into the setCommand()?

    I have read that document looking for some anwsers on how to make this kind of query. If I try the query that I have above in the query editor ,the query editor will cut off from the last select that is between ().
    I beleave, there is a work around using the inner joint or outter join command. I will try them to see If I get the corrent result. If not, then I have to keep on asking for possible solutions.
    Anyway, someone in the Creator Team should take a note in adding something like a special criteria in the Add Query Criteria Box for cases like the one I have. The special criteria will be like using another select/from/where to get some result that will be compare.
    Girish, Are you in the Sun Creator Team?

  • Generation of program code for the ABAP Query

    Dear all,
    In the creation of the ABAP query, in the final step of SQ01, Query- more functions- generate program is made.
    Why the program code is generated for the ABAP query? please  give the logical explaination for the same.
    Thanks and Regards,
    Prash

    Prash,
    a) Do you mean Program code does not have significance in query creation?
    No it does not mean this.  All queries run based on an ABAP program.  In the standard query editing process, when you save and execute the query, you will automatically re-build the existing ABAP program as necessary.  You do not need, though, to execute the menu steps you outlined in order to build, maintain, or execute the query.  It is only there for special purposes, as outlined above by Jürgen
    b) Can we see the program code generated in any transaction?
    From any screen, System > Status.  Place your cursor on the field in "Program (screen)".  Double click.
    Rgds,
    DB49

  • Hosted Build Controller does not build test project when using GitContinuousDeploymentTemplate.12.xaml

    So basically my unittest project using mspec is not even built and copied to the outputfolder even though I build the sln file. This happens only if I put in a azure deployment environment in the build. It works with exactly the same parameters if I just
    remove the azure deployment parameter in the same template. I really don't get why it's impossible to run unit tests and fail the build before deploying to staging. Is it supposed to be like this?

    Hi Espen,
    I would like to know what you mean when you say "put in a Azure deployment environment in the build", and whether you have run a post script during the build process. Please give out more details about your scenario, or share you build log here. You can
    check whether it's build fine locally by using MSBuild or build directly with Visual Studio.
    Maybe you can check whether the Azure environment has the right version of mspec test adapter. Or use Nuget package restore feature to include the needed files in your solution before building. If the build related to hosted build controller, you can configure
    an on-premise build controller for VSO. See this
    thread for more information.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    By Azure deployment variable I mean "Windows Azure Deployment Environment" variable which you can configure under the Process tab after rightclicking the build definition and clicked "Edit build definition" in Visual Studio.
    I actually figured out what was wrong though. When "Windows Azure Deployment Environment" is set, the build target is set to <your_azure_project>:Publish. This target probably only builds the projects useful for that particular project, hence the unittest
    project is not built. I fixed the issue by adding a msbuild argument under 2.Build->5.Advanced->MSBuild arguments. I had to set it to "/t <your_azure_project>:Publish;Build" and all worked well. Notice the order of the targets though. If I used
    Build first, the whole build failed with some error trying to some virtual web folder. Also, <your_azure_project> is not entirely correct. At least for me it's named like My.Azure.Project, but the build target is My_Azure_Project.
    I don't really know if it's supposed to be this way, but it looks to me like a small bug in the template at least.

  • Unable to build a valid certificate chain for the signer

    Updating an AIR application after a few years and needed a new signing certificate which I purchased from Comodo.  Imported it successfully into Keychain Access and exported it as a pfx file.  When I identified this certificate to Flash Builder it went all the way through the build process and then came up with the error "Unable to build a valid certificate chain for the signer".
    I can see there was a discussion on this matter in October 2011 but this did not seem to answer my question as that guy was trying to use an Apple Dev Centre key rather than paying for one like I did.
    TIA
    David

    In Keychain Access, command-click your Class 2/3 certificate, the CA's intermediate certificate, and the CA's root certificate before hitting export.
    Short guide: Code Signing Certificates for Adobe Air in OS X

  • Flash Builder 4b2 or Flex Builder 3

    Starting a new project to rewrite a beefy Flex 1.5 application. Should I start with Flash Builder 4b2 or Flex Builder 3? Storyboards will be complete next week and I expect to reach end of job by February of 2010. Some customization of components will be required, but am hoping that current libraries are more rich than the 1.5 libraries (lots of customizations).
    Thanks for your thoughts/recommendations.
    Nick

    The first thing you need to consider is your time frame, its a very close call as to whether or not you should avoid the risk of how stable FB4 will be by the time your project is supposed to be in the testing stage (by stable, i mean more as in are there still pending changes to the ide/sdk that could break your code in a major way). I think that by xmas it may be reasonable to say the ide/sdk won't be prone to many big changes(fingers crossed).
    So within your time frame 4-5 month timeframe FB4 is starting to look like the right choice.
    The Next thing to consider is which Flashplayer do you wish to target 9+ / 10+ . FB4 allows you to write your app using either the flex 3.4 sdk or the flex4.0 sdk. 
    The 3.4 SDK would be used if you are not ready to target flashplayer 10 and the plus side is that the 3.4 sdk won't be going through as heavy a change schedule as 4.0 sdk, the down side is you don't get to use all the new shiny bits of flex.
    The 4.0 SDK is not yet fully stable and has issues that could see your code breaking once the fixes are applied, with 4.0 you need to target flashplayer 10 but unless you work with digital media agencies who tend to be on the rotting edge of technology this isn't a real problem. So all the possible issues with the 4.0 SDK are also the pluses, latest flashplayer support, lots of new shiny bits which slowly but surely will be more feature rich than the old SDK.
    So if you are confident and are prepared to add abuffer into the project timeline to cope with possibility of code changes required to cope with SDK/IDE updates using Flex 4 is the right choice.
    OK thats my 2 cents worth
    David

Maybe you are looking for

  • How to change the width of the bar of bar charts?

    Hi, I am using Crystal Reports 11. I created some stacked bar charts. Now, I want to change the width of the bar. Some one told me that I can't do that because it's totally controlled internally by Crystal Reports. Really? If could, how could I do? T

  • I receive my mails but I can't  send them on my iMac. What can I do?

    I can't send emails on my Imac but I can on my Iphone and my Ipad. I have an hotmail account. What can I do? I have delete my account and re open it but still it doesnt work.

  • Layout in different page dimensions?

    I wonder how I could make a layout in a different format, for example a square page or a horizontal page for a book. Is there a way to do that? Thanks I'm using pages 2.0.2

  • Librfc32.dll exception for ECC 6.0

    Hi, My customer just upgraded from SAP R/3 4 to ECC 6.0. All the RFC calls now raise an exception in the librfc32.dll. Here is the error from the event viewer: Faulting application consoleapplication1.vshost.exe, version 8.0.50727.42, faulting module

  • Error Message = ORA-20001: Please make sure all system pa

    Hi, We have 2 business group one default setup business group and another one new one. There is a common custom workflow for timesheet approval. This workflow process working without any problem with default business group (setup Business Group). But