‎2008 Jan 18 4:05 PM
Hello!
Could someone please help me?
After calling a function, I catch errors with sy-subrc NE 0.
Handling this error the "normal" way throws a short dump (I marked the row bold), because all the system fields are empty!
Could someone please give me a hint, how to handle this situation?
Many thanx in advance!
Perhaps some code:
CALL FUNCTION 'Z_CONFIRM'
EXPORTING
is_bdnum = is_bed-bdnum
TABLES
et_return = lt_return
EXCEPTIONS
error_occured = 1
lock_error = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
I get a short dump with this:
Content of the system fields |
-
Name | Wert |
-
SY-SUBRC | 1 |
SY-INDEX | 1 |
SY-TABIX | 1 |
SY-DBCNT | 0 |
SY-FDPOS | 0 |
SY-LSIND | 0 |
SY-PAGNO | 0 |
SY-LINNO | 1 |
SY-COLNO | 1 |
SY-PFKEY | |
SY-UCOMM | |
SY-TITLE | HTTP-Steuerung |
SY-MSGTY | |
SY-MSGID | |
SY-MSGNO | |
SY-MSGV1 | |
SY-MSGV2 | |
SY-MSGV3 | |
SY-MSGV4 | |
SY-MODNO | 0 |
SY-DATUM | 20080117 |
SY-UZEIT | 080907 |
SY-XPROG | |
SY-XFORM |
‎2008 Jan 18 4:17 PM
Hi,
You need to capture the message like this way
IF sy-subrc eq 1.
message e999(your mesage class) with 'Error Occured'.
endif.
IF sy-subrc eq 2.
message e999(your mesage class) with 'Lock error'.
endif.
IF sy-subrc eq 3.
message e999(your mesage class) with 'Other Errors'.
endif.
a®
‎2008 Jan 18 4:08 PM
‎2008 Jan 18 4:12 PM
‎2008 Jan 18 4:16 PM
Hello,
I think you are not raising the exception.
If any error occured inseide ur FM. U need to raise the exception like this.
RAISE lock_error.
This will avoid the dump.
Thanks !!!
Vasanth
‎2008 Jan 18 4:17 PM
Hi,
You need to capture the message like this way
IF sy-subrc eq 1.
message e999(your mesage class) with 'Error Occured'.
endif.
IF sy-subrc eq 2.
message e999(your mesage class) with 'Lock error'.
endif.
IF sy-subrc eq 3.
message e999(your mesage class) with 'Other Errors'.
endif.
a®
‎2008 Jan 18 4:31 PM
Excellent. Sometimes I need a little hint.
Many thanks and best regards.