2015 Aug 10 10:17 AM
Hi All,
I was trying to display SQL_MESSAGE but not successful. Can anybody help me out? We are on 7.4 SP09.
CATCH cx_amdp_error INTO DATA(lt_amdp_error).
DATA(lw_text) = lt_amdp_error->get_text( ).
MESSAGE lw_text TYPE 'I' DISPLAY LIKE 'E'.
-Amol S
2015 Aug 10 11:36 PM
Hi,
Your attribut SQL_MESSAGE seems to be public and defined in the CX_AMDP_DBPROC... Have you got something like that in your completion:
CX_AMDP_ERROR->CX_AMDP_DBPROC->SQL_MESSAGE ?
or,
CX_AMDP_ERROR->CX_AMDP_DBPROC->GET_TEXT( ) ?
Otherwise, try to:
1) copy the Class Exception: "CX_AMDP_ERROR" as "ZCX_AMDP_ERROR" from SE24.
2) Create a Getter method GET_SQL_MESSAGE that return your attribut SQL_MESSAGE.
And try this code. You have to type strongly your Exception instance to get the right cast on the good type.
TRY .
data lo_exception TYPE REF TO zcx_amdp_error.
CATCH cx_amdp_error INTO lo_exception.
DATA(lv_text) = lo_exception->get_message_sql( ).
MESSAGE lv_text TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
Rachid.
2015 Aug 10 11:36 PM
Hi,
Your attribut SQL_MESSAGE seems to be public and defined in the CX_AMDP_DBPROC... Have you got something like that in your completion:
CX_AMDP_ERROR->CX_AMDP_DBPROC->SQL_MESSAGE ?
or,
CX_AMDP_ERROR->CX_AMDP_DBPROC->GET_TEXT( ) ?
Otherwise, try to:
1) copy the Class Exception: "CX_AMDP_ERROR" as "ZCX_AMDP_ERROR" from SE24.
2) Create a Getter method GET_SQL_MESSAGE that return your attribut SQL_MESSAGE.
And try this code. You have to type strongly your Exception instance to get the right cast on the good type.
TRY .
data lo_exception TYPE REF TO zcx_amdp_error.
CATCH cx_amdp_error INTO lo_exception.
DATA(lv_text) = lo_exception->get_message_sql( ).
MESSAGE lv_text TYPE 'I' DISPLAY LIKE 'E'.
ENDTRY.
Rachid.
2015 Aug 11 7:31 AM
Hi Rachid,
Thanks for your reply.
I have archived like below.
CATCH cx_amdp_dbproc_create_failed INTO DATA(lt_amdp_error).
lw_text = lt_amdp_error->sql_message.
-Amol S
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |