Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ZCL_A4C_RFC_XXX definition
- public
- final
- create public .
- public section.
- interfaces if_oo_adt_classrun.
- protected section.
- private section.
- ENDCLASS.
- CLASS ZCL_A4C_RFC_XXX IMPLEMENTATION.
- METHOD IF_OO_ADT_CLASSRUN~MAIN.
- TRY.
- DATA(lo_destination) = cl_rfc_destination_provider=>CREATE_BY_CLOUD_DESTINATION(
- i_name = 'S70_RFC_000'
- i_service_instance_name = 'OutboundComm_for_RFCDemo_000'
- ).
- DATA(lv_destination) = lo_destination->get_destination_name( ).
- DATA lv_result type c length 200.
- DATA: msg TYPE c length 200.
- CALL function 'RFC_SYSTEM_INFO'
- destination lv_destination
- IMPORTING
- RFCSI_EXPORT = lv_result
- EXCEPTIONS
- system_failure = 1 MESSAGE msg
- communication_failure = 2 MESSAGE msg
- OTHERS = 3.
- CASE sy-subrc.
- WHEN 0.
- out->write( lv_result ).
- WHEN 1.
- out->write( |EXCEPTION SYSTEM_FAILURE | && msg ).
- WHEN 2.
- out->write( |EXCEPTION COMMUNICATION_FAILURE | && msg ).
- WHEN 3.
- out->write( |EXCEPTION OTHERS| ).
- ENDCASE.
- catch cx_root into data(lx_root).
- out->write( lx_root->get_text( ) ).
- endtry.
- ENDMETHOD.
- ENDCLASS.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement