cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion Exits ABAP RESTful

patrick_weber11
Participant
0 Kudos

Hello,

we're using S/4 HANA 2020 on premise and we recently started to develop our first solutions with ABAP RAP.
So I defined a cds root view based on VDM for manufacturing. During activation of service binding, I get error that conversion exit NUMCV can't be used.

This gets caused by PP Order Number and PP Operation. I've seen similar questions about this from year 2020 and I wonder, if it is still true that we can't use SAP default domains with RAP, if they contain conversion exits?

What's the solution here? Do we really need to cast them into different domains to get rid of this? Doing so is a boring task an even more, we loose translated header texts etc., which is really odd.

This doesn't work

@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Arbeitsplatzvorratsliste'
@Search.searchable: true 
@Metadata.allowExtensions: true

define root view entity ZC_PP_PRODUCTIONORDERPOOL as select from I_ManufacturingOrder
 {     
   key  ManufacturingOrder,
   ProductionPlant,
   Product,
   ProductionUnit,
   MfgOrderPlannedTotalQty,
   ActualDeliveredQuantity,
   _MfgOrderOperation.ManufacturingOrderOperation,
   _MfgOrderOperation._WorkCenter.WorkCenter
}
whereas this do work with some drawbacks
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Arbeitsplatzvorratsliste'
@Search.searchable: true 
@Metadata.allowExtensions: true

define root view entity ZC_PP_PRODUCTIONORDERPOOL as select from I_ManufacturingOrder
 {  
   @Search.defaultSearchElement: true 
   key  cast ( ManufacturingOrder as aufnr ) as ManufacturingOrder  ,
   ProductionPlant,
   Product,
   ProductionUnit,
   MfgOrderPlannedTotalQty,
   ActualDeliveredQuantity,
   cast ( _MfgOrderOperation.ManufacturingOrderOperation as char4) as Operation,
   _MfgOrderOperation._WorkCenter.WorkCenter 
}

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert

Hi Patrick,

unfortunately I have to tell you that the way you described is the one you have to go.

You would have to create a new domain and a new domain (best by copying the underlying domain of the dataelement and remove the conversion exit from the copied domain) and then create a new dataelement that uses this newly created domain.

This way you would get texts which you don't get if you use the build in type char4.

With regards to the cast statement I would recommend to use the following syntax:

cast(_MfgOrderOperation.ManufacturingOrderOperation as zafmanufacturingorderoperation preserving type)
as Operation ,

In the code you shared I think that it is not necessary to cast the key field ManufacturingOrder

since this field uses the released alpha conversion exit. When I built the same sample it was sufficient for me to only use the above mentioned cast statement.

SAP internal development works the same way. There might however be suitable domains available without a conversion exit since there are have already been use cases in the past where no conversion exit was wanted.

I am wondering if it would make sense to build a small tool that would create appropriate domains and data elements for a given CDS view so that the tedious (and boring) work to copy domains and dataelemnts and thereby removing the conversion exits is somehow done automatically.

Sorry that I have no better news to share.

Kind regards,

Andre

Answers (1)

Answers (1)

Renzo
Advisor
Advisor