Sunday, May 31, 2026

OData 5: Step for Delete

  • The DELETE operation comes into play whenever an existing entry needs to be Delete.
  • Similar to the other methods, that you need to redefine this method in the DPC extension class same as follow all the Step till 9
  • First, again handle the primary key of the entry to be deleted. With this information.
  • DELETE operations are always executed on a single entry. Therefore, you have to provide a URI that addresses a single-entry resource. The HTTP method has to be DELETE.
  • If DELETE was successful, you get an HTTP 204 (no content) response. 
  • Code: 
  • Method Code:

METHOD salesheaderset_delete_entity.


"&... Read key value

DATA(lv_sales_order) = VALUE #( it_key_tab[ name = 'SalesOrder' ]-value OPTIONAL ).

lv_sales_order = CONV vbeln( |{ lv_sales_order ALPHA = IN }| ).


DELETE FROM zms_sales_head WHERE vbeln = lv_sales_order.

IF sy-subrc EQ 0.

COMMIT WORK.

ELSE.

ROLLBACK WORK.

mo_context->get_message_container( )->add_message_text_only(

iv_msg_type = /iwbep/if_message_container=>gcs_message_type-error

iv_msg_text = TEXT-004 ).

RAISE EXCEPTION NEW /iwbep/cx_mgw_tech_exception( message_container = mo_context->get_message_container( ) ).

ENDIF.


ENDMETHOD.

  • Output:


RAP8: Early numbering

In this post will show you how to use early numbering . Step 1: Add early numbering key word in interface behavior definition and activate b...