IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_return3
USING MESSAGE.
ENDIF.
IF sy-subrc <> 0.
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_system_message( ).
RAISE EXCEPTION lx_return.
ENDIF.
IF sy-subrc <> 0.
"<English message text>
RAISE EXCEPTION TYPE zcx_return3
MESSAGE e001
"WITH iv_<variable>
.
ENDIF.
IF sy-subrc <> 0.
"<English message text>
MESSAGE e001
"WITH iv_<variable>
INTO DATA(lv_dummy) ##NEEDED.
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_system_message( ).
RAISE EXCEPTION lx_return.
ENDIF.
DATA ls_return TYPE bapireturn.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapireturn_struc( ls_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA lt_return TYPE zcx_return3=>gtt_bapireturn_t.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapireturn_table( lt_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA ls_return TYPE bapiret1.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapiret1_struc( ls_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA:
lt_return TYPE bapiret1_tab.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapiret1_table( lt_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA ls_return TYPE bapiret2.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapiret2_struc( ls_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA:
lt_return TYPE STANDARD TABLE OF bapiret2.
"...BAPI call
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bapiret2_table( lt_return ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
DATA lt_bdc_messages TYPE zcx_return3=>gtt_bdc_messages.
* CALL TRANSACTION '???'
* USING lt_bdcdata
* MODE '?'
* UPDATE '?'
* MESSAGES INTO lt_bdc_messages.
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_bdc_table( lt_bdc_messages ).
IF lx_return->has_messages( ) = abap_true.
RAISE EXCEPTION lx_return.
ENDIF.
TRY.
"...method call
CATCH cx_root INTO DATA(lx_root). "TODO: change exception class
"<Short error name>: &1&2&3&4
MESSAGE e001 "Todo: change error number
INTO DATA(lv_dummy).
"Method will split message text into &1 &2 &3 &4
DATA(lx_return) = NEW zcx_return3( ).
lx_return->add_exception_object( lx_root ). "Change variable name
RAISE EXCEPTION lx_return.
ENDTRY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |