try and catch methods in oo abap code



METHOD materialset_create_entity.
  DATAls_request_input_data TYPE zcl_zmk_crude_mpc=>ts_material.
  DATAgs_table TYPE zcust_report.

*        ls_userinfo TYPE zuserinfo.

* Read Request Data
*

*    io_data_provider->read_entry_data( IMPORTING es_data = is_request_input_data ).

* Fill workarea to be inserted
  TRY.
      io_data_provider->read_entry_dataIMPORTING es_data ls_request_input_data ).
      gs_table-zzcust_no ls_request_input_data-zzcust_no.
      gs_table-zdno      ls_request_input_data-zdno.
      gs_table-zcust_loc ls_request_input_data-zcust_loc.
      gs_table-zmatnum   ls_request_input_data-zmatnum.
      gs_table-zmatdesc  ls_request_input_data-zmatdesc.
      gs_table-ztbtln    ls_request_input_data-ztbtln.
      gs_table-zdefct    ls_request_input_data-zdefct.
      gs_table-zlinef    ls_request_input_data-zlinef.
      gs_table-zdeftpr   ls_request_input_data-zdeftpr.
      gs_table-zlname    ls_request_input_data-zlname.
      INSERT zcust_report FROM gs_table.
      er_entity ls_request_input_data.
    CATCH
        cx_sy_conversion_no_number.
    CATCH
        cx_xslt_deserialization_error.
    CATCH
        /iwbep/cx_mgw_tech_exception.
      er_entity-zlname 'Server Error while calling the OData services Please with Developers'.
  ENDTRY.
ENDMETHOD.

Comments

Popular posts from this blog

all user exit mv45afzz (implicit user exit )

How to Give Dropdown in alv report in sap abap programming Language

Long Text in input and output field in module pool