You are on page 1of 3

TOday's class:

-----------------How to use SELECT-OPTIONS filter in gateway service.


STEPS:
____________________________________________
in segw, create ZSO_PROJECT1
right click DATA MODEL, import DDIC structure
Provide ENTITY TYPE NAME = User
Provide ddic structure

= ZUSERINFO

select create Default entity set


continue
chose the required fields.
chose USERID field as KEY FIELD
save
under PRoperties, chose

USERID field as "FILTERABLE"


----------________________________________________________________________
NOte : The field which is required for SELECT-OPTIONS,
make sure that field is enabled as "FILTERABLE"
===========
______________________________________________________________
save
Click on GENERATE RUNTIME OBJECTS :
save
open DATA PROVIDER EXTENSION CLASS:
click on change,
chose __GET_ENTITYSET method
click on "REDEFINE"
Implement the below CODE:
---------------------------data lt_filter TYPE /IWBEP/T_MGW_SELECT_OPTION.
data ls_filter TYPE /IWBEP/S_MGW_SELECT_OPTION.
data
itab
TYPE ZCL_ZSO_PROJECT_MPC=>TT_USER.
lt_filter
NS( ).

= IO_TECH_REQUEST_CONTEXT->GET_FILTER( )->GET_FILTER_SELECT_OPTIO

READ TABLE lt_filter into ls_filter with TABLE KEY PROPERTY = 'USERID'.
select * from ZUSERINFO into
corresponding fields of TABLE itab
WHERE USERID IN ls_filter-SELECT_OPTIONS.
ET_ENTITYSET = itab .
_____________________________________________________________
NoTE :
ethod

it_filter_select_options is the standard parameter of GET_ENTITYSET m


if it is not working.
THen Use IO_TECH_REQUEST_CONTEXT->GET_FILTER( )->GET_FILTER_SELECT_OP

TIONS( ).
________________________________________________________________________________
__________
Click on Service maintainence ,
Register service
Maintain service
click on GATEWAY client.
_____________________________
TESTING :
Provide
/sap/opu/odata/sap/ZSO_PROJECT_SRV/UserSet?$filter=Userid ge '8001' and Userid l
e '8003'
------/sap/opu/odata/sap/ZSO_PROJECT_SRV/UserSet?$filter=Userid ge '1001' and Userid l
e '1004'
--------

________________________________________________________________________________
___________
NOte :
HUB SySTEM

= SAP Netweaver GATEWAY server 7.4

Backend system = SAP ECC server

6.0 with ( EHP7 )

===============================================================
NOte :

When there is inconsisency under properties or results,


Then it is recommended to "CLEAN UP THE CACHE" from
1) HUB system
2) BACKEND SYSTEM

3) both SYSTEMs
STEPS : open Gateway client,
chose METADATA from menu bar,
and chose "CLEAN UP CACHE" option
and select on HUB SYSTEM/ on BACKEND SYSTEM/ or on BOTH SYSTEMS
_______________________________________________________________
NOTE : Tcode to clean UP the MODELs
/IWFND/CACHE_CLEANUP
________________________________________________________________
NOTE :

Under MODEL PROVIDER CLASS.


Inside DEFINE_<ENTITYTYPE> method
All the properties are generated automatically by the service when we c
reate ENTITYTYPE
according DDIC structure or RFC or BAPI.
___________________________________________________________________

You might also like