You need to REDEFINE method ENTITYSET_TASK and couple of other methods like GET_ENTITY etc. I am showing one for reference:
Please look at std SAP method for GET_ENTITY in the std class. Here is a sample example:
first get a handle to the Instance ID
CASE iv_entity_name.
WHEN 'InvoiceItem'.
* get work item's instance ID
READ TABLE it_key_tab INTO ls_key WITH KEY name = 'InstanceID'.
READ TABLE it_key_tab INTO ls_key_item WITH KEY name = 'InvoiceLineItem'.
lv_wiid = ls_key-value.
* retrieve Invoice details
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_wiid
IMPORTING
output = num.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER' destination lv_destination
EXPORTING
WORKITEM_ID = num
BUFFERED_ACCESS = 'X'
IMPORTING
RETURN_CODE = lv_returncode
TABLES
SIMPLE_CONTAINER = lt_simple_container
SUBCONTAINER_BOR_OBJECTS = lt_subcontainer_bor_objects
SUBCONTAINER_ALL_OBJECTS = lt_subcontainer_all_objects.
if lv_returncode = 0.
"TEST
READ TABLE lt_subcontainer_bor_objects with table key element = lc_element
into wa_subcontainer_bor_objects.
" call rfc for data
CALL FUNCTION 'ZRFC' destination lv_destination
EXPORTING
AUSBK = wa_subcontainer_bor_objects-value+20(4)
BELNR = wa_subcontainer_bor_objects-value+24(10)
GJAHR = wa_subcontainer_bor_objects-value+34(4)
IMPORTING
BLDAT = wa_BLDAT
XBLNR = wa_XBLNR
VENDOR = wa_vendor
WRBTR = wa_wrbtr
TABLES
LT_ITEM = lt_inv_item.
ENDIF.
* map details
READ TABLE lt_inv_item INTO wa_inv_item WITH KEY BZKEY = ls_key_item-value.
ls_item-instance_id = lv_wiid.
ls_item-invline_item = wa_inv_item-BZKEY.
ls_item-COST_CENTER = wa_inv_item-KOSTL.
ls_item-COMPANY_CODE = wa_inv_item-AUSBK.
ls_item-FISCAL_YEAR = wa_inv_item-GJAHR.
ls_item-GLACC_TEXT = wa_inv_item-TXT20.
ls_item-FISCAL_YEAR = wa_inv_item-GJAHR.
ls_item-GL_ACC_NO = wa_inv_item-SAKNR.
ls_item-INV_DOC_NO = wa_inv_item-BELNR.
ls_item-INVOICE_AMT = wa_inv_item-WRBTR.
CALL METHOD copy_data_to_ref
EXPORTING
is_data = ls_item
CHANGING
cr_data = er_entity.
You might have to handle exceptions in this code and this is just an example.
thanks
Ashish