on 03-26-2015 4:50 PM
Hi Guys,
is it possible to disable the conversion exits of the properties of an entity?
Thanks a lot.
Nils
Nils,
Here are the steps.
1. Redefine the define method in *MPC_EXT class. Call the parent define.
2. Get reference of the entity-> getproperties-> get reference of the property of your interest
3. Call method DISABLE_CONVERSION of the property
You can also get reference of the model and call method SET_NO_OCNVERSION, so that conversion is disabled for entire model.
Regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Krishna,
i want to disable the conversion function in structure BAPI_EPM_BP_HEADER
for field BP_ID.
I followed the steps mentioned above like this
method DEFINE.
DATA:
lo_entity_type type ref to /iwbep/if_mgw_odata_entity_typ,
lo_property type ref to /iwbep/if_mgw_odata_property, "#EC NEEDED
lo_entity_set type ref to /iwbep/if_mgw_odata_entity_set. "#EC NEEDED
super->define( ).
lo_entity_type = model->GET_ENTITY_TYPE( IV_ENTITY_NAME = 'BusinessPartner' ).
lo_property = lo_entity_type->GET_PROPERTY( IV_PROPERTY_NAME = 'BusinessPartnerID' ).
lo_property->DISABLE_CONVERSION( ).
* Deactivate Conversion Exits for the entire Model.
model->set_no_conversion( iv_no_conversion = abap_true ).
endmethod.
but no luck for me, the conversion is still valid in the result.
Could you possibly light on this issue?
thanks a lot.
regards,
Yueqiang
I comment out the conversion function directly in the MPC class.
lo_property->set_conversion_exit( 'ALPHA' ). "#EC NOTEXT
then comment out the bind structure as follows.
*lo_entity_type->bind_structure( iv_structure_name = 'BAPI_EPM_BP_HEADER'
* iv_bind_conversions = 'X' ). "#EC NOTEXT
lo_entity_type->bind_structure( iv_structure_name = 'BAPI_EPM_BP_HEADER'
). "#EC NOTEXT
after these two steps , my program worked. so I doubt that my command
model->set_no_conversion( abap_true ).
does not work in my case, but it does work for the ZGWSAMPLE project.
Hello Yueqiang,
I ran into the same issue before, implementing the define method to overrule a conversion exit for a field of the service, and seeing no change in the result.
It seemed you actually have to "Generate runtime objects" again in SEGW after changing the method. Otherwise it is not taken into account.
During the generating, the define method is also actually called (seen in debugging). While it doesn'tn get called during execution of the service itself.
Kr,
Joram
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.