cancel
Showing results for 
Search instead for 
Did you mean: 

GET_ENTITYSET method code for BAPI_CUSTOMER_GETLIST with filter option

Former Member
0 Kudos

Hello Experts,

I am new to OData service creation and looking for sample code which can be used in order to implement GET_ENTITYSET function.

I am using BAPI- BAPI_CUSTOMER_GETLIST and scenario here is to filter certain set of customers from KNA1 table to display output.

Can any of you please help me with sample code to implement this method? I have below code which needs to be populated properly.

Thanks,

Megha

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

1. Create a simple RFC implementing the scenario with valid import and export parameters at ABAP Backend.

2. Create entity through import RFC in SEGW transaction.

3. Select properties of the entity and make them filterable in the structure.

4. Implement Get Entity Set using the same RFC and generate the runtime artifacts

5._GetEntitySet Method will be automatically created with filter options and respective code

AshwinDutt
Active Contributor
0 Kudos

Hello Megha,

Please follow the below for the details ( Query Operation ) ->

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,

Thanks for your reply. I am following this document already but could not find code to implement filter in OData query. I see below in the link but what exactly do I need to code in GET_ENTITYSET method? Could you help with that?

UserCollection?$filter=UserID eq '123' and LastName eq 'Mahajan'IT_FILTER_SELECT_OPTIONS and IV_FILTER_STRINGDATA: my_filter_options TYPE /iwbep/t_mgw_select_option,
my_filter_string
TYPE string.
my_filter_options
= io_tech_request_context->get_filter( )->get_filter_select_options( ).
my_filter_string 
io_tech_request_context->get_filter( )->get_filter_string( ).
Yes

Thanks,

Megha

AshwinDutt
Active Contributor
0 Kudos

Please check the section 'Implement a query with filter options'

You need to get the filters sent as part of input and use it.