cancel
Showing results for 
Search instead for 
Did you mean: 

need to enhance entity type properties from data model

laurent_burtaire
Active Contributor
0 Kudos

Hello,



i work on "My Shopping Cart" SRM Fiori application.

I need to add a customer field among an entity type's properties. The ABAP structure type name is /SRMNXP/S_SC_HEADER: i added my CUF in its include  /SRMNXP/INCL_CUS_MINISC_HDR.

In SEGW, i created a Z project and i redefined the SAP GW OData technical service name /SRMNXP/SHOPPING_CART.

Then, i imported the properties from data source in order to add my CUF.

Finally, i generated the runtime objects (artifacts).


Nevertheless, data provider base and extension classes failed due to syntax error (The final class "/SRMNXP/CL_DATA_ACCESS_BASE" cannot have any subclasses).

What am i missing?


Moreover, after solving this point, is there any other steps to realize?


One final question: where can i look at standard entity types for a technical service (as the way displayed in SEGW after OData service redefinition?)


Thank you for you help.

Regards.

Laurent.

Accepted Solutions (1)

Accepted Solutions (1)

laurent_burtaire
Active Contributor
0 Kudos

Hi all,

below a summary of what i did:

1) i redefine OData service /SRMNXP/SHOPPING_CART following this SAP Help Redefining OData service (GW)

2) i generated the service following this SAP Help Generating Runtime Objects

3) i activated and maiintained the service following this SAP Help Creating the ABAP Classes and Registering the Service

But i still have the error message "The final class "/SRMNXP/CL_DATA_ACCESS_BASE" cannot have any subclasses." when i check my DPC end DPC_EXT classes...

In /N/IWFND/MAINT_SERVICE transaction, using the SAP Gateway Client, if i execute a request URI for metadata with my new service name, my new property (my CUF) is correclty added to the standard ones.

But if i execute a query for my entityset (collection), i have a DUMP in ST22. This DUMP is also linked to DPC_EXT class...

Does this mean i do not have to generate the DPC classes?

Or, if i have to generate thoses classes, how to do it without the syntax error?

Thank you for your help.

Regards.

Laurent.

laurent_burtaire
Active Contributor
0 Kudos

Hello,

would anybody have a clue?

Regards.

Laurent.

former_member184867
Active Contributor
0 Kudos

I think the original class /SRMNXP/CL_DATA_ACCESS_BASE has not been marked 'READY' for redefinition. I do not have this class in my landscape, so I could not check.

In SE24, look for final checkbox under 'Properties' tab.  If it is marked final ,  you can not inherit from it, and thus you can not redefine this service. 

Example Screenshot:

Sometime this may be done intentionally by the owner of the original service to stop further redefinition .

laurent_burtaire
Active Contributor
0 Kudos

Hello Atanu,

yes, you are correct: superclass /SRMNXP/CL_DATA_ACCESS_BASE is a final class

But the problem is this class is the class used as DPC in most of the service names for software component SRMNXP01 (used for SRM UI Add-On but also for "My Shopping Cart" and "Tracking Shopping Cart" Fiori Apps)...

So why SAP defined this class as "Final"?

Due to this, how can i redefine standard services?

Regards.

Laurent.

former_member184867
Active Contributor
0 Kudos

There can be situation where the owner of the service may want to stop you from further redefinition of the service. This may be due to technical limitation of the service , architectural design or something else. But this is a decision that the owner of  of the service has taken and this stops you from any further action on it.

However this is very application specific and can not be answered in generic Gateway context. 

To know the actual reason you  may either ask the question in SRM SCN community or raise a message to SAP for further clarification

laurent_burtaire
Active Contributor
0 Kudos

Hello Atanu,

thank you for your help.

I opened a thread in SRM Fiori Apps category from SRM forum.

And i will also raise an OSS message.

Regards.

Laurent.

Answers (3)

Answers (3)

laurent_burtaire
Active Contributor
0 Kudos

Hello,

thanks Ashish and Vinita,

As it seems most of the data and model previder classes for SRM UI Add-On are final ones, we cannot use SEGW transaction.

It is mandatory to use BAdI for model and data provider enhancement or redefinition.

Regards.

Laurent.

vinita_kasliwal
Active Contributor
0 Kudos

Hey Laurent

Maybe the thread is already closed but still if you would want to consider an alternative option which I find much easier compared to extending the services is using the BADI's and passing data to it .

  • /SRMNXP/BD_ENHANCE_MODEL

    You can use this BAdI to enhance the gateway service model and add fields to the UI.

Let me know if this helps ?

Regards

Vinita

laurent_burtaire
Active Contributor
0 Kudos

Hello,

you will find below a screen-shot of SEGW transaction with my specific project:

Why i do not have the service and the model among the artifacts?

I deleted/regenerated project: i still have errors on DPC...

Thank you for your help.

Regards.

Laurent.

laurent_burtaire
Active Contributor
0 Kudos

Hello,

nobody has a suggestion?

Thank you.

Regards.

Laurent.

Ashg1402
Contributor
0 Kudos

Hi,

Did u double click on any of the error.? It will take you to the error place.

Check the entity type in mpc class.

laurent_burtaire
Active Contributor
0 Kudos

Hello Ashish,

sorry for the delay...

I double click onto error message, but i do not jump to the class as in transaction /IWDND/ERROR_LOG with the button "Active source".

So i go directly to the class ZCL_ZUIX_TEMPORARY_SC_DPC in SE24 transaction.

Doing a check, i have error "The final class /SRMNXP/CL_DATA_ACCES_BASE" cannot have any subclasses".

I have the same error with ZCL_ZUIX_TEMPORARY_SC_DPC_EXT class.

Why do i have this error? Artifacts are generated automatically...

Regards.

Laurent.

Ashg1402
Contributor
0 Kudos

Hi,

Can you try to open the class in se80, there you will be able to seethe proper sub and super classes.

You are right, artifacts are generated automatically.

Again do the double click on that error, see where it goes.

Open this class - /SRMNXP/CL_DATA_ACCES_BASE  in SE80.

laurent_burtaire
Active Contributor
0 Kudos

Hello,

here are the superclass and subclass for class ZCL_ZUIX_TEMPORARY_SC_DPC

But this is not the problem. Why after the artifacts generation, i have this error message regarding the superclass /SRMNXP/CL_DATA_ACCESS_BASE that cannnot be inherited?

Regards.

Laurent.

Ashg1402
Contributor
0 Kudos

Hi,

The artifacts are not generated as the DPC class is blank. The problem which are getting is valid as that /SRMNXP/CL_DATA_ACCESS_BASE is a final class, its just following OOP rule.

Why didn't you use the badi /SRMNXP/BD_ENHANCE_MODEL.

I am sorry but I am really confused, as why it is calling a final class.

Can you tell one thing, what did you do in service implementation for this entity, did u do a mapping.?

I can't even check this class and the modelling work as I am not having this application .

Why don't you do a cross check from the original application (If you can).

That might help.

Regards

Ashish

laurent_burtaire
Active Contributor
0 Kudos

Hello,

the only things i did in SEGW is described in my previous messages.

The service name concerned (SHOPPING_CART) was previously maintained and activated in /IWFND/MAINT_SERVICE.

You tell me to implement /SRMNXP/BD_ENHANCE_MODEL BAdI: so, SEGW transaction has no use?

Do you have any link to clear documentation which explains how to enhance entity type properties?

Thank you.

Regards.

Laurent.