Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with OData V4 and conversion exit TPLNR SADL_GW_V4_MODEL

Kotty
Explorer

Hi,

I work on a S4 HANA 2021 FSP1 System and I got the first time problems with OData V4.

I get an error trying to build an OData V4 API Service. At the lowest level of the CDS-Hiearchy I use the SAP Standard Interface View I_FunctionLocation. That Inteface View is released for the Customer (Contract C1)

I get the following error trying to get the $metadata

"@SAP__common.ExceptionCategory" : "Metadata_Error",
"details" : [
{
"code" : "SADL_GW_V4_MODEL/004",
"message" : "Do not use conversion ext TPLNR here.",
"@SAP__common.Severity" : "error",
"@SAP__common.numericSeverity" : 4
}

What is the best solution to solve that problem? Till now we use OData V4 for all over services and we do not want to change.

Of course i can do a cast to a different type which is not using that conversion exit and it works but is that really the best solution? or will SAP provide a solution for such problems?

I am looking forward to your answers 🙂

  • SAP Managed Tags:
1 ACCEPTED SOLUTION

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Steffen,

in SAP development the recommendation is to remove the use of conversion exits wherever possible.

But this is an ongoing process and we have not removed all data elements that have conversion exits so far.

The solution you described to cast to a dataelement with preserving the type is the best way to go. It is also the one that is used by SAP internal development.

cast ( char1 as demo_char_text preserving type) as char_with_text

You can also try to omit the field that causes the problem in your view if you do not need its content.

Kind regards,

Andre

ceterum censeo RAP esse utendam
  • SAP Managed Tags:
2 REPLIES 2

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Steffen,

in SAP development the recommendation is to remove the use of conversion exits wherever possible.

But this is an ongoing process and we have not removed all data elements that have conversion exits so far.

The solution you described to cast to a dataelement with preserving the type is the best way to go. It is also the one that is used by SAP internal development.

cast ( char1 as demo_char_text preserving type) as char_with_text

You can also try to omit the field that causes the problem in your view if you do not need its content.

Kind regards,

Andre

ceterum censeo RAP esse utendam
  • SAP Managed Tags:

Hi Andre,

thank you very much for your quick response. I will go ahead with the cast Solution 🙂

  • SAP Managed Tags: