Sq02 coding

Hi Sap gurus..
I hav created infoset in sq02 and there i used tqo tables A589 AND KONP..
There i need to get values according to condition..
First take data from A589 with given selection criteria and A589-KFRST = ' ' and
(A589-DATBI  > X_DATE ) and pick the unique records with key field of table A589 and pick up the value of KONP_KSTBW with ref of A589-KNUMH = KONP-KNUMH.
X_DATE IS VARIABLE Which is declared in SQ02.
Thnx in advance

Hi,
You can give the Query conditions in the transaction SQ01. This will have a selections screen for the Query where in you can select the respective fields of the table (infoset).
Also you can select the output fields from the infoset tables which are required. Check the Query transaction SQ01.
Regards
Shiva

Similar Messages

  • SQ02 Coding help

    Hi,
    I have a selection screen program for sale order change bapi in Dev 700 Client & its working fine.
    Now i want to execute same in Qulity client 900 without transporting request number.
    Through SQ02.
    Just let me know how to proceed for Extras-Code there are so many code section
    how to execute this BAPI program which having selection screen also in SQ02.
    thanks

    HI,
    If the want to test on the same server with different client then there is not need to transport .
    If you need to transport the request to Quality server which is different form development.

  • SQ02 coded fields

    Hi
    Iu2019ve coded some custom fields in Adhoc query to output infotype free text (maintained via F9 in infotype).
    syntax error
    The code is correct to me, and was tested and worked.
    I now have an issue when a query is run with the relevant fields I receive error:
    Error when generating the report (see long text)
    Message no. AQ_AD_HOC221
    Diagnosis
    The report cannot be generated because the internal description is invalid or incomplete, or because the selection screen is too large.
    Regenerate the assigned InfoSet, and read the log. If the InfoSet is OK,make sure that at least one field is given as output.
    f you used the 'Refresh' icon to start the query, use the 'Output' menuoption to execute the query. This gives you a full screen display of the data.
    If an output was generated, the query cannot work with actual data in the construction view. In this case, always use the 'Output' function to execute the query.
    Procedure
    If the selection screen is too large, you need to reduce the number of your selections.
    Make sure that the assigned InfoSet is correct. The name of the assigned InfoSet is stored in the menu option 'Extras -> Template Information'.
    Output at least one field. Otherwise you will not be able to save or generate reports.
    If you do not have this problem, execute the query using the 'Output' function.
    Otherwise, there is an error in the InfoSet Query.
    This doesnu2019t make sense as I have selected outputs, regenerated infoset etc, but unresolved.
    If anyone has any insights into this error or has come across before, please let me know, any feedback much appreciated.
    regards

    Hi Minttea,
    Regarding the reported issue, when the customer-specific infotypes are transported into another environment and you want to evaluate the data o infotype table PA9nnn in reports based on logical database PNP,kindly run report RPUMS40CCI ( XPRA for generation of infotype include ) for your existing customer-defined your existing customer-defined infotypes.
    ADDITIONAL INFORMATION:ADDITIONAL INFORMATION:
    RPUMS40CCI -  XPRA RPUMS40CCI -  XPRA for generation of infotype include The repThe report RPU40CCI creates the infotype include %_HRnnnn (nnnn = infotinfotype number) and the additional data structure Pnnnn_AF (nnnn = infotype number) for the given infotype, provided that the corresponding parameter ("generate infotype include" or "generate additional data structure") are set on the selection screen. If the parameter "maintain only T77ID" is set, no infotype include or additional data structure is maintained, only those entered in table T77ID.
    I hope this information helps!
    Regards,
    Jaime

  • Using SQ02 for writing ABAP programs

    Hello,
    I am using SQ02 coding section for writing some simple ABAP programs, mainly for reporting purposes. I would like introduce more power into my programs, but SQ02/SQ01 reports return "ACCESS_DENIED" when I for example try to call a function (GUI_DOWNLOAD).
    Can You advise how to extend SQ02 authorization to enable function calls?
    Maybe You know other place from which You can write programs without a developer key?
    Thanks,
    Pawel

    Hi Uday,
    do You mean that I have to first make a recording on cg3y using transaction shdb, then create a function module basing on this recording, and then use this function module in my code?
    Pawel

  • Coding in an infoset created by transaction SQ02

    Hello Folks,
    I have an adhoc query created using SQ01 and SQ02 based on feild ATINN between tables AUSP and CABN.
    The user now requires to display 'Characteristic Description' too.
    I have added CAWN and CAWNT required for this change (feild ATWTB is required to be added on display ) to the infoset and  
    also added the proper field group.
    The key links that can be made in the JOIN are:
      AUSP-ATINN <->  CABN-ATINN
      CABN-ATINN <-> CAWN-ATINN
      CAWN-ATINN <-> CAWNT-ATINN
      My problem:
      I have to link
      cawn-atwrt <-> ausp-atwrt
      cawnt-atzhl <-> cawn-atzhl        ( I tried using the CODING option on the EVENT Records Processing to filter based on the 
      aforementioned  conditions but it does not seem to work )
      I would appreciate any help on this matter.
    Regards,
    Subodh S.Rao

    Hi Sandra,
    Thank you.
    I was naive and thought that only key relations which are formed when we try to create a join between
    two tables is the only way and thought that the other relationships are done in coding.
    Regards,
    Subodh S.Rao

  • Abap coding in SQ02

    Hello,
    Since it's not possible to add IT2051 to the AdHoq Query, I was trying to create an additional structure and wrote a little program for retrieving absence data. The problem I get is that the output only shows results for 1 day and not for the entire period I select in the selection screen of PQAH. Anybody has a suggestion or some information how to add coding properly to SQ02?
    Here is the code I used:
    Data: pers_avail type table of pdpsp with header line,
          it_pers_avail type table of pdpsp with header line,
          wa_pers_avail like line of pers_avail.
    CALL FUNCTION 'HR_READ_TIMEDATA_PSP'
      EXPORTING
       BEGIN_DATE                  = PN-BEGDA
       END_DATE                    = PN-ENDDA
        PERSON_ID                   = P0001-PERNR
      PERSON_TYP                  = 'P'
      RP_BUILD_PSP_ERROR          = ' '
      TABLES
        PERS_AVAIL                  = PERS_AVAIL
    EXCEPTIONS
      NO_CAPACITY_AVAILABLE       = 1
      NO_INTEGRATION_ACTIV        = 2
      TIMEINFO_ERROR              = 3
      OTHERS                      = 4
    IF SY-SUBRC = 0.
    Loop at Pers_avail.
      dailyworkschedule = PERS_AVAIL-tprog.
      DAYOFWS = PERS_AVAIL-datum.
    Endloop.
    Thanks !!
    Philip
    Else.
      Clear dailyworkschedule.
    Endif.

    Hi,
    Wish it was simple as that i am fairly good at queries i do a bit of coding as well on queries, i want to use an inner join for performance reasons. If any1 could help me with that and have used Inner joins ABAP Coding please let me know
    Thanks
    Adeel

  • Internal Table in SQ02

    I need to create an ABAP Query ( SQ01/SQ02 ) in which it pulls information from the table REGUH. However as REGUH does not have indexing ,its giving performance issues . I was wondering if its posibble to pull the required information in an Internal Table in this Query and then use this table for reporting.
    I am not an ABAP guy and have quite a limited knowledge about coding and dont even know if its doable or not.
    Any help would be appreciated.
    Thank You

    Hi,
    Declaration
    TABLES: PAYR.
    DATA: BEGIN OF ITAB OCCURS 100,
                <Mention the fields of PAYR>
             END OF ITAB.
    SELECT * FROM PAYR INTO ITAB WHERE <Any condition for fetching>.
    The above query will populate into ITAB.
    To check whether it has been populated, u can have a check with SY-SUBRC value
    Regards,
    Sridevi
    <i><b>Pls. award points, if useful</b></i>

  • SQ02 - Issue on a infoset which doesn't order the results

    Hello to everyone,
    I'm experiencing some issues when creating a Infoset and implementing the relative query, as the results aren't ordered by the first field which is the Primary Key of the first table of the join which composes the Infoset. Here are the details:
    I've created a query on the following JOIN:
    DFKKKO >> ERDB >> ERCHC
    Plus, i've implemented some code to mess the query so that it returns some additional field with custom values.
    One of the target of this query is to have the output sorted by DFKKKO-OPBEL, which is the key of DFKKKO, but it seems that when I ask for a big amount of data, the output isn't sorted at all.
    Is there a way to ask the infoset via SQ02 or the query via SQ01 or some coding within the additional fields, etc.. to sort the output by certain fields? In this particular case, I'd like to order for the first output field which is the key of the first table of the join.
    Thank you very much in advance.
    Best regards,
    Claudio

    Hello Arbind,
    thanks for your quick reply, i'll be start testing it immediately, but I've seen that apparently this method sorts the extraction after it is done. Even though it could appear strange, I should keep a progressive number while elaborating each row of the selection, so for example I'll count in this way:
    record 1 - counter 1
    record 2 - counter 2
    record n - counter n.
    Actually, my problem with sort was that record 1 has the key 1, record 2 has the key 2018, record 3 has the key 58, so the counter 2 points to a wrong record.
    Your solution is really helpful, but do you know actually if I can put a sort or order by directly in the main selection by indicating something somewhere?
    If it isn't possible, i'll start thinking of an alternative solution for the counter problem (which is a counter of the billing rows in a document, instead of a simple counter).
    Thanks also to Christian for the answer!
    Thank you very much.
    Kind regards,
    Claudio
    Edited by: Claudio CPU on Feb 22, 2011 12:14 PM

  • Error while Uploading Query thu SQ02

    Dear all,
    We got an error while uploading a query thu SQ02.  May I know do you have any idea for about, thank you very much!
    Error in code for record processing
    The "FROM" addition is missing. The FROM or the FROM addition at either
    DELETE, INSERT, MODIFY, or UPDATE is missing. addition at either DELETE, INSERT, MODIFY,
    Best regards,
    Anne

    Hi,
    This is just a syntax error in the code you have written in your query.
    kindly paste the code so that i can have a look at it or try refering to the syntax of the statement you have coded .
    Regards,
    Raghavendra

  • SQ02 SAP Query

    I'm using version 4.7 for a query using SQ02 with 3 table joins. The data is extracted correctly and displayed correctly.
    In the extras --> Code area of this infoset transaction I've added in a FM into END-OF-SELECTION (before list) coding area (along with code in DATA declaration and RECORD PROCESSING) to download the data automatically.
    The code for E-O-S does not get generated. There doesn't seem to be any notes. Does anyone have any suggestions?

    Hi Mark,
    i think code for end-of-selection is only generated, when you use a logical database (<b>ldb</b>) in your infoset
    Andreas

  • How to do coding in abap-query

    Hi friends,
      Please help me how to write the coding in abap-query.
    Regards,
    Bhavani

    hI
    There are certain exit points available in the query, these can be accessed in SQ02 - Infoset editor. Click 'Extras', then the 'Coding' tab. There is a drop down to access different coding sections, e.g. DATA, GET, etc.
    It is not always clear where and when they execute so you may need to experiment with some 'break-point' statements to start with, run the query to find out where the breaks are then go back to SQ02 to enter some code at that section.
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_FunctionalAreas_LogicalDB.asp

  • "AT LINE-SELECTION" event in a Query (SQ01 or SQ02)

    Hi there
    I want to know if it's possible to put "AT LINE-SELECTION" event in an ABAP Query? I'm trying that in SQ02 - the infoset - but nothing happens when I double-click on the output lines. I cannot find any place to type codes in SQ01.
    The purpose is to call a transaction VA03 when people double-click on the output field "sales order number" and here is the code I put in "Free coding" section of SQ02.
    AT LINE-SELECTION.
      DATA: w_cucol TYPE sy-cucol.
      w_cucol = sy-cucol + sy-staco.
      w_cucol = w_cucol - 2.
      IF w_cucol BETWEEN 103 AND 119.
        SET PARAMETER ID 'AUN' FIELD vbkd-vbeln.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
      ENDIF.
    yu

    Hi ,
    You must create infoset based on join VBKD with VBAK and LIPS.
    Also you must put VBAK-VBELN and LIPS-VBELN as a column output.
    There is no problem to use 2 report assignment ( there is no loss ).
    There is no necessity to use " some ABAP code at line-selection ".
    This works.
    By the way is more correct from the beginning to formulate the issue including all the data about your problem and not include them by adding a little at a time.
    Regards.

  • Code order in sq02, Problem in the selection fields in sq01

    Hi all,
    I'm writing a query with sq01 and sq02.
    In sq02 I have some joined tables, and 2 extras fields named: "TIME" and "LEFT_ER".
    in this fields I wrote a code to calculate something from fields in the tables.
    The problem is:
    1. When I write the code in the coding section "Additional field/structure" for each field, If I want to use this fields in the selection fields (in sq01) the query can't find any record.
    But if I run this query without any selection in this fields, I get all the records, with my calculated fields.
    2. I tried to write this code in the coding section "Record processing", and it seems that I can use this fields in the selection fields (in sq01), and get all the records I wanted.
    But in the sq02 I get a Warning messages:
    "Access error in code for additional field *GET******
    *GET****** has sequence number 00
    Access to LEFT_ER with sequence number 00"
    In this case my field LEFT_ER has no code.
    And when I change the order of the sequence number, I didn't get the Warning message, but I could not use my fields in the selection fields (in sq01), like at the beginning.
    HELP ME PLEASE.
    Itzhak.
    Message was edited by: Itzhak Tanami

    Hi,
    i've an idea .
    pls define your help-fields :
    1) as sel-option : s_f1 for bseg-dmbtr
    and
    2) as calculate-field  : c_f1 for bseg-dmbtr
    so for event e.g. GET BSEG .
    you <b>1st</b> calculate your field .
    e.g.
    if bseg-shkzg = 'H'.
       c_f1 = Bseg-wrbtr * -1.
      else.
       c_f1 = Bseg-wrbtr.
    endif.
    and 2nd  your restriction from sel-screen:
    <b>check c_f1 in s_f1.</b>
    good luck
    Andreas

  • 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?

  • SQ02 Create a query whit the structures.

    Dear gurus ,
    i create a query SQ02 whit the initial impostation " Data retrieval by program"  and insert in the field "data structure" the name of the structures where are the value, example ( AFVGD).
    When run the query the value is blanck .
    I must for case to modify the program generated  from the system :
    REPORT  RSAQDVP_TEMPLATE.
      declarations
      (insert your declarations in this section)
    data:
      AFVGD                          type AFVGD                         ,
      it_data type standard table of AFVGD                         .
    field-symbols: <struc> type AFVGD                         .
      selection screen statements
      (define your selection-screen here)
    !! the following comment MUST NOT BE CHANGED !!
    *<QUERY_HEAD>
      read data into IT_DATA
    (select your data here into internal table IT_DATA)
      output of the data
      (this section can be left unchanged)
    loop at it_data assigning <struc>.
      move-corresponding <struc> to AFVGD                         .
    !! the following comment MUST NOT BE CHANGED !!
    *<QUERY_BODY>
    endloop.
    You could advise to me like?
    Thanks a lot for your help
    Daniel Pistilli

    Dear gurus,
    i need of display the data result of the transaction of the leveling capacity in the transaction (CM22).
    I find that this data is present in the structures RCYPP_GEN and after i create a inforecord and a query ( SQ02 and SQ01 ) whit this structures, but don't see the date in the query report.
    In the SQ02 this code abap don't is present in the area coding "in Record Processing section" but the system created a pulsant "data reading program" for link a the area where is present this abap code.
    Are there the soluction for my problem?
    Thanks a lot for you important help
    Daniele Pistilli

Maybe you are looking for