 |
 |
| SAP Tips: |
|
 |
 |

ABAP/JAVA DEVELOPER TIPS
Troubleshooting ABAP code errors
Ben Meijs, Contributor 12.27.2005
Rating: -3.50- (out of 5)




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


');
// -->
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.
|
 |
|
|
 |
|
 |
 |
 |
 |
| 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 . |
|
| | |
All Rights Reserved, , TechTarget |
SearchSAP.com is a search service provided by TechTarget and is completely independent of and not affiliated with SAP AG.
|
|
|
|
|