cancel
Showing results for 
Search instead for 
Did you mean: 

Extending the ABAP CDS extractor

vinaylohakare
Explorer
0 Kudos

Hello Experts,

I have a question of extending the ABAP CDS extractor.

Requirement - Extend the ABAP CDS extractor I_GoodsMovementDocumentDEX with fields from MATDOC table. 

The view I_GoodsMovementDocumentDEX is created on I_MaterialDocumentRecord which in turn is created on MATDOC. Do we first create a extension view for I_MaterialDocumentRecord and have the required fields from MATDOC. Followed by one more extension view for I_GoodsMovementDocumentDEX to add those fields , or we directly add those fields in I_GoodsMovementDocumentDEX without extension view as it is already available in underlying view.

Is it recommended to change standard CDS view I_GoodsMovementDocumentDEX ? or we have to use the 2 separate extension view as mentioned above?

Thanks,

Vinay

 

 

View Entire Topic
MKreitlein
Active Contributor

Hello @vinaylohakare,
you are right. Correct way is to extend both view via custom extend views.

If there existed already an extension, then you could have used this one... see another example:

View I_ProductPlantBasic contains: 

association [0..1] to E_Productplant as _ProductPlantExt

In this case you could directly include necessary fields into one custom extend view:

 extension.png

When you activate your extend view, it can take several minutes... depending where the view is used in the system... just be patient until activation completed 😉

BR, Martin

vinaylohakare
Explorer
0 Kudos

Hello @MKreitlein, Thanks for your reply.

So the solution will be to first extend basic view I_MaterialDocumentRecord with the required fields from MATDOC.

Next extend I_GoodsMovementDocumentDEX with the fields from I_MaterialDocumentRecord.

Do you see any issue if we just add the fields in composite layer (I_GoodsMovementDocumentDEX) directly? say in case of future upgrade or any patch upgrade.

Thanks,

Vinay

MKreitlein
Active Contributor
Hello @vinaylohakare ... yes you might get into trouble when changing the SAP Standard CDS view directly! During a release upgrade you will have manual task to keep your version and being not overwritten. I would not recommend doing that. Better go the "extend"-way 🙂