Debugging a SAP Query

Hi,
I have created a SAP query using the tcodes sq01,sq02 and sq03.
Have added an additional field to retrieve some text and wrote the code also inside the query.
Now i want to debugg the query.
How do i degubb a sap query?
Thanks in Advance,
Regards,
mani

find out program name with:
SQ01 - query - more functions - display report name
(example : AQZZ/GRC/APPL===FI_AP_20_Q1===)
-> search for your add. coding / field in this report and set break-points
hope that helps
Andreas

Similar Messages

  • Debugging in SQ02 (Sap Query Report)

    Hi All ;
    I want to learn that ,how can I debug a sap query report.I added some fields to the query with code.
    How can I reach that code by debugging ?Thanks for your reply.
    Regards.
    Fırtına.

    Hi Yigit,
    Every Query generated one program like  AQZZ/FSCMA/IS===CDM_10_Q1=====
    Go To your QuerySQ01 , run your query and From selection screen, check your program name  after that you can search your added code. what you added in infoset but your breakpoint  and debug your query code.
    Regards,
    Prasenjit

  • How to call SAP query in a program

    Hi experts
      I have created a query in SQVI its gives a result. Now i want this query to be used in my program. Is there any FM which gets the quary name and populates the result in iternal table. So that i can use that result.
       I know without query you can write using the tables you can fetch the records but i just want to explore a new way to do things. If any body done such type let me know and also give some sample code or process how to achieve it.
    Regards
    Vijay

    Hi Siva
      My final option is that only. That you can do any how. But my intension is to learn something new way. How to do copy the query and where to inject the code is there any example in wiki or artical for that. I want to something new. Old way of creating a report program is possible i want to do this way. If some body could help me out.
    @ karthik
       I have generated the SAP query and i got the program but when i view the code i dont find any select statment or where storing my input data. How to identity that i did in debug mode but am not sure where it pulls the data and where it put in internal table. Can you throw some light with example code or an article.
    Regards
    Vijay

  • Sales Order Text Lines in SAP Query

    I have a requirement to output several text lines into a SAP query based around sales orders.
    I have included some code to read the details into my query and get no syntax errors, however the report gives a blank output for each of the text fields included, despite there definitely being some text with the specified attribute ID and text object in the table STXL.
    Where am I going wrong?
    Please find the coding below for one of the text field I'm trying to extract:
    TABLES:STXL.
    DATA:
        VBELN LIKE VBAP-VBELN,
        POSNR LIKE VBAP-POSNR,
        TDNAME LIKE STXL-TDNAME,
        MYLINE LIKE TLINE-TDLINE,
        ZE18_LINE(1200) TYPE C.
    DATA:BEGIN OF LINES OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF LINES.
    DATA:BEGIN OF MYHEADER.
            INCLUDE STRUCTURE THEAD.
    DATA:END OF MYHEADER.
    CLEAR TDNAME.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-VBELN
    IMPORTING
      OUTPUT = VBELN.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT = VBAP-POSNR
    IMPORTING
      OUTPUT = POSNR.
      CONCATENATE VBELN POSNR INTO TDNAME.
    CALL FUNCTION 'READ_TEXT'
        EXPORTING
            ID = 'ZAT2'
            LANGUAGE = SY-LANGU
            NAME = TDNAME
            OBJECT = 'VBBP'
         IMPORTING
            HEADER = MYHEADER
         TABLES
            LINES  = LINES
    EXCEPTIONS
            ID = 1
            LANGUAGE = 2
            NAME = 3
            NOT FOUND = 4
            OBJECT= 5
            REFERENCE_CHECK = 6
            WRONG_ACCESS_TO_ARCHIVE = 7
            OTHERS = 8.
    IF SY-SUBRC = 0.
      LOOP AT LINES.
        MOVE LINES-TDLINE TO TEXT.
        ENDLOOP.
    ENDIF.

    Hi -
    Please check in debuging.
    check the value of TDNAME correctly populated with sales order no and sales order item.
    You can cross check with the table STXH with TDNAME and see if any entries is available for TDID 'ZAT2' as your case.
    Here are sample code.
    DATA :    lv_tdname TYPE tdobname,
                     lw_line TYPE tline,
                    li_line TYPE STANDARD TABLE OF tline.
    CLEAR : lv_tdname , li_line[],
    cocatenate w_vbak-vbeln w_vbap-posnr into lv_tdname.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = 'ZAT2'
        language                = 'E'
        name                    = lv_tdname
        object                  = 'VBBP'
      TABLES
        lines                   = li_line
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
    IF sy-subrc = 0.
      CLEAR lw_line.
      loop at li_line INTO lw_line .
    * Put your logic
      endloop.
    ENDIF.

  • How to display long text in SAP Query ALV layout? It only show 129 char now

    I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
    Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
    thanks very much in addvance.

    Hi,
    ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
    Regards,

  • SAP Query failed...

    Hi all,
    I am working on the SAP Query by using transaction code SQ02, SQ03 and SQ01.
    I have also generated the program and copied display report name to create a transaction code for this report.
    I am able to use the transaction code in the Development Environment. However, when I transported everything into Quality Environment and run the transaction code. It prompt me a shortdump with the message "Program AQZZZQTEST=ZTEST=== not found".
    Anyone knows what is not right? How should I debug on this?
    Thank you so much.

    Create your query in the Global Area (Cross-client) instead of the Standard Area (Client-specific). When you create a query or Infoset in the Cross Client, you have to save your work in development package. Inturn, you will save your work in transportable request.
    So, if you create a tcode for this kind of query, their name will not change in the Other system and you will not get the dump.
    To change the Global Area, you can select it in Tcode SQ01 or SQ02: Environment > Query Areas
    Regards,
    Naimesh Patel

  • SAP Query not working

    Hi,
    I am facing problem with SAP Query. My query is not working for one particular date. Its giving timeout error when i just give date as input. I tried executing it by giving some particular document as input, then its giving "no data" message but when i check the table data, there are some records for that input condition.
    I debugged it, i found that the statement "FETCH NEXT CURSOR cursorname" is throwing sy-subrc eq 4. I couldn't understand the problem.
    Any inputs will be very helpful.
    Regards,
    Mahidhar.

    Hi Azeem,
    There are more than 10 tables that were used in this query with different types joins like inner join, left outer, right outer join. So i wasnt able to decode the select query that was present in open cursor command.
    I have given the date and executed the same in background. It ran in 19min. But when i add one more input parameter, then its running more than a day(still running ). Didn't get the exact problem still.
    Regards,
    Mahidhar.

  • Text of additional fields on SAP query show blank

    Hi All,
    I'm encountered a problem when text of additional fields on SAP query is not working and it's show blank after HRSP is implemented.
    SAP_ABA : Rel. 701 Lvl. 3
    SAP_BASIS: Rel. 701 Lvl. 3
    SAP_HR: Rel. 604 Lvl. 8
    Below are the config that we have done before HRSP in table: TEXC_FLD_C and it's work perfectly.
    Table Name: P0000_AF
    Field Name: ZZAPPRATING
    Function Module: ZHRGYYFMPA_PDRATING_TEXT
    Exception Priority: 1
    Object Type Name: CL_HR_TEXT_IDENTIFIER
    During debugging, we found that program (Form: %_GET_PERAS) is retrieve text of additional fields based on structure P0000_AF. At this point, text of fields are successfully take place and filled. However, program try to retrieve the text based on structure P0000 again right after that. Due to additional fields are added on P0000_AF not P0000 and no ZZAPPRATING field found in P0000, hence program has cleared the text which filled in previously. This give the result, text is blank.
    Please advise, how should I get this resolved.
    Thank you very much.
    Best Regards,

    Please check this link:
    Re: query report
    I guess, it can help for your case too...
    Even this:
    Re: sap query infoset and fieldgroup
    Re: Additional field in SAP Query
    Kind Regards
    Eswar

  • Unusual Problem in SAP Query

    Hi Experts,
    I am facing a very Unusual problem in during SAP Query Devlopment.
    In Input screen I am taking value as User , which is coming from User02 table and field name is
    Bname . In USR02 table Username is maintained boths as Numeric num ( like 1236533) and Username wise ( Like gd.anil etc).
    But While running the query , Its execute only when giving the nUmeric Num , It wont executes if i give the name like gd.anil .
    This gd.anil is also maintained in USr02 table .
    Can anyone tell me why its happening.
    Thanks .
    Koro

    If the user ID is actually stored as lower case, then it was entered directly or with a screen field that doesn't have a screen mask.  You are most likely using the DB field in your selection screen and it's being converted to upper case after entry but before selection.  Have you debugged the generated program?  You should see this in the query.

  • GET LATE in SAP Query doesn't do a thing

    Hi dear reader,
    I have a problem with trying to add functionality into the GET LATE event in SAP Query, tr SQ02.
    The problem is: custom code is added into GET LATE for an infoset via the "Node extras" option, but this doesn't seem to have any effect whatsoever. Doing a thorough debug doesn't show any GET LATE event at all anywhere in the code.
    Am I missing something obvious here? Has anyone been successful in implementing GET LATE in an SAP Query
    ? System is 4.6C.
    Thanks and best regards,
    Richard

    hi,
    read this from abap-docu:
    The addition (used in GET node or GET node LATE) can only be used for nodes that are designated in the logical database for field selection ( SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab).
    A.

  • Error when uploading SAP query in ECC6 from 4.5B system

    Hi expert ,
    I have down loaded SAP Query(infoset) from 4.5B server and now i want to upload this query to ECC6.0.  when i upload this query(infoset) to ECC 6 as follows to download step like from SQ02 .  but after executing i am getting error
    "  infoset ZTEST (import option REPLACE)"
    " F | Error When generating Transport dataset
    I am following all steps even created user group in sq03 which it is in my 4.5b system.
    Thanks
    Chandra

    Hello,
    It won't usually work when you try to download a infoset from a older release and try to upload in a newer version. However there is a workaround for this.
    If you debug the program while uploading, you will notice that certain if conditions fail on a few fields in the file you are trying to upload are missing. What i would suggest you to do is, download any infoset from your ECC 6.0 version and keep it as a reference for filling these missing fields into the older version infoset you are trying to upload.
    Vikranth

  • Tcode to SAP Query

    Hi All,
    I have created a SAP Query and I have assigned a tcode in the dev Server, It is working fine in the Dvelopment But Throws a dump in the Quality and Production Server of Program not found and asks to create the program.
    The Program exists in se38 in the quality and Production Server and it works fine in the Devlopment Server.
    Nimisha Gandhi.

    Hi,
    1) set a break-point on:
    PERFORM load IN PROGRAM (i_s_prof_int-progname).
    and check which porgram-name is shown at runtime
    and search for this program and perform.
    if you don't find - create an oss-note
    what i can imagine - that it's a program, which should be generated at runtime - but wasn't gen. because of a syntax error!
    or
    try update debugging? Maybe this part is executed in an update task.
    Otherwise online/background version are really running different!
    or
    There is a dynamic call, which needs correct program in variable i_s_prof_int-progname.
    Obviously this is filled different (or not at all) in background run.
    Set a break-point and try to find out, how this field is filled. Maybe you get a hint, why this might be different in background
    Regards,
    Harini.S

  • Creation of SAP Query in SQ02 with Single Table With Condition

    Hi All,
    I want to Create SAP Query in SQ02 using single Table MCHA.
    ii) I dont want all entries of MCHA Table I mean , I have to apply some Condition on this Table.
    i.e  Suppose I am having actual data in MCHA table is like this for Material M1.
    Plant    Material   Batch   BatchCreationdate
    P1          M1         B1       20.06.2007
    P2          M1         B1       04.05.2009
    P3          M1         B1       04.05.2009
    But I want the Output of SAP Query is like this:
       Material   Batch   BatchCreationdate
          M1         B1       20.06.2007
    That is irrespective of Plant if Material & Batch are equal ---> 1st record with Lowest date shoud get at the output.
    Please help me How write the code on single table in the SAP Query.
    Thanks,
    Kiran Manyam

    Hi,
    Your query should be like this:
    Select MATNR CHARG HSDAT
    from MCHA
    into table t_mcha
    where matnr = Materlal number from selection screen.
    The structure of t_mcha should contain the fields that you select.
    Then sort the table by date ascending
    Sort t_mcha by HSDAT.
    Hope this solves your problem.
    Thanks,
    Sowmya

  • SAP query

    Hello ABAP Guru
    I need a help here. trying to create SAP query joining three table VBAK VBAP KONV since KONV being cluster table I am not able to do that
    thpough I am suceesfully establishe dthe link
    VBAK-VBELN=VBAP-VBELN
    VBAK-KNUMV=KONV-KNUMV & VBAP-POSNR=KONV-KPOSN
    OSS msg says we have to write routine in sap query
    but I never used that option
    anyone has any clue on how to use cluster table in SAP query?
    Thx
    Praveen

    Hi,
         Inner Join can't be  used for cluster tables.
         Write a routine in SAP query as follows.
          do inner join on vbak,vbap into internal table  
          itab.
           select for konv for all entries itab .           
    Regards
    Amole

  • SAP QUERY report for vendor line items

    Hi
    I have created a SAP QUERY report for vendor line items with fields vendor no.,vendor name,amount,company code and period.But there is one line item i donot know from wher system is getting it picked with is not in that vedor account,when i compare with fbl1n.I checked the document number too...the same doc number is twice in my query report.One with correct amount and another with wrong one.How do i chk.Where did i go wrong in creating query.I used logical database KDF.
    Please advise.

    i chked...how do we get the amount displayed in query...it just displays amount no debit credit symbol... i have selected BSEG-DMBTR field but no -/+ sign,how is it done in query,please suggest.

Maybe you are looking for

  • Customize the color of bars in chart

    Hi All, How to customize the color of a simple bars in a simple bar chart having Year and Sales as measure so that for each year different color is generated? Thanks, Sushil

  • Error when promote information space

    HI all, Environment:   BO BI - Explorer 4.1 SP3/SP4   IE 11, Firefox  31   Java 1.7 update 51/67 I would like to promote information space to LCMBIAR. I have a link between two information spaces, when i try to add object and click on add & close, ex

  • CVI 8.5 IDE fatal errors

    Several times now I've had CVI 8.5 crash on me when I'm closing an open project and opening another one. I get a CVI popup saying Lab Windows / CVI will be aborted   , location 001B:10258287.  It is not an OS popup - looks to me like an exception tha

  • Getting started with DW and PhoneGap

    I've checked the videos and the FAQs, and I can't seem to find an answer to this simple(?) question: How do you initially create a PhoneGap app within DreamWeaver? The videos show things such as how to upload/build/install/etc such an app, but they a

  • Any alternative to Scanner for fast processing?

    it seems that the Scanner class is very slow for reading from standard Input and processing data because it always lands me in exceeded time limit errors sepecially in online problem solving.so is there any aternative to it which would help in faster