cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Conversion Exits in Gateway

Former Member
0 Kudos

Hi Guys,

is it possible to disable the conversion exits of the properties of an entity?

Thanks a lot.

Nils

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor

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

Former Member
0 Kudos

Hi Krishna,

thanks for the solution.

So you say there isn't any "switch" to turn it off in the Gateway Service Builder and it has to be done in the manual way that you described?

Regards

Nils

kammaje_cis
Active Contributor
0 Kudos

Yes, currently thats right. It is only by manual coding.

But in future, you might get a checkbox at entity/property level to do that.

brian_zhu
Explorer
0 Kudos

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

kammaje_cis
Active Contributor
0 Kudos

Did you clear the metadata cache?

brian_zhu
Explorer
0 Kudos

I deactivated the metadata cache and model cache in the development system.

I tried to compare this snippet with that in ZGWSAMPLE, but still no luck

brian_zhu
Explorer
0 Kudos


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.

joramsomers
Explorer
0 Kudos

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

brian_zhu
Explorer
0 Kudos

thanks a lot Joram.

I will give it a try later.

Answers (0)