cancel
Showing results for 
Search instead for 
Did you mean: 

Problems after editing DPC_EXT and MPC_EXT

Former Member
0 Kudos

i have project in SEGW. Most of funcionalities was supported by generator.

And after I redefine DPC_EXT and MPC_EXT i fanced troubles.

No metadata and funcionalities for previous work (with generator). After this i deleted DPC_EXT and MPC_EXT classes. it wasnt good idea also.

Is there is posibility to generete DPC_EXT and MPC_EXT one motre time ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lukasz,

Go to SE24 or SE80 and delete all four of the MPC and DPC classes. You can only get the EXT classes back by deleting the bases. SEGW looks for DPC and MPC bases when re-generating; if they exist, _EXT must exist so they do not generate _EXT. Therefore, removing the bases will prompt the whole regeneration of all four.

I have an idea of why your DEFINE did not work. In the redefined method, did you call super->define before adding your own logic? If you omitted this, you would have "lost" all the metadata because the logic to generate it at runtime was not called.

e.g.

method define.

   super->define( ).

** your code here...

endmethod.


Regards


Ron

Former Member
0 Kudos

Thanks, i've mastered the situation.

How to proceed when i want to add coding in DPC_EXT for example for GET_ENTITYSET?  Redefine  GET_ENTITYSET ?

I suppose i have to create entity in segw for example EXMPL_ENTITY and then after regeneration in DPC_EXT there will be method EXMPL_ENTITY_GET_ENTITYSET. Am i right ?

former_member202682
Participant
0 Kudos

Hello Ron,

I deleted my MPC and DPC and EXT classes through SE24 and now when I am trying to regenerate them creating the same name project(deleted the old project); I am  facing an issue stating the MPC class exists use another name(it suggested _01 class in the pop up window of generation which I changed back to just MPC and DPC) .

When I try to find the MPC class in system it says does not exists but the service generator is somehow able to see it in the system. Please advise

Thanks,

AShwini

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Lukasz,

Even if u regenerate ur runtime objects, ur MPC_EXT and DPX_EXT classes will never change.

U will still have the old code which u had written.

U need to manually add code again which u have deleted.

This is the only way i see now.

Also check in the version management if u can do anything there and get back the old version of ur MPC_EXT & DPC_EXT class code.

Regards,

Ashwin

Former Member
0 Kudos

But why after i added redefinition of DEFINE in MPC_EXT all previous model data wasnt available at $metadata ?  How to add manually model data to let them exist with generated model data ?

AshwinDutt
Active Contributor
0 Kudos

Hello Lukasz,

Since u have deleted the classes it self, u can get ur MPC_EXT class created again by regenerating the objects for that particular project ( note - u need to add ur custom code again )

But i doubt ur DPC_EXT class gets created again. Even if u try to search with that class name u might get Development Object Not Found error.

Now coming to adding the code in MPC_EXT class of define method, Its correct that ur Define method will be empty and u need to add code manually there.

Please refer this :

Implementation Class: Model Provider Class - SAP NetWeaver Gateway - SAP Library

Extending an OData Service Using Service Builder - SAP NetWeaver Gateway - SAP Library

U need to make a call to ur super class i.e., ur MPC class and then add ur code what ever u would like to add.

Regards,

Ashwin