on 2017 Apr 18 11:32 AM
Hello all,
I have 5 properties in entity type....
For e.g.
1. Client ID 2. Support Group 3.Region 4.State 5.City
Out of these 5 properties,I want only 4 properties i.e. Support Group,Region,State and City in the output.
In my RFC FM the Client ID is import parameter while others are export parameters.
When i generate the service, the ET_ENTITYSET internal table is having the structure similar to the entity type.
When i exceute the service ,I have to pass the ClientID as the input option.
.........?$filter=ClntId eq 'ETA'
But this should not come into the output....
Kindly help me in providing solution how can i acheive the service output without the Client ID in the output.
Code snippets would be of great help!!
Thanks,
Akil Syed
Hi,
You can disable the property in the DEFINE method of the MPC_EXT Class.
Refer Below Code :
METHOD define.
TRY.
super->define( ).
**Get the Object instance of the Entity Type
DATA(lo_entity_type) = model->get_entity_type( '<EntityType>' ).
IF lo_entity_type IS BOUND.
**Get the Object instance of the Property of Entity Type
DATA(lo_entity_prop) = lo_entity_type->get_property( '<PropertyName>' ).
IF lo_entity_prop IS BOUND.
**Set the Property as Disabled
lo_entity_prop->set_disabled( iv_disabled = abap_true ).
ENDIF.
ENDIF.
CATCH /iwbep/cx_mgw_med_exception.
ENDTRY.
ENDMETHOD.
Replace the <EntityType> and <PropertyName>, with the actual values as per your service.
Hope this works for you.
Regards,
Bharat Bajaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use 2 entities(1 with Client ID and the other with the rest 4 field) and use association to link the two entities.
Use Expand entity set to pull the data.
https://blogs.sap.com/2014/07/18/implementing-expand-entityentity-set/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.