it looks like a function import
use case to me .
First of all, you have to define a ABAP structure for the returning data like below
@EndUserText.label : 'ENQUEUEGETSTAT'
@AbapCatalog.enhancementCategory : #NOT_EXTENSIBLE
define structure zza_enqueuegetstat {
entries_total : abap.int4;
entries_peak : abap.int4;
entries_actual : abap.int4;
}
In your SEGW project, create a entity type ENQUEUEGETSTAT
mapping to this structure.
.
Afterwards, create a function import ENQUEUEGETSTAT
.

Go to your DPC_EXT class and redefine the method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~EXECUTE_ACTION
.
method /iwbep/if_mgw_appl_srv_runtime~execute_action.
data ls_enqueuegetstat type zza_enqueuegetstat.
if iv_action_name = 'ENQUEUEGETSTAT'.
call function 'ENQUEUEGETSTAT'
importing
entries_total = ls_enqueuegetstat-entries_actual
entries_peak = ls_enqueuegetstat-entries_peak
entries_actual = ls_enqueuegetstat-entries_total.
copy_data_to_ref(
exporting
is_data = ls_enqueuegetstat
changing
cr_data = er_data
).
endif.
endmethod.
Save and activate everything. Then you should able to access your function import /sap/opu/odata/sap/**YOUR_SERVICE**/ENQUEUEGETSTAT?$format=json
{
"d": {
"EntriesTotal": 382,
"EntriesPeak": 43189,
"EntriesActual": 500000
}
}
Hope it helps.