Home > SAP Tips > ABAP/Java developer tips > Troubleshooting ABAP code errors
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ABAP/JAVA DEVELOPER TIPS

Troubleshooting ABAP code errors


Ben Meijs, Contributor
12.27.2005
Rating: -3.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Often when an error occurs in your ABAP code, it would be helpful to display how the error occurred, in which routine or method the error occurred and how you got to this routine.

Use function SYSTEM_CALLSTACK to display the call hierarchy (for example, in error handling). Using this function, you can show this extra information to help analyze the problem. This function works on a Basis system -- version 4.6 C or higher.

Code

 
REPORT zz_system_callstack.
* Example of using the system callstack function
DATA: ta_callstack TYPE  sys_callst,
      wa_callstack LIKE LINE OF ta_callstack.

START-OF-SELECTION.

  PERFORM call_routine_1.

*&--------------------------------------------------------------------*
*&      Form  call_routine_1
*&--------------------------------------------------------------------*
FORM call_routine_1.

  PERFORM call_routine_2.
ENDFORM.                    "call_routine_1
*&--------------------------------------------------------------------*
*&      Form  call_routine_2
*&--------------------------------------------------------------------*
FORM call_routine_2.

  CALL FUNCTION 'SYSTEM_CALLSTACK'
    IMPORTING
      et_callstack = ta_callstack.

  LOOP AT ta_callstack INTO wa_callstack.
    WRITE: / wa_callstack-progname,
             wa_callstack-eventtype,
             wa_callstack-eventname.
  ENDLOOP.
ENDFORM.                    "call_routine_2

The output will look like this:
ZZ_SYSTEM_CALLSTACK                      FORM         CALL_ROUTINE_2

ZZ_SYSTEM_CALLSTACK                      FORM         CALL_ROUTINE_1

ZZ_SYSTEM_CALLSTACK                      EVENT        START-OF-SELECTION

Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
ABAP/Java developer tips
Is this the quickest way to find a BADI?
ABAP Objects in SAP Workflow to provide improved performance
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects
Find a BADI in a minute
Top 10 SAP tips of 2007
How to transport an SAP query in R/3 4.6x
How to switch off message determination in BAPI_PO_CREATE1
How to include an authorization group restriction in an SAP query
How to use quick-views of other users

SAP ABAP
Is this the quickest way to find a BADI?
ABAP Objects in SAP Workflow to provide improved performance
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects
Is there a 'load of program' option in report generation?
Deleting entries from a dynamic table
Defining a structure in a report
How can ABAP developers survive in a NetWeaver era?
Validating table fields
The difference between field groups and internal tables
SAP ABAP Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
ABAP  (SearchSAP.com)
ABAP Objects  (SearchSAP.com)
ABAP Workbench  (SearchSAP.com)
BAPI  (SearchSAP.com)
CATT  (SearchSAP.com)
R/3 Repository  (SearchSAP.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsBlogsTipsAsk the ExpertsWebcastsWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts