cancel
Showing results for 
Search instead for 
Did you mean: 

redefine bw query get ID without max length assigned, failed in Kapsel offline plugin

former_member183212
Participant
0 Kudos

Hi all,

   i followed this article to redefine a bw query into a gateway service for my mobile app. the service is ok, i could retrieve the data. however if i want to store the data on my mobile app for offline usage, something bad happened. i used SAP Kapsel plugin to create my Hybird mobile app, and used its offline plugin to store data. But the plugin can't be working if the key on gateway service didn't have a max length assigned(). unfortunately the service redefined from BW Query has a ID as key, however this field didn't have  a max length assigned.

   i tried modified the ID filed, failed, can't change the max length property. then deleted the ID ,and create a new ID_NEW, failed, the metadata still showed  no max length,even i have assigned the max length.

seems SAP has a conflict between these two product ,  BW Query to gateway, and Kapsel Offline Plugin. any advice will be helpful.

thanks,

Billy

the screenshot below shows the ID without max length.  0 means no max length. how can i generate a gateway service from BW Query ,meanwhile the ID has a max length assigned?

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Shen,

Add code manually to restrict the length of the field in the Define Method of your MPC_EXT class.

Sample code to be written in Define Method ->

    super->define( ).

    DATA:

      lo_entity   TYPE REF TO /iwbep/if_mgw_odata_entity_typ,

      lo_property TYPE REF TO /iwbep/if_mgw_odata_property.

    lo_entity = model->get_entity_type( iv_entity_name = '<Your_Entity_Name>' ).

    IF lo_entity IS BOUND.

      lo_property = lo_entity->get_property( iv_property_name = '<Your_Property_Name' ).

      lo_property->set_maxlength( iv_max_length = 10 ).

    ENDIF.

Activate and clear Model Cache once using t-code /iwfnd/cache_cleanup in GW System.

Regards,

Ashwin

former_member183212
Participant
0 Kudos

Hi Ashwin,

    your codes works,  thanks so much.



Regards,

Billy

former_member184867
Active Contributor
0 Kudos

great

Answers (1)

Answers (1)

former_member184867
Active Contributor
0 Kudos

On potion could be to assign max length by manual coding in DEFINE method of _MPC_EXT class.

Have you tried it already ?

former_member183212
Participant
0 Kudos

Hi Atanu,

   i tried Ashwin's code, it works. thanks.

Regards,

Billy