AHDOC Query sq01 problem

Hi All,
I have a requirement to create adhoc query in which I cannot use logical database PNP in infoset, so I have to use joind for different infotype tables.
I have to create an infoset in SQ02 for quite a few tables, PA0000, PA0001, PA0002, PA0006, PA0041, PA00105 and just a few to name.
1. Now, how do I create join? If I put a join on pernr of each table then it will bring me multiple rows of history of all infotypes involved.
2. How do I put dates on selection screen, there will be begda and endda in each infotype, I would need only records that are active from each infotype.
3. Do I need to join on begda and endda on each infotype? I dont think so.
Most importantly, can it be acieved through SQ01 or I am barking up the wrong tree?
Thanks for help, and I will award points for all usefull answers.
~ Monkey.

First make yourself clear what you have to do if you do not use LDB:
1. Time calculation and split handling
This will be the first challenge. Imagine 5 Infotpyes with 3-5 time intervals each and its split calculation and handling.
2. Authorization check.
You have to ensure that authorization check is done right the same as in the rest of HR. Of course with direct selects you have to reprogram everything that is there for PA and PD side
THese two points alone are several years of development.
3. Special handling
There are some infotypes and fields that have special handling like repeat fields, indirect evaluation, calculated/derived values
4. Automatic text recognition
This is done with no effort at all in an HR InfoSet. Imagine you need to get all the texts by yourself and again with the correct time etc.
So to be honest I think your approach is simply not feasible.
Instead you should examine the query closer.
No there is not always an inner join. If there is no data the fields are empty but the pernr of course is processed.
Only if you select for this field then the pernr is skipped if the condition does not match.
Further there are a lot of switches available please see [note 305118|https://css.wdf.sap.corp/sap/support/notes/0000305118] and the attachment HR_QUERY_GENERATOR_SWITCHES_EN.PDF for documentation of the same.
Again you should invest time what the tools already can instead of trying to develop everything again.
Regards,
Michael

Similar Messages

  • About query related problem

    hi ,
           we are generate query in 2005b,and procced for execuite query.following problem occure'<b>odbc sql server driver'[sql server] syntax error the converting the nvarchar value' 70302/20307' to column of data type int received alert OAIB</b>
    QUERY SHOWN BE AS FOLLOW.
    SELECT T5.DocNum as'Po. No. ', T5.DocDate as 'Po Date',T0.CreateDate,T5.NumAtCard as 'Man.PO. No/ Dt.', T0.DocNum as'AP No. ', T0.DocDate as 'AP Date',T0.NumAtCard as 'Vendor Ref. No.', T0.U_vbdt as 'Vendor Ref. Date', T0.CardName as 'Vendor', T1.Dscription as 'Item',  T1.Quantity AS 'QTY'  , T1.Price as 'Basic Rate', (T1.Price *T1.Quantity) as 'Value',T0.Comments as 'Po No. & Po.Dt.' FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OPDN T3 ON T2.CardCode = T3.CardCode INNER JOIN PDN1 T4 ON T3.DocEntry = T4.DocEntry INNER JOIN OPOR T5 ON T2.CardCode = T5.CardCode INNER JOIN POR1 T6 ON T5.DocEntry = T6.DocEntry INNER JOIN OITM T7 ON T1.ItemCode = T7.ItemCode INNER JOIN OITB T8 ON T7.ItmsGrpCod = T8.ItmsGrpCod WHERE (  T1.BaseRef  =  T3.DocNum )  AND ( T4.BaseRef =  T5.DocNum ) AND (  T0.U_vbdt >=[%25]AND  T0.U_vbdt <=[%26]) AND ( T4.Dscription =T1.Dscription ) AND ( T4.Dscription = T6.Dscription  ) AND  (( T1.Dscription=[%0] OR T1.Dscription=[%1] OR T1.Dscription=[%2] OR T1.Dscription=[%3] OR T1.Dscription=[%4] OR T1.Dscription=[%5] OR T1.Dscription=[%6] OR T1.Dscription=[%7] OR T1.Dscription=[%8] ) OR ( T0.CardName=[%10] OR T0.CardName=[%09] OR T0.CardName=[%27] OR T0.CardName=[%28] ) OR ((  T8.ItmsGrpNam =[%11]  oR T8.ItmsGrpNam =[%12] OR T8.ItmsGrpNam =[%13] OR T8.ItmsGrpNam =[%14] OR T8.ItmsGrpNam =[%15] OR T8.ItmsGrpNam =[%16] OR T8.ItmsGrpNam =[%17] OR T8.ItmsGrpNam =[%18] OR T8.ItmsGrpNam =[%19] ) and  ( T7.U_FirmName =[%20] OR T7.U_FirmName =[%21] OR T7.U_FirmName =[%22] 
    oR T7.U_FirmName =[%23] OR T7.U_FirmName =[%24] )) )

    Hi Vishal,
    the value '70302/20307' is not an whole number so converting it to an int is not possible.
    You should check your data for this value an change your query or data.
    Regards
    Ad

  • Query designing problem while applying cell properties

    Hello Experts,
    I have a problem while designing query. Problem is as follow:
    I have a calculated field on key figure column. This key figure calculates variance between 2 columns.
    for E.g I have 2 columns Budget and Actual and third column is %Variance which should be          
    1. ((Actual - Budget)/Budget) *100 or
    2. ((Budget -Actual)/Budget)*100, depening on some values on the row i should use any of these 2 formulas but the result should be dispalyed in single column % Variance.
    how can i change the formula in key figures depending on these conditions. I can achieve this by applying cells but i dont want to do so as it is very complex way to desing these queries.
    also let me know applying cells on query affects its performance or not?
    Regards,
    Nirav

    Hi Nitin,
    Your reply may help me.
    But my exact requirement is not that. Requirement is as follow:
    I have created Char. Structure in row which contains few rows as revenue and few rows as expense.
    I created them by creating selections. Now in case of expense the variance should be                (Budget-Actual)/Budget *100.
    In case of revenue variance should be (Actual-Budget)/Budget *100.
    So, here i have to find out revenue & expense char. iresspective of which one is greater.
    Regards,
    Nirav

  • Query has problem

    Below query has problem .
    Pls see the queries for Usage Summary with Partition and Without Partition
    . I have executed this now so it may be in Buffer …****
    DB Query ... SUM from event objects, bin variables
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    --                   and event.Poid_id0 >= 266838277921701888****
    --                 and event.Poid_id0 < 267928993456455680****
    --               and ebal.obj_id0 >= 266838277921701888****
    --             and ebal.obj_id0 < 267928993456455680****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
    resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    and event.Poid_id0 >= 264199450015039488****
    and event.Poid_id0 < 265237388991660032****
    and ebal.obj_id0 >= 264199450015039488****
    and ebal.obj_id0 < 265237388991660032****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    --

    848478 wrote:
    Below query has problem .
    Pls see the queries for Usage Summary with Partition and Without Partition
    . I have executed this now so it may be in Buffer …****
    DB Query ... SUM from event objects, bin variables
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    --                   and event.Poid_id0 >= 266838277921701888****
    --                 and event.Poid_id0 < 267928993456455680****
    --               and ebal.obj_id0 >= 266838277921701888****
    --             and ebal.obj_id0 < 267928993456455680****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    SELECT sum(amount) , sum(quantity), event.poid_type,ebal.
    resource_id,****
    event.service_obj_type, event.service_obj_id0,ebal.
    rate_obj_id0, ebal.OFFERING_OBJ_ID0, ebal.IMPACT_CATEGORY ****
    FROM event_bal_impacts_t ebal, item_t item, event_tevent*
    WHERE event.item_obj_id0 = item.poid_id0****
    AND ebal.obj_id0 = event.poid_id0****
    and event.Poid_id0 >= 264199450015039488****
    and event.Poid_id0 < 265237388991660032****
    and ebal.obj_id0 >= 264199450015039488****
    and ebal.obj_id0 < 265237388991660032****
    AND item.bill_obj_id0 = 148715294****
    AND ebal.product_obj_id0 = 27433706****
    AND ebal.account_obj_id0 = 146876519****
    AND item.account_obj_id0 = 146876519****
    AND event.poid_type like '%session/telco/gsm%'****
    AND ebal.impact_category <> 'Free'****
    AND resource_id not in (select resource_id from
    resource_id_t)****
    group by****
    event.poid_type, ebal.resource_id,****
    event.service_obj_type, event.service_obj_id0,****
    ebal.rate_obj_id0, ebal.OFFERING_OBJ_ID0,ebal.
    IMPACT_CATEGORY****
    order by****
    ebal.resource_id desc;****
    --Consider getting the asterisk key fixed, since it results in invalid SQL syntax

  • Query SQ01

    Hello SAP Gurus
    Can anyone provide me with SQ01 documentation or any links regarding SAP query concept like how to create and copy things....
    Thanks for your help
    Kishore

    Re: Query SQ01  
    Posted: May 5, 2007 8:39 PM    in response to: Chandra       Reply      E-mail this post 
    Hi Chandra,
    can you send me the same documentaiton please.
    My mail Id : [email protected]
    Thanks in advance.
    Kris

  • How to Hide Empty Column In SAP Query (SQ01)

    I was crated a report in sq01 based on business requirements , but there are some fields without any content , in sq01 if you select one of output fields in the right side of the screen in the left side you can see  "List Fields" T in the list fields there is a check box , the name is "Only display field if <> 0 " , but when i check it, it doesn't work  , guys is there any one to help me to eliminate column without content , in the result of sap query (sq01) ??

    Please give reference (or hyperlink) to 10 Useful Tips on Infoset Queries (original document)
    Regards,
    Raymond

  • ABAp query SQ01

    Hi guys,
    I want to make a ABAP Query via SQ01on SAP ECC.
    First i had created an infoset, that only based on one table.
    My requirement is to fetch alle data from this table grouped by customer number.
    Using an sql statement is this very easy to do, but in i had trouble making this in SAP (SQ01):
    SELECT CUST_ID, COUNT(ORDERID)
    FROM
    TABLE
    WHRE CONDITIONS
    GROUP by CUST_ID
    HAVING COUNT(ORDERID) > 1
    My question is where to put my requirement in order to get result using standard ABAP query SQ01.
    I will really appreciate your help.
    nabil

    Hi,
    Welcome to SDN.
    This is not possible exactly with ABAP Query but can be easily done by ADHOC query. Using Set operation A-B.
    Check the links for ADHOC Query -
    <a href="http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc">http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc</a>
    Regards,
    Amit
    Reward all helpful replies.

  • Interactivity in ABAP Query [SQ01]. Working on ABAP 4.6C version.

    Hi,
    I have created a Infoset[SQ02]( basically selecting data from VBAK and VBAP for Sales Order) and assigned this infoset to user group[SQ03]. Using this i have created a Query [SQ01].
    In the output i have the "<b>SALES ORDER NUMBER</b>".
    Once the sales order number is double-clicked on i have to display the VA03 transaction with the sales order number in it.
    My doubt is, how is this interactivity acheived. I am working on ABAP 4.6C.
    Thanks in Advance for your esteemed replies.
    Regards,
    Raghavendra Goutham P.

    AT LINE-SELECTION.
    case sy-cucol.
    when 16 OR 17 . "Col No
    DATA: BDCDATA TYPE TABLE OF BDCDATA.
    DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
    DATA: PROGRAM LIKE SY-REPID,
          WA_BDCDATA TYPE BDCDATA.
    WA_BDCDATA-PROGRAM  = 'SAPMV45A'.
    WA_BDCDATA-DYNPRO   = '0102'.
    WA_BDCDATA-DYNBEGIN = 'X'.
    WA_BDCDATA-FNAM     = 'VBAK-VBELN'.
    WA_BDCDATA-FVAL     = IT_ITAB-VBELN.
    APPEND WA_BDCDATA TO BDCDATA.
    CLEAR WA_BDCDATA.
    CALL TRANSACTION 'VA03'  USING BDCDATA  MODE 'A'
                             MESSAGES INTO ITAB.
    Regards
    Ravi

  • ABAP Query (SQ01) Challenge

    I asked this question last time as well but with no positive/helpful answer. I need to develop a query ( SQ01) in which the user just wants to see when was the most recent posting done in the given G/L account. If i pull posting date it will give me all the dates in  chronical order or so which i dont really want.
    Lets get your gray/sap matter working
    THanks

    sameer
    if you know how to create query.
    code is
    Select requred data from BSIS into internal table (I_BSIS).
    Sort I_BSIS by key field date desending.
    when you sort this you will get the latest record in first by date.
    take that date in one temp field.
    LOOP AT I_BSIS.
       AT END OF key field
      SUM amount .
    move both date and sum amount to final internal table.
    ENDLOOP.
    At last take final internal table and use  in below FM
    WS_EXCEL.
    you will get output.
    Pls. reward if helpful

  • SAP Query (SQ01) who and when to use the report

    HI Experts!!!
    Is there somewhere recorded information:  who and when to use the report from SAP Query (SQ01)?
    Thanks

    Hi
    This topic doesn´t belong to the Service Marketplace Area.
    regards Martin

  • SAP Query (SQ01/SQ02/SQ3)

    Hi Experts,
    I have created query (SQ01/SQ02/SQ03) to display below fields: Hazard Code, Device Location Number, Hazard Code Description, Loc. Created by, Loc. Created on Date.
    Now in the output list I want to display a summary of all the count of records by the key characteristic for the query. For example, the Device Location by Hazard Codes query should give us a summary of the count of all device locations per each hazard code.
    Practical Scenario:
    Device Location Hazard Code
    40002748              01
    40002751              05
    40002481              07
    40002746              04
    40002749              04
    40002994              01
    Then in this case it should either display additional third column or additional row saying:
    Device Location Hazard Code
    40002748              01
    40002994              01
    Total Hazard Count: 2
    40002746              04
    40002749              04
    Total Hazard Count: 4
    40002751              05
    40002481              07
    or
    Device Location Hazard Code Total Count
    40002748              01                
    40002994              01                 2
    40002746              04
    40002749              04                 2
    40002751              05                 1
    40002481              07                 1
    I checked statistic tab present in SQ01 also URL [http://help.sap.com/erp2005_ehp_02/helpdata/en/d2/cb4256455611d189710000e8322d00/frameset.htm] but still I am not able to figure out how to display this data.
    Please let me know.
    Thanks

    Hi,
    If you're getting the output in ALV Display, you can simply click on the location column & then click on the Sub-Total button on the ALV toolbar, it will sort all the records according to the location (1 or 2 or...) & give you the total/count of the particular location.
    For any further clarification, let me know.
    Prateek

  • Hide columns for ALV list output in SAP Query SQ01/SQ02

    Hi All,
    I have a requirement to hide the columns which are empty in sap query SQ01 alv list output.
    Please let me know this functionality available in Query (SQ01) like normal reports
    Regards,
    Venkat

    Hi,
    We just can't make changes in this case as this are all system generated programs.
    WE have to write our own reports to make things flexible to match our requirements.
    Things you are asking is not possible.
    Regards,
    Suvendu

  • Export & import of query (SQ01/SQ02/SQ03)

    Hi,
    How to export/import SAP Query (SQ01/SQ02/SQ03) without any transport request.
    waiting for ur reply.
    Thanks in Advance,
    Pranab

    Hi,
    If you dont want to create any transport request number then you need to download/upload the query instead of import/export.
    Please follow the below steps for downloading/uploading the query
    (Go to the system from where you wnat to export the query)
    1. Goto transaction SQ02.
    2. Click on ' Transports' icon (CTRL+F3).
    3. In 'Transport action' select 'Download'.
    4. Select 4th radio button 'Transport Queris'.
    5. Enter the name your user group and query and click on execute.
    6. Give the file name and location where you want to save the query backup and click on save.
    (Now goto the system where you want to import your query)
    1. Goto SQ02 and click on 'Transports' .
    2.  In 'Transport action' select 'Upload' and click on execute.
    3. Enter/select the name of the file which you have downloaded before and click open.
    Please let me know if this is helpful.
    Regards,
    Priya Bhat

  • Add calculated field (Query - SQ01)

    Hi to all,
    I would know how can i add a calculated field to a Query (SQ01) ?
    Can you give me an example of abap code to insert in CODING section ?
    thks

    Hi,
    My understanding about your question is you want to display the total for two standard fields in a table,
    1) Personalize the table and make true for the property Total.
    2) If you want to calculate both the column total,
    Add a MessageStyledText via personalziation to the page, and extend the controller
    and in the ProcessRequest
    Get the handle of the AM and then ur attributes VO Attributes and traverse through the VO rows and get the total of both the columns
    and set the value to the newly created MessageStyledText.
    Let me you want any sample code for the second step.
    Thanks.
    With Regards,
    Kali.
    OSSi.

  • Transaction of Query(SQ01) SAP 4.7

    Hi
    I created a query in SQ01(SAP 4.7), I need create a transaction for this query.
    How create transaction for query(SQ01) in sap 4.7, help-me

    Hi
    select the query and go to QUERY in the menubar then goto more functions where you have an option display report name it will give you the report name.
    Menubar ---> Quer ---> MoreFunctions ----> Display Reportname.
    Now GOTO SE93 to create the transaction code and give the transaction name what you want and give the report name and try to give the screen number as 1000. As 1000 is the default screen for the SAP generated programs.
    give the GUI support as SAP GUI for Windows if the operating system is Windows.
    or
    GOTO SE80 and select the program and give the program name you will find the screen number there right click on the report name and got to the context menu
    Create ---> Transaction
    Fill the required fields.
    this will definitely work
    thanks
    sarves

Maybe you are looking for

  • Can any bady send the WDJ application on event handler & plug  parameters?

    Hi, Experts, I have no idea no WDJ Event handler and plug parameters usage if any bady can send me few WDJ application or scenarios which is based on event handler parameters and plug parameters and method parameters.  Thans in advance, Shaber Ahmed.

  • HT4623 iPad 3 camera problem

    I have not been able to use the camera feature on my iPad 3 since I bought it as the icon is not available on the unit. I have downloaded other camera apps but all I see is a blank screen. Anyone with a solution?

  • Error trying to import CD into iTunes

    I put a music CD into my Mac. iTunes read it, found the album name, track names, etc. I clicked on "Import CD" (my import settings are set to Apple Lossless, Error Correction=on). Received an error message that said "Error occurred while converting t

  • [SOLVED] cannot open theme file /usr/...

    Hi to all! I very loved arch, but in last three times when i tryed to reinstall arch (X86, kde) - i faced a  problem with kde start-up: "cannot open theme file /usr/...".  Please help to find solution to this problem. I tried to install archlinux-the

  • HT201401 cant get my ringer or other sounds to work.  Not on silent

    Cant get my ringer or other sounds to work.  I'm not on airplane mode, nor on silent.  I have turned the phone off and tried a hard reset.