INFOSET SQ02

Hi friends,
I am new to ABAP Query, when we create infoset, it shows 4 options for our data source, i want to work with 4th option ie..<b>Data Retrieval from program</b> , can any one through light on it. any kind of document ar any kind of help is rewarded.
Thanks
Rohit

Hi Rohit,
Try writing a Z<Prgrm> which has only data retrieval statements like SELECT statements and fill a final internal table (The internal table type should be known in the ABAP Dictionary). Specify this structure and the program.
When a Query(SQ01) is created based on this Infoset, the program is executed the internal table (whose structure is known globally in ABAP Dictionary) is filled. This can be used to display the data.
Please let me know if further details are required from my side.
Thanks & Regards,
Goutham

Similar Messages

  • Creation of additional fields in Infoset SQ02

    Hi Experts,
    I'm a FICO consultant trying to create a query.
    Requirement : Link RSEG Table to BKPF Table in the join condition
    Link: RSEG-BELNR concatenated with RSEG-GJAHR = BKPF-XBLNR
    Now I'm trying to create an additional field in SQ02 named MiroYear and in the field code part i gave the below piece of code
    "CONCATENATE RSEG-BELNR RSEG-GJAHR INTO MIROYEAR."
    It shows no syntax errors. I added the same to the field group as well.
    Issue: The additional field (MIROYEAR) is not appearing in the join condition in SQ02.
    Is this the right way to create an additonal field? Have i made any mistake? Or any of you have any better ideas to join RSEG and BKPF in SQ02?
    Your quick response will be appreciated
    Best Regards
    Vimal

    Hi,
    Table RESG and BKPF are linked BKPF-AWKEY.
    Now first of all if you create an additional field, that field will not appear in the join.
    One way will be to create an infoset with direct read to table RSEG, and then inside add additional fields for each BKPF field.
    Then in the code
    CONCATENATE RSEG-BELNR RSEG-GJAHR into MIROYEAR
    select single ....
    into (ADDFIELD1, ADDFIELD2, ADDFIELD3,.....)
    from BKPF
    where awkey = miroyear.
    Regards,
    Khusro Habib

  • Infoset (SQ02) - hardcode selections ?

    Hi.
    I need to build a BW datasource from an R/3 infoset. We have two fields in the infoset that need to be restricted. Instead of just having these two fields as selections (which actually get passed through to BW as selections in the InfoPackage), we want to hardcode the values.
    Unfortunately I can't pull any ABAP people to help me right now. Is this something that can be included in the 'AT SELECTION-SCREEN' section of the 'Code' area within SQ02?
    We have so far created two selections: A & B and just somehow want to restrict A to "X" and B to "Y" instead of the user entering it.
    Is this possible? Do we even need to do this in ABAP?
    Thanks.

    no-one?? surely this is something that is relatively straight forward for an ABAPer?

  • Code at Infoset SQ02 - Start of Selection - not working

    I have a code at SQ02 infoset START-OF-SELECTION:
    select bukrs
      into table i_bukrs
      from t001
      where bukrs in ('SP$00007').
    if sy-subrc = 0.
    endif.
    where SP$00007 is a select-option at the query selection screen.
    This coding is not working. It is always returning sy-subrc 4. How do I acces a select option form the query start of selection?
    Where I am doing wrong? I have got the 'SP$00007' from the generated code of query.
    If I try like this it gives me a syntax error:
    where bukrs in SP$00007.
    Any idea what I am doing wrong?

    The Solution:
    DATA cond_syntax TYPE string.
    CONCATENATE 'BUKRS' 'IN SP$00007'
                INTO cond_syntax SEPARATED BY space.
    SELECT bukrs
      INTO TABLE i_bukrs
      FROM t001
      WHERE (cond_syntax).
    IF sy-subrc = 0.
      LOOP AT i_bukrs INTO wa_bukrs.
        AUTHORITY-CHECK OBJECT 'J_B_BUKRS'
                 ID 'BUKRS' FIELD wa_bukrs-bukrs.
        IF sy-subrc <> 0.
          MESSAGE s000(z_zzz_ca_messages)
          WITH
          'You do not have authorization to view Company Code '
           wa_bukrs-bukrs
           ' data.'.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDLOOP.
    ENDIF.
    If there is a better way please let me know?

  • Transport Req for Infoset - SQ02

    Hello all,
    First time I created a generic datasource based on Infoset . The Infoset is created in SQ02 (Joining 2 tables).
    Now I have problem in collecting this Infoset in the transport request.
    I tried doing in transport connection, but it collects only the datasource.
    Later I collected the classic Infoset in transport connection under the same transport request.
    Please let me know if i am wrong or missed to collect some objects.
    Regards..
    Balaji

    Hi,
    First go to Transport connection and select the collection mode as collect automatically.
    then select all the prerequsites given by the system.
    Otherwise go to Transport connection and select grouping and further select the option 'In dataflow before and afterwards'.
    And then transport it.
    Hope it helps you.
    Regards,
    Swathi J H

  • Create infoset - sq02

    Hi all,
    I want to create infoset in sq02 with 3 tables.
    and want to add some condition and put their value default.
    Is this possible ?
    I also tried it with external program, but i get error.
    Plz help me how to do it.
    thanks in advance.

    Yes ,it is possible to add code in infoset.
    open sq02 give infoset name click change,in app tool bar click on extras
    there on right side you have option code.you can write your code there.

  • Error in generating infosets - SQ02

    Hello Experts,
    I was trying to create an infoset based on multiple tables. I get error "In Unicode programs, the "(" character cannot appear in names, as it does here in the name "TEXT5()".", after I add tables and try to generate the infosets.
    I saw many posts on such errors however, those are basically for ABAP programs where we need to uncheck the unicode checkbox in attributes of the program. I am not using any APAB program however, just generating infosets after adding tables...
    So, how to quell this error? Any ideas are appreciated.
    Thanks in advance.
    Sarvesh Hasija

    Hello,
    I just created an infoset based on "Direct read of table" and specified the table name "HRHAP" (which is for appraisals).
    After creating it, I tried to generate the infoset and it gives this error.
    I was not able to generate this infoset even once.
    Let me know if you have more questions on this to help me.
    Regards,
    Sarvesh

  • SAP  infoset  SQ02  - Add field  for LDB

    Hi all,
       I have to modify a sap query,   which uses infoset ZDES.  I have to add table ANLH  so that i can get field ANLHTXT.   The infoset uses the LDB "ADA" which has many other tables  and structures.
    Now  if i have to add the  table ANLH  ,  how should  i go about , I cannot change the LDB  as it asks  for DEV key,  the only way is to modify the Infoset ZDES.
    Can  anyone please tell me  how  to go about this .
    Thx in adv.
    Dan

    If you can modify the infoset, its well. You can do it.
    Open the infoset ZDES, add additional field ANLH-ANLHTXT and add them to the group. Write code in the field you created. generate and add the corresponding field as output field. For this you need not add a whole table, instead you can add the field as extra field and write code under it to get it.
    But performance wise, it will not be 100 % efficient becuause for every row fetched your abap code is run. But to me, its the only way you can handle it without disturbing the SAP code.
    regards,
    Sandeep Josyula
    *Mark helpful answers

  • INFOSET  - SQ02   - WAERS FIELDS

    Hi
    I generated a infoset using table COSP, when I click in generate infoset, sap shows this warning message:
    Compare field group fields with Data Dictionary
    Currency field CCCUR-WAERS will not be filled
    Currency field TKA01-WAERS will not be filled
    How can I  fix the value for fields CCCUR-WAERS and TKA01-WAERS  in my query ?   when I execute the query this dont show the correct values for some fields because waers field.
    Points avaliable.

    Shidar, thanks for your help.
    values in controlling area currency aren't displayed correctly (1000 COP is displayed like 10 COP ).... values in object currency are wrong too, but values in document currency are correct because document currency field is available for parameters.
    I'm working in document currency, but I would like to know why SQ00 doesn't take in account  controlling area currency and object currency ... ¿it is an error ? ¿there are some way to fix it?

  • SQ02 InfoSet Get Count of Total Number of Records that will be processed

    I am developing a query (SQ01) and am currently working on building an InfoSet (SQ02). 
    The Infoset was set up using a 'Direct read of table'.  Next, I'm adding some various fields and then going to Extras and trying to define some code to get the total number of records that my query will be processing.  I'm not sure if SAP pulls a filtered result set into a temporary table (by default - if so how could I reference it?) that I can reference or is just pulling in a row at a time in the record processing code, but my question is in regards to getting a record count of how many records are returned in my result set PRIOR TO going through all of the records.
    Overall, I'd like to be able to have a field that says Record X of Y.  I can get the X part for each line, but cannot get 'Y' until the very end.  Any help or ideas would be much appreciated.  I've looked around a bunch, but haven't found anything like what I'm requesting.
    Query Output would look something like:
    Record X1 of Y | Title1 | Amount1
    Record X2 of Y | Title2 | Amount2

    Hi Subin,
         I have tossed around this idea in my head, but am trying to figure out how to get the values and selection options from the query screen to incorporate into my Select statement within my infoset.  The problem I'm running into is that my user enters a group of account numbers and an ending date that has to be pulled from the SQ01 query screen to the SQ02 infoset code.  I've looked around for examples on pulling the data from the query screen, but have been unsuccessful thus far.  Say for instance I have 15 specific accounts that the user is entering in and they want any records that have been submitted prior to the end of the current month and the start of the business year.
         On my query screen they would enter in something like
    Business Year:  2011
    Reporting End Date:  <= 31.03.2011 (Which equates to all records between 01.01.2011 AND 31.03.2011)
    Account #s:  0000, 0001, 0003, 0005, ..., 9999  (These are a variable amount of accounts entered and could include options such as not equal to or even between ranges etc)
    In my START-OF-SELECTION code I would need a select like:
    NOTE:  This is just a pseudo code format, not checked for syntax here
    SELECT count(*)
    FROM TABLE
    WHERE BusinessYear = '2011' AND
        RecordDate Between 01.01.2011 AND 31.03.2011 AND
        Accounts IN (0000, 0001, 0003, 0005, ..., 9999).
    So In this select I need to reference the values in the SQ01.  How would I reference the account #'s and whether or not the user has entered an account number and said Not Equal on it etc.  This select statement would have to be built on the fly, since it's not guaranteed to be the same for each run.
    Thanks,
    Mark

  • Unable to Access BI InfoSet in Crystal Reports using SAP Info sets driver

    Hi,
    I am looking to develop a report on top of BI InfoSet in Crystal Reports. However using the the SAP InfoSets driver I am only able to visualize 'Classic InfoSet' and 'SAP Query'. It does not show the option to import the regular InfoSet as a datasource. I am unable to access the InfoSet built by the db join on InfoCubes that is available in SAP BW System.
    Can anybody help.
    Thanks,
    Amogh

    Hi all,
    i know this discussion is abaout 2 years old, but i faced a similar problem. I try to get access to the regular InfoSets (SQ02) within a direct connection between SAP and Crystal Reports. Which components and tools did i need to get a connection?
    look here: http://scn.sap.com/thread/3365060
    Thanx for your help!
    Best Regards
    David

  • SAP QUERY/INFOSET with OUTER JOIN

    Hi,
    I have created an infoset (SQ02) using two tables for SAP query.
    Table: AGR_TEXTS. Fields: AGR_NAME, SPRAS, LINE, TEXT.
    TABLE: AGR_FLAGS. Fields: AGR_NAME, FLAG_TYPE, FLAG_VALUE.
    Joined these two tables using outer join.  Defined the join condition as AGR_NAME = AGR_NAME.  Saved and Generated the infoset.
    Created SAP Query (SQ01) using the above created infoset.
    In the basic list,
    Marked AGR_NAME (AGR_TEXTS), TEXT, FLAG_VALUE as listed fields.
    Marked AGR_NAME (AGR_TEXTS), SPRAS, LINE, FLAG_TYPE as selection fields.
    Save the query.  When execute the query provided the inputs for all the selection fields in the selection screen as given below:
    AGR_NAME=Z*
    SPRAS=E
    LINE=00000
    FLAG_TYPE=LICENSE_01
    Executed the Query. 
    Got the results only the matched records as per the selection field FLAG_TYPE.
    But I want all the records from table AGR_TEXTS and matched records from table AGR_FLAGS.
    I want the report (output) as below,
    _AGR_NAME                                               TEXT                                                                                  FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.                                       53
    ZCA_BASIC_ENDUSER_ACCESS     UK:CA Basic Enduser Access     
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK                                        52
    ZCA_BASIC_ENDUSER_SU52_UK     UK:CA Basic Enduser Access to change Parameter ID's     
    But I got the report (output) as below, 
    _AGR_NAME                                                TEXT                                               FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.     53
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK     52
    Apprecited your help. Thanks.
    Code Formatted by: Alvaro Tejada Galindo on Dec 30, 2009 2:20 PM

    Identify a KF for which there are non-zero values for all accounts in the cube.
    Create the query with Account (from MP coming from both IO and cube) and this KF. KF will have 0 values for accounts not existing in the cube. Create a condition to show only the 0 value for the KF. This should show you all the accounts in the IO which are not in the cube.

  • Populating Additional Field in InfoSet Query

    Hello,
    My team and I are working on generating a relatively simple report from the VBAK (Sales Header), VBAP (Sales Items) and VEDA (Date data) tables.  We would prefer to be able to build an InfoSet (SQ02) and Query (SQ01) instead of writing a custom report.
    The problem is the VEDA table contains data that may link to the VBAK and sometimes the VBAP table.  The usage is that the header has begin and end dates for a contract, which is denoted by a blank value in POSNR field in the VEDA table.  If a particular line on a contract has different dates than the header, there will be an additional record in the VEDA table where the POSNR value matches the POSNR value from the VBAP (Item) record.
    The link to the VBAP table is straight forward being keyed off of the VBELN (doc number) and the POSNR (item number) fields in both tables.  However, there's isn't a POSNR field in the VBAK (header) table and the VEDA table shows this as a blank value in the POSNR field.
    The simplest thing I can think of doing is link the VEDA table to the VBAP and let it retrieve all the exact matches on Sales Doc & Item Number but add two "Additional Fields" to the Query that would represent the Sales Header begin and end dates.
    I know how to add an additional field but how would you "re-query" the VEDA table and under which option under the Code tab.
    Thanks

    Hi Alex
    Please see if below example helps you to understand:
    Supposing, we are displaying material description within our query.
    1. So we define the join with MARA & MAKT while creating infoset in transaction SQ02.
    2. We create feild groups to identify the fiels we use for selection and display.
    3. Here after selecting language key from MAKT, by default this will take SY-LANGU always for the case.
    4. To make it applicable for different languages we can code in INITIALIZATION Event.
    5. To do so we can do it by two options: Use menupath: Goto->Code->Initialization
    i) First option using variable: <b>MAKT-SPRAS = SY-LANGU.</b>.
    ii) Second option using Parameter-Id: <b>SET PARAMETER ID 'SPR' FIELD SY-LANGU</b>.
    6. Save & Generate.
    Now when we execute the query, we are defaulting the language as System Language.
    Hope the above info helps you for better understanding.
    Kind Regards
    Eswar

  • Infoset Query in Datasource.

    I'm using a Infoset query based on an ABAM program as a datasource. For passing parameters, form Infopack to the program I defined the parameters in the Infoset (SQ02 -> Extras -> Selections -> parameters). After doing this, when I include this Infoset in my new Datasource and save it, I'm not getting the paramter defined in the Infoset. All other fields in Infoset look fine. The parameter defined should appear in Datasource as PARAM_P_<param name>, which can be used as selection parameter in the Infopack. Can anyone tell what I'm missing out and where?
    Thanks in advance!
    - Sree

    Hi Sree,
    Try testing your datasouce in your source system with tcode RSA3? Can you get data back from that?
    Have you defined that field as a selection field in RSO2?
    Hope this resolves the issue for you. Cheers!

  • Wrong number of members in a TG. Infoset query vs Segment Builder.

    Hi gurus,
    I've discovered an issue in our CRM System (BBPCRM 600) and I have no idea of how to solve.
    For our marketing segmentation, we've created a Infoset (SQ02) with a link between standard (BUT000, CRMD_ORDERADM_H, CRMD_OPPORT_H) and custom tables. Over this infoset, I've created an infoset query (SQ01).
    During our test, we've noticed the following: Using the same filters in segment builder and in infoset query, results are not the same!! Segment builder adds more partners to our TG's and even these partner doesn´t met the filters!
    For Example:
    Using POSTING DATE from CRMD_ORDERADM_H as filter: From 01/01/2014 to 01/312014.
    Using infoset query, all partners I'm getting are correct, all of them have CRM operations for this date interval.
    However, using this same filter in segment builder, the resulting list of partners has one more than query list...and this partner doesn´t have any operation for the chosen internval.
    How is this possible? Why results are not the same? Any ideas? Is there any BADI for segment builder that must be checked?
    A lot of thanks!!
    Message was edited by: SAP _ES

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

Maybe you are looking for