Mapping exceptions to source code lines

From a JD-newbee: When an exception is thrown, it is always nice to get to know the exact line in the source code that caused the exception. I am currently unable to get such info, and suspect that this is due to JIT-compiling being active, but have been unable to figure out how to disable the JIT. Could anyone please let me know how to disable the JIT, or, if that's not the solution to my problem, tell me what I should do?

Hi,
try this report [https://wiki.sdn.sap.com/wiki/display/Snippets/SearchforStringsinABAPSourceCode].
For counting the lines you specify a search string of
The includes for classes can be specified by
ZCL_XY*
Best regards
Thomas
Edited by: Thomas Schulz on May 4, 2010 1:33 PM

Similar Messages

  • How to count source code lines?

    Hi guys!
    I have a task to calculate total amount of lines of source code. The only way i have found out is to get report
    with read report prog into itab statement and get number of lines with describe itab lines num_of_lines.
    But in this way it is not possible to handle classes for example. Is it possible to count lines with SQL statement?

    Hi,
    try this report [https://wiki.sdn.sap.com/wiki/display/Snippets/SearchforStringsinABAPSourceCode].
    For counting the lines you specify a search string of
    The includes for classes can be specified by
    ZCL_XY*
    Best regards
    Thomas
    Edited by: Thomas Schulz on May 4, 2010 1:33 PM

  • Message Mapping activation error-Source code has syntax errors in UDF

    Hi all,
    I wrote a small UDF for sum of 2 numbers:
    import
    udf.*
    public String getsum(String a, String b, Container container) throws StreamTransformationException{
    int c = Integer.parseInt(a);
    int d = Integer.parseInt(b);
    int e = packageDemo.getSum(c,d);
    return e+"";}
    In imported archives, i imported pack.jar
    In D:\udf , I have packageDemo.java, packageDemo.class, aii_map_api.jar, pack.jar(has the other 3)
    packageDemo.java :-
    package udf;
    public class packageDemo{   
        public static int getSum(int a,int b)
            int c= a+b;
            return c;
    Did i miss anything?? Icant activate message mapping for 2 errors:-
    1.package udf does not exist
    2.Function getsum, Line 3:
    cannot find symbol symbol : variable packageDemo location: class com.sap.xi.tf._xml_mm_int e = packageDemo.getSum(c,d); ^Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.2 errors
    Edited by: NagaDurga Nannapaneni on Oct 16, 2008 1:07 PM

    Hi ,
    Think the error is coming because the content in imported archive is not being taken into message mapping at all...so package, class, method ..nothing is identified.
    Can anyone suggest the solution..
    Thanks,
    Durga

  • Source Code Longer Than Table --Dump. Wht to do?

    Hi All,
    I have created a Z-subrouitne pool and coded print program with Entry rountines for smartforms in it. When I tried to maintian the output control, stating the name of program and entry rountine of it, it is throwing dump while saving.
    it is saying:
    <b>The ABAP source code lines are longer than the width of the internal</b>
    The detail is:
    An exception occurred. This exception is dealt with in more detail below       
    . The exception, which is assigned to the class 'CX_SY_READ_SRC_LINE_TOO_LONG',
      was neither                                                                   
    caught nor passed along using a RAISING clause, in the procedure               
      "NAST_FORM_EXISTENCE_CHECK" "(FUNCTION)"                                      
    Since the caller of the procedure could not have expected this exception       
      to occur, the running program was terminated.                                 
    The reason for the exception is:                                               
    You tried to read the program "SAPMZMM_PRINT" from the database. The READ      
      REPORT                                                                        
    statement allows you to copy a program's source code into an internal          
    table. The lines of source code must not be longer than the width of the       
      internal table. <b>The internal table is 72 characters wide. The source          
    code line is 87 wide.    </b>                                                      
    But I kept all the line (and re adjusted the longer one) within 72 char. the why am I  facing this error? please suggest how to correct it.
    Rewards point guranteed.
    Anid.

    HI,
    in order to be sure, open the abap editor and click Utilities->Settings and check Downward-Compat. Line Length (72). Then go to SAPMZMM_PRINT and do a pretty print or  just activate it. This should be ok.
    Kostas

  • QUERY_VIEW_DATA generates exception in ABAP code

    Hi,
    I have activated service QUERY_VIEW_DATA in SAP BW environment 7.0 service pack: SAPKW70008
    During testing of the webservice I encounter an exception in source code on the ABAP side:
    CL_SRG_RFC_PROXY_CONTEXT======CM002
    THe following statement generates the exception:
    -7b- deserialize data
            SRT_TRACE_WRITE_PERF_DATA_BEG 'FM_PROXY->DESERIALIZE'. "#EC NOTEXT
            call transformation (template)
                source xml l_xr
                result (st_to_abap).
            SRT_TRACE_WRITE_PERF_DATA_END 'FM_PROXY->DESERIALIZE'. "#EC NOTEXT
    The call transformation dumps immediately.
    Value of TEMPLATE = /1BCDWB/WSS0041112143114038399
    I tried all threads in SDN but to no avail.
    Has anybody encountered the same error?
    kind regards,
    Paul

    Hi Arun,
    I logged in to Web Service Navigator and i get to the screen where it asks me to enter Info provider, Selection variables, Query name and View id. Since my Query does not have any selection parameters i only entered Info provider and Query name and left selection and view id
    when i execute i get two boxes one for Request and other for Response. On top of these box i have InvalidVariableValues error message...Complete response message is as follows
    HTTP/1.1 500 Internal Server Error
    Set-Cookie: <value is hidden>
    Set-Cookie: <value is hidden>
    content-type: text/xml; charset=utf-8
    content-length: 600
    accept: text/xml
    sap-srt_id: 20100830/133557/v1.00_final_6.40/4C7B07E332A20095E10080000A754720
    server: SAP NetWeaver Application Server / ABAP 701
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header></soap-env:Header><soap-env:Body><soap-env:Fault><faultcode>soap-env:Client</faultcode><faultstring xml:lang="en">InvalidVariableValues</faultstring><detail><n0:GetQueryViewData.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style"><Name>InvalidVariableValues</Name><Text>Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET ()</Text><Message><ID>BRAIN</ID><Number>369</Number></Message></n0:GetQueryViewData.Exception></detail></soap-env:Fault></soap-env:Body></soap-env:Envelope>
    Thanks
    Surya

  • Scrolling  messes source code on JDeveloper 10.1.3.5 Windows 7 (64 bit)

    Hello!
    One can only work around the problem as in vista, by using a new Sun jdk, other than that shipped with JDeveloper.
    However, this is not considered safe, as the newer jdk is neither tested nor certified to work with that version of JDeveloper.
    I have already searched My Oracle Support, only to find a patch about a memory leak for JDeveloper 10.1.3.5. +(I wonder why is it not offered to the public anyway?+)
    Could any one from Oracle please see to a more permanent and safer solution to the problem?
    I am looking forward for your prompt actions, and thank you very much in advance!

    Let me rephrase: when one scrolls using page up or down keys, or by using a mouse wheel, the source code lines ( and characters) appear partly only, either distorted or overlapping with each other, in such a way that one cannot make out what has been written. I hope the above clarifies the problem in question. In such a case a screen shot might actually serve us perfectly.
    I have already given your suggestion a try, without any success.
    Thanks anyway very much for your reply!
    Any other helping hand available?
    TIA!

  • Procedural ABAP refactoring or mass source code replacement

    I am trying to change hard coded values from multiple source codes with respective constant names. Is there a tool to find and replace them according to a rules table. I wouldn't mind even if this tool was not in SAP (eg. Eclipse).
    Thank you in advance,
    Michalis.

    Dear Thomas,
    thank you for your prompt response.
    My idea was (and is) that since the ABAP compiler is embedded in Netweaver, it would be smart to get the compiler functionality together with regular expressions declaration in order to do what unix like systems do for years, replace strings with other strings. The program you suggest is well known for finding literals (substrings) in source, but when it does you never know what is the role of the literal on the source code line (in the particular code statement).
    Of course I agree with you regarding the term refactoring, that a human eye is needed, if I was to do real source code pattern recognition and replacement, but my driving need is more simple and way far from that (at least for now).
    Please keep me posted in case you have any news on the subject.

  • Sourse code line  not showing when exception occurs on Oracle App server

    I am working on Oracle9i As 9.03. I have deployed an ear file. When an exception comes in my API, ti does not pring the source code like. it says Unknown Source . while it prints the line no of other apis down the stack.

    This is because we have reference to stub at the client end and that is created by container and moreover it is remote object. Remote object line numbers never come in stack trace. For the other object you are getting the line number, those are not Remote Objects.
    Thanks
    Pardeep Sharma

  • Source code not generated in mapping

    Hi,
      I tried mapping an Idoc to an XSD in my mnessage mapping.When I try to check my message mapping I get an error msg : "<Mappingname> has no Source Code"...My scenario is only some fields of Idoc map to the XSD and the rest are constants..I am in XI3.
    Any help is appreciated...
    -Teresa

    Hi Teresa,
    Have you tried deleting the map and re-doing it ? Or is this unfeasible ?
    Cheers
    Colin

  • Source code has syntax error in SAP PI7.1 Mapping Test

    HI All,
    IN SAP P7.1  created simple two data types, message types and Message Mapping with only 2 fields. While testing the mapping in Message Mapping it is giving the error as
    Source text of object Message Mapping: MM_Source_to_Target | http://abc.com has syntax errors:
    Source code has syntax error:
    I am able to activate the Datatypes and Message Types but not able to activate the Messge mapping.
    Please if any body faced the same problem please give the solution.
    One more thing is I am able to test the Message Mapping available in BASIS 7.1 Software Component objects. It is executing successfully...
    but otherthan this SWC it not working success fully.....
    Regards
    Sridhar Goli

    Hi David,
    please check the default trace. It may contain the entry:
    Error in compiling : java.io.IOException: Not enough space
    If that's the case, maybe there's too little space for the swap file/device.
    You should ensure that at least 2X (preferably 3X) of Heap (-Xmx) is configured as real swap
    Hope that helps.
    Regards,
    Gábor Klauzer

  • Error: missing ] after element list Source File: javascript:%20[object%20XULElement] Line: 1, Column: 9 Source Code: [object XULElement]

    Can you help me out in letting me know what this means and how I can fix this? I found it in my tools menu under error console. It was listed as a warning, but then there was a option to highlight and evaluate the original warning message that was listed as
    Warning: Expected color but found 'null'. Error in parsing value for 'background-color'. Declaration dropped.
    Source File: http://www.msn.com/
    When I cut and pasted message in the code evaluate box and pressed enter the warring message became an error then stated:
    Error: missing ; before statement
    Source File: javascript:%20Warning:%20Expected%20color%20but%20found%20'null'.%20%20Error%20in%20parsing%20value%20for%20'background-color'.%20%20Declaration%20dropped.%20Source%20File:%20http://www.msn.com/%20Line:%200
    Line: 1, Column: 10
    Source Code:
    Warning: Expected color but found 'null'. Error in parsing value for 'background-color'. Declaration dropped. Source File: http://www.msn.com/ Line: 0
    I am writing to ask for guidance on what to do and how to fix this.
    I current have Firefox as my default browser. I have IE 9 and Windows 7 home ed on my HP lap top that has AOL preloaded into it as the mail provider. I am a beginner user and when I got the computer my cousin set up Mozilla and Firefox as a search browser and I like it.
    I also have norton security

    I think, the problem is with the order (in configuration file) of path to search headers:
         /opt/oracle/product/10g/10.2.0/precomp/admin/pcscfg.cfg
              sys_include=(/usr/include,/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include)
              include
              include=(/usr/include)
              include=(/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include)
    In the filesys:
         ./usr/include/sys:
         -r--r--r-- 1 bin bin 17786 Aug 13 2007 types.h
         ./opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/sys:
         -rw-r--r-- 1 root system 18288 Mar 22 2008 types.h
         mode_t came from:
         #include <sys/types.h>
    sys/types.h:
         * POSIX Extensions
         typedef unsigned int uint_t;
         typedef unsigned long ulong_t;
         * POSIX and XOPEN Declarations
         #if defined(_LP64) || defined(_I32LPx)
         typedef uint_t mode_t; /* file attribute type */
         #else
         typedef ulong_t mode_t; /* (historical version) */
         #endif

  • Is there a way to restrict the cursor at the end of a line in the source code editor??

    In the source code editor, the cursor will always follow where I click. But I wanna restrict it at the end of a line, just like other text editors do. Is there a option or sth? I can't put up with it any longer.
    Solved!
    Go to Solution.

    Hello morphe!
    The source editor in the LabWindows/CVI environment is constructed under the concept of virtual space.
    At the moment, in the current version of LabWindows/CVI, this is the default behavior, which cannot be changed from the editor preferences dialogs.
    Best regards,
    - Johannes

  • Extra blank lines in source code

    I have built a website in Dreamweaver CS4 and have a client editing pages in Contribute CS5. Both of us are working on Windows 7, and the site is hosted on Linux. When she makes edits to the page, something is introducing a GAZILLION blank lines in the source code. A typical page for this site is about 380 lines of code. The problem page is now more than 310,000 lines code with 100-200 blank lines between every "real" line of code. What the...?!
    I need to know how to stop this and how to remove the blank lines from the source code using Dreamweaver.
    The page in question lives here: http://www.alexandercitychamber.com/member-category.html
    HELP!!!
    Jeff

    Hello, Diane -
    We've got two separate issues here, but I think we have the solution to both.
    1. How to stop Contribute from adding blank lines in the code, and
    2. How to clean up a GAZILLION lines of blank code in a document.
    First, Number 1. I assume you're working in Dreamweaver. If not, I'm not sure how to guide you. But, when you define a Contribute Site, there is an area to specify administrative roles and permissions. Under each Role, at the bottom, you will see a popup for what kind of server the site is hosted on. The default is Windows. I had to change this to Unix (Linux) to match the hosting of our problem site. Find out what platform your host is using. You will have to specify this under each admistrative Role. After doing this, I had the client make some edits, then I opened the files in Dreamweaver. No new blank lines. I admit, I still have my fingers crossed somewhat.
    Okay, now how to clean up your source code and remove blank lines. A developer friend found this on some forum I had not seen. I don't know where, but I am grateful to the person who wrote it. It didn't get all the blank lines in my files, but I think some of the others, which I removed manually, were probably from the client pasting content in from Word. Here's what to do:
    1. Open the file in Dreamweaver
    2. Click CTRL + F, or go to EDIT > FIND AND REPLACE
    3. Select "Current document" in "Find In" (You can also select the folder if you have multiple files.
    4. Search in "Source Code"
    5. Check the box labeled "Use regular expression"
    6. Type "[\r\n]{2,}" (without quotes) in "Find"
    7. Type "\n" (without quotes) in "Replace"
    8. Press "Replace All"
    The operation chugged for a few minutes with my 301,000-line document. Yours may a take a little longer, but it did work. Good luck!
    Jeff
    [email protected]

  • Getting an Object Identifier String given a line of source code? HELP!

    (forgot to close the code tag on that last one!)
    Hi there,
    I am in desparate need of getting the object identifier given a particular line of source code. I need this for the debugger I'm writing, and since the jdb forum never gets reponses; just more unanswered questions.
    Right so, here's my problem in more detail. I can find out when a method is called in the Java virtual machine, and what its name is, and arguments and values and such like - using the Java Debugging Interface. BUT: unfortunately I cannot get the object identifier used in the source code that generated this call. I can however get a unique long id that identifies this object .. if that helps?(thinking hashtables here maybe?!)
    So, I may know that the constructor of EddClass has been called, and this the following line generated this call:
    EddClass edd = new EddClass();.. so what I need is a fail safe way of finding out "edd" from this - given all types of method calls.
    This is quite tricky because there are loads of ways methods can be called e.g.
    tty.getClassExclusions(); // Here I would know getClassExclusions had been called, and I would need to find out the object identifier "tty" called it
    Temp a, b, c;
    a = b = c = new Temp(); // Here I would know the constructor for Temp had been called, but now I would just want to know "c"
    AnotherEg ae = (new Egg()).getAnotherEg(); // and in this last case if I had found out that the Egg constructor had been called, I don't want to find out any object identifier from this line of code - since the object is anonymous; however if I had found out that getAnotherEg() had been called I would want "ae"Ok, well - please help: I'm making a Java Animator that will be freely available - that serves to graphically animate the execution of another java program. It'd be cool if one of you guys could help make it really cool. Plus there are Dukes available!!
    - Edd.

    this is quite a complicated question I think!
    I'm not sure but you maybe need to know just about the whole java lang. spec to do this.
    I'm sure there are plenty of free java parsers around, so unless you have a lot of time available its probably best to download one, figure some way to feed it a single line from within a code block, and extract its symbol table.
    Once you have the symbol table, there will probably be some other data available from the parser to say which are identifiers.
    Its then up to your debugger to figure out which one is the interesting one!
    sorry this is so vague but I think you've asked for something that is quite involved!
    asjf

  • Need script or Program to count lines of source code

    Hello, I need a script or a program that can count how many lines are there in a directory contains source code as well as other directories(contain code as well), there are .java files in these directories, the script or program should count number of lines with/without comments(starts with // or surrounded by /**/)
    Thanks a lot!!!

    I wrote a quick python program to count the lines in a file, you could just adapt it to your needs, or use the second program I have in this post that condenses all the .java files in a directory into a single text file, which you can then use a line-count on (useful if you need to print it as well - I wrote it for my IB dossier java project), if you'd like a proper script for your needs, otherwise check the other suggestions.
    Run it by copying the code into a text file and saying it as script.py (change script to whatever you want) and running it with python /path/to/script.py
    #!/usr/bin/env python
    #Program to tally the lines in a file
    #Author: lswest
    import os
    home=os.path.expanduser("~")
    endPath=raw_input("Path to file relative to your home directory (include file name and extension): ")
    count=0
    ff=open(os.path.join(home, endPath))
    for x in ff:
    count+=1
    values={'name': os.path.join(home,endPath), 'count' : count}
    print "The file %(name)s contains %(count)s lines." % values
    #!/usr/bin/env python
    #Script to condense the multiple files of a project into one for easy printing/copying
    #Author: lswest
    import os
    home=os.path.expanduser("~")
    endPath=raw_input("Path relative to your home directory to the project folder: ")
    extension=raw_input("Extension of files you want to condense: ")
    outPath=raw_input("Path to output file relative to home directory: ")
    outFile=raw_input("Output file name (including extension): ")
    ff=open(os.path.join(home+outPath,outFile), "wt")
    for root, dirs, files in os.walk(os.path.join(home,endPath), "true", "none", "true"):
    for infile in [f for f in files if f.endswith(extension)]:
    fh=open(os.path.abspath(os.path.join(root,infile)))
    for line in fh:
    ff.write(line,)
    fh.close()
    ff.close()
    Last edited by lswest (2009-03-10 16:23:52)

Maybe you are looking for