odata 接收返回

 TYPES :BEGIN OF ty_ddftx,
             tabname   TYPE ddftx-tabname,
             fieldname TYPE ddftx-fieldname,
             headlen   TYPE ddftx-headlen,
             int       TYPE int4,
           END OF ty_ddftx.
    DATA: BEGIN OF ls_data.
            INCLUDE TYPE  /bshp/cl_read_table_ap_mpc=>ts_zread_table.
            DATA:  fields  TYPE  /bshp/cl_read_table_ap_mpc=>tt_fields,
            options TYPE  /bshp/cl_read_table_ap_mpc=>tt_options,
            data    TYPE  /bshp/cl_read_table_ap_mpc=>tt_data,
          END OF ls_data.

    DATA:ls_fields  TYPE  /bshp/cl_read_table_ap_mpc=>ts_fields.
    DATA: gt_dfies TYPE TABLE OF dfies,
          gs_dfies TYPE dfies.
    DATA: lt_return TYPE STANDARD TABLE OF bapiret2,
          ls_return TYPE bapiret2.
    DATA:lv_hlen TYPE char10.
    DATA:lv_int TYPE int4.
***********获取前台传入的值,必须有
    io_data_provider->read_entry_data(
                          IMPORTING
                          es_data = ls_data ).

******ls_data对数据处理
 ******messagexxxxxx
      APPEND ls_return TO lt_return.

      mo_context->get_message_container( )->add_messages_from_bapi(
      it_bapi_messages          = lt_return
      iv_determine_leading_msg  = /iwbep/if_message_container=>gcs_leading_msg_search_option-first ) .
      RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception " return code = 400
        EXPORTING
*         textid            = /iwbep/cx_mgw_busi_exception=>business_error
*         textid            = ls_textid.
          message_container = mo_context->get_message_container( ).
      RETURN.
    ENDIF.

    "返回给前台,必须有
    copy_data_to_ref( EXPORTING is_data = ls_data
                           CHANGING  cr_data = er_deep_entity ).

你可能感兴趣的:(odata 接收返回)