SQ01 Query Coding

Dear Experts,
I have developed a Query in SQ01 joining two tables. I have added a couple of  additional fields. I need to use the data fetched and populate these additional fields using control break statements. Example : number of production orders in one date.
I have declared an internal table and populated in Record-Processing event. Since in Start -of -selection the nodes are not filled and empty with no data. My control break statements dont work since every record is appended in record processing and sent to output.
Any thoughts on which event i need to use to populate my internal table and then write the loop and enloop in record processing
Thanks and Regards,
Kumar

>> Any other experts with other ideas over there?
> So you don't want my help any more
That was a joke :-D
> to exclude the movement types for cancelled document
I don't know these tables, but I can tell you how to not select lines. Implement the RECORD_PROCESSING event, and use CONTINUE or STOP statement to not select a line. Fields you can test have name TABLE-FIELD corresponding to tables and fields you have selected in your query output (for example, IF aufk-auart = '')
Maybe you need to know at that time the other extracted records, unfortunately the query selects only one record at a time and you won't be able to add code after the end of the SELECT because SAP uses the old "extract" (field-groups) technology, and I guess all workarounds would give aleatory result. You also have the possibility to code the join yourself ("external reading program") then you'll be able to do exactly what you want.

Similar Messages

  • Output of SQ01 Query to a file in background

    Hello,
           I have created a SQ01 query for a certain specific outpur from my SAP system. I need to get the output of this query to a file. While i have tried executing this report from the frontend; it works smoothly, and based on the variant it creates the output and writes to a file at a remote location. But while i am trying to process the same query using background job, it creates a spool request and doesnt export the data to a file.
           Can someone please help me in getting me right in case i am doing anything wrong.
    Regards,
    V

    Hi,
    SAP have created a standard program RSTXPDFT4 to convert your Sapscripts spools into a PDF format.
    Specify the spool number and you will be able to download the sapscripts spool into your local harddisk.
    It look exactly like what you see during a spool display.
    Please note that it is not restricted to sapsciprts spool only.  Any reports in the spool can be converted using the program 'RSTXPDFT4'.
    Regards,
    Pavan

  • SQ02 Infoset returns different results in SQ01 Query vs. Segment Builder TG

    I want to get Segment Builder to use the same InfoSet and return the same results so, that I can then make a Target Group...but, I'm sure I'm missing some step along the way.
    My SQ01 query returns 79 contact persons, but my segment builder only finds 42, none of which appear to actually be the Contact Person, but are in fact the Business Partner the Contact Person has a Relationship to.
    I started by copying the CRM_MKTTG_BP_ADDR InfoSet and added the BUT051 table to it, which is when the SQ01 began returning the needed results.
    I suspect the problem may be in the Master Group where I am using the B2B/B2C Program, but I don't know if that's the answer or not.  I am not declaring an FM as I am using the BP-GUID in the data source, so I don't 'think' that's the issue...
    Here's what I'm currently trying as my Data Source settings in case that will help:
    Origin Type              03 InfoSet                                                              
    RFC dest.                                                                               
    Name of InfoSet          ZCRM_MKTTG_BP_ADDR                                                      
    Business Partner         BUT000-PARTNER_GUID                                                     
    Function Module                                                                               
    Sampling InfoSet         ZCRM_MKTTG_BP_ADDR_SMP                                                  
    Sample                   BUT000-PARTNER_GUID                                                     
    Object                                                                               
    Partner Function                                                                               
    Description              Z BP Address                                                            
    I already read every Segment Builder forum thread and the Sap Library on the subject, but either I missed something or there is a step not listed.
    Anyone have any suggestions?

    Solved!!
    I was wrongly using AND/OR options to add filters in the segmentation tool...ups!

  • How to add a selection criterion to a SQ01 query based on logical database SDF?

    Hi,
    How should I add a selection criterion to a SQ01 query based on the logical database SDF? Is it possible through additional code? How to make use of the custom selection fields? I need a selection criterion based on BKPF-CPUDT (creation date).
    Thanks.

    Hi John,
    Please check the given below link in addtion to Atul post.
    http://scn.sap.com/community/erp/sd/blog/2012/04/16/query-report-tips-part-2--mandatory-selection-field
    Thanks,
    Senthil Maruthappan.

  • SQ01 query - Drilldown total level larger than 0 and drilldown function

    Hi everybody,
       I have made a sq01 query and set the call up report at "Report assignment" function. The drilldown total level of my query is 1 and I found that this makes the report can't pass the selected data (with cursor) to the receiver report correctly. I can't change the drilldown total level as 0 due to the user requirement. May I ask is there any other way to solve this problem? Thank you.

    Hi everybody,
       I have made a sq01 query and set the call up report at "Report assignment" function. The drilldown total level of my query is 1 and I found that this makes the report can't pass the selected data (with cursor) to the receiver report correctly. I can't change the drilldown total level as 0 due to the user requirement. May I ask is there any other way to solve this problem? Thank you.

  • SQ01-query - how to join MARA and DRAD

    Hi all,
    my problem is that I have to create a sq01 query in which I combine data from the MARA
    with data from DRAD. But I can't join the OBJKY (DRAD) with the MATRN (MARA).
    Hoping for help,
    Barbara

    Hi Barbara,
    As mentioned in the previous post, you cannot join the OBJKY field with MATNR field of MARA.
    But if you want to just read the contents in OBJKY from DRAD, then have a look at the below code:
    Note: In the initial step of creating your infoset, just select direct read from table & select on MARA here.
    SELECT SINGLE DOKNR INTO T_DOKNR
    FROM DRAD
    WHERE OBJKY EQ MARA-MATNR
         AND DOKOB EQ 'MARA'
         AND DOKAR EQ (Specify the type of document for this).
    Now you can combine the fields MATNR, T_DONR & the Z field into the field which you want using the CONCATENATE statement.
    \[removed by moderator\]
    Regards,
    Vivek
    Edited by: Jan Stallkamp on Sep 3, 2008 3:51 PM

  • Error when attempting to download SQ01 query data to Excel

    Hi Experts ,
    I am getting error when attempting to download SQ01 query data to Excel .
    Error message - Contact your system administrator. The following template is missing: sap_om.xls
    Message no. 0K 407
    I have looked through the SAP GUI installation files and can find no record of the missing file
    Help

    Hi
    Please check SAP note 305900 & 803067
    Regards
    Ravinder

  • Adding a function module into a SQ01 Query

    Hi ABAP Gurus,
    I was trying to extract few dates from TSEGE Table, by linking the VTTK - HANDLE. We are trying to look at maintaining dates of shipment that were not previously used in our company.
    When I tried extracting the dates from TSEGE, they come as timestamped UTC. I was told to use the function module IB_CONVERT_FROM_TIMESTAMP with CET in a query by an external consultant we use for our services. I am familiar with creating simple queries in SQVI and convert them to SQ01, also I know to create queries in SQ01 itself. But do not know how to add a function module into an SQ01 Query.
    After checking a few threads, I realise that I should be creating a field and entering the code of the function module.
    Is there any way, anybody could instruct me in simple terms how do I go about adding a function module.
    Your help will be greatly appreciated.
    Thanks in advance!

    Dear Jogeswara,
    I have after reading a few threads, understood this small code and changed to my specification
    To convert UTC Start time from TSEGE
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        I_TIMESTAMP = TSEGE-EVEN_TSTFR
        I_TZONE = CET
      IMPORTING
        e_datlo = date
        e_timlo = time
    To convert UTC Start End from TSEGE
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        i_timestamp = TSEGE-EVEN_TSTTO
        i_tzone = CET
      IMPORTING
        e_datlo = date
        e_timlo = time
    I hope the above codes are correct. If yes, I have a doubt: TSEGE-EVEN_TSTFR & TSEGE-EVEN_TSTTO have different time in the same field, "Actual" & "Forecast", which is determined by TSEGE-EVEN_VERTY wherein 1 is Actual and 0 is Forecast. Is this something I would have to put in the code, or something that would work in the query "Selection Fields"?
    Thanks again!

  • Coding in SQ01 Query to eliminate reversal movement types.

    Dear Friends,
    I have created a report in ECC 6.00 using SQ01. Considering tables AUFK,AFIH,AUFM,BGMKOBJ. The purpose is to get the cost incurred for warranty machines in PM. The report is functioning well except for one problme which is the data from the AUFM table is displayed for reversal movment types also.
    For example one order has 101,102 and again 101, in this case only one 101 line should be displayed as the previous 101 is cancelled, but system displays all the three document.
    I used the field movment type in the selection screen to eliminate the 102, it was okay but two 101 documents are displayed which is wrong.
    I checked in the table and the ammount field DMBTR is not having any negative values and hence system is not able to net off the difference. Moreover i thought of using the debit/credit indicator but even this doesn't solve my problem.
    Experts kindly help me to achieve my requirement.
    If coding can be written to achieve my requirement, kindly provide me the steps and the codes so that i will try to build the same.
    Expecting your valuable suggestion.
    Regards,
    M.M

    >> Any other experts with other ideas over there?
    > So you don't want my help any more
    That was a joke :-D
    > to exclude the movement types for cancelled document
    I don't know these tables, but I can tell you how to not select lines. Implement the RECORD_PROCESSING event, and use CONTINUE or STOP statement to not select a line. Fields you can test have name TABLE-FIELD corresponding to tables and fields you have selected in your query output (for example, IF aufk-auart = '')
    Maybe you need to know at that time the other extracted records, unfortunately the query selects only one record at a time and you won't be able to add code after the end of the SELECT because SAP uses the old "extract" (field-groups) technology, and I guess all workarounds would give aleatory result. You also have the possibility to code the join yourself ("external reading program") then you'll be able to do exactly what you want.

  • RE : user group(sq01) -- query modification

    Hi All,
    when i am trying to execute the query called ZTIMES in the user group SQ01 it is navigating the screen to selection-screen with some inputs to be given here on the selection screen company code is mandatory as an input.So, i want to set default value for the company code as 1000 in the selection screen while i am executing.
    Thanks
    Raju M

    Hi Anitha,
    How to Enhance the Standard Report? :
    When I am trying to execute the query called ZTIMES in the user group SQ01 it is navigating the screen to selection-screen with some inputs to be given here on the selection screen company code is mandatory as an input. The company code field is having the search help and it is fetching the values for the company code from table called PROJ  Table (Project definition Table).But I want the company code should fetch the value from the  PRPS Table ( Work break structure(WBS Element) Level).
    Tables used are PROJ and PRPS.
    The company code in PROJ is PROJ-VBUKR
                                    In PRPS is PRPS-PBUKR
    In the coding part related to that selection screen I have to replace PROJ-VBUKR with
    PRPS-PBUKR.But it is standard report to enhance.
    What is suggestible solution for this issue?
    Thanks,
    Raju M.

  • How to add a "Maximum no. of hits" - field in SQ01 query?

    Hi all,
    Is it generally possible to add the field "maximum no. of hits" to a query / quickview in transaction SQ01? And if yes, how?
    I have created a test query but I cannot find any solution. I don't mean the popup asking for database accesses which occurs when trying to test this query. I really want to have it as selection criteria.
    My system is a R/3 Enterprise 4.7 Ext. Set 2.00.
    Thanks in advance!
    Michael

    Well,
    You're talking about COLLECTIVE search help. You won't definie Max No of hit at this level.
    Define an elementary search help and assign to this one a dialog mode (retriction or set of values).
    Regards,
    Bertrand
    PS : Don't forget reward points

  • Transaction Code fro Sq01 query

    Dear all,
    i have created a query in Sq01 and assigned a Tr Code for the same. Now thew user i asking for extra fields to be shown in the Query When i changed the query and tried to execute the report thru Tr Code The newly added fields are not seen but when i run it thru SQ01 i see the new fields.
    When i checked in SE93 it says "Transaction contains inconsistencies. Do you want to execute it anyway? "
    Can any body pl tell me how to overcome this ?
    with rgds
    Ranjith Singh

    hi,
    whenevr u do som changes in sq01 ,som program will be internally generated,so u have to change the transaction again,do one thing goto system status of sq01 take program name and create tcode.
    check it then.

  • Urgent(sq01) query

    Hi friends
      I have generated a report using SAP query(sq01).can any one tell me how can i  make the selection fields obligatory here.
    Regards
    Bunty.

    Hi
    I think You can't make them as Obligatory
    see this
    http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Step-by-step guide for creating ABAP query
    http://www.sappoint.com/abap/ab4query.pdf
    ABAP query is mostly used by functional consultants.
    SAP Query
    Purpose
    The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
    Features
    SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
    All the data required by users for their lists can be selected from any SAP table created by the customer.
    To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
    ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
    To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
    use either SQ02 ans SQ01
    or SQVI tr code
    for more information please go thru this url:
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
    http://goldenink.com/abap/sap_query.html
    Please check this PDF document (starting page 352) perhaps it will help u.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    check the below link will be helpful for u
    Tutorial on SQVI
    once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
    Reward points if useful
    Regards
    Anji

  • Report sq01 query

    Hi Gurus,
    Hi,
    Please could you let me know if there is a report either in SQ01 or in SAP in general that shows the following:
    Sales order
    PR00 price (Header level)
    Condition type (ZFRE Freight) and the value
    MWST Output tax and the value
    Net Value of the order
    Basically I need to be able to enter a whole list of sales orders into the report and see if the sales orders had the ZFRE freight as a seperate condition type.
    Thanks
    Bawa

    Hi,
    In your query, you can use the logical database VAV (sales order) or VFV (invoices).
    Another solution : add abap code in SQ02 (in new field) to read table KONV from VBAK-KNUMV.
    For example :
    Clear VAL_ZFRE.
    SELECT kwert
    INTO VAL_ZFRE
    FROM KONV
    WHERE KNUMV = VBAK-KNUMV
    AND KPOSN = VBAP-POSNR
    AND KSCHL = 'ZFRE'.
    Endselect.
    Regards,
    Lionel

  • AD HOC query (coding)

    Hi,
    I have Ad hoc query and in the selection screen I have  field(select option) for language , what I am trying to do is to make a login language  as default value for language field ,I tried throw SQ01 the only thing I could do is to add fixed value (for example 'EN') but need it to be login language.
    Its seems to be the only way is to write code But I donu2019t know how?
    PLEASE HELP.

    Defining ad hoc query you can select personnel number as output field by right clicking on "Personnel number" in "Key fields" group. In the context menu you can find "Output" and three possibilities:
    1. Only text - which is default and means an employee's name,
    2. Only value - which means personnel number,
    3. Value and text - in this case two columns are displayed: personnel number  and the employee's name.
    Regards,
    Renata

Maybe you are looking for

  • How to send the form data through mail with pdf format?

    forms 6i Hi to all, i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form the data ,these data send to mail with any format.is it possible? if is p

  • Trouble with star schema

    Hi All, I have a star schema in place with 8 dimension and 1 fact table. But due to some specific requirement, I need to denormalize the schema. I want to copy all fields from all dimension tables to the fact table. I know this sounds bad but I have

  • Required input on GUI for HTML vs Windows

    Hi, We are now on 7.02 and have seen that a required input field in SAP GUI for HTML is shown as an *, but on SAP GUI for Windows is shown as a checked box icon. Is there a way to make them the same? Our clients run reports in ECC and via the Portal

  • Accessing Instance info from external app

    We would like to provide a view of the instance information in BPEL within another web app. Specifically, a list of Instances, with the ability to click and get the Audit info. This would allow us some production visibility of our processes, without

  • Photoshop Elements 10 Backing up Catalog

    When I go into the Organizer, hit File Back Up Catalog to CD/DVD or Hard Drive my stsyem goes into a loop. How can i fix that?