cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS Reader -> ABAP Converter JSON issue in DI

biswajit_biswas
Advisor
Advisor

Hello Team,

I am working for a customer who is using ABAP CDS reader to read from CDS views in S/4 HANA and send it to Azure Data Lake.

The flow is as follows:

ABAP CDS Reader ---> ABAP Converter ----> Write to Data Lake,

Header of the JSON generated is as follows:

{"COLUMNNAME":"Setclass","KEY":"X","ABAPTYPE":"CHAR","ABAPLEN":000004,"OUTPUTLEN":000004,"DECIMALS":000000}}

The due to the bold values the JSON is not being parsed.

When we are using

SLT Reader ----> ABAP Converter ------> Write to Data,

Header of the JSON is generated as follows:

{"COLUMNNAME":"Setclass","KEY":"X","ABAPTYPE":"CHAR","ABAPLEN":"000004","OUTPUTLEN":"000004","DECIMALS":"000000"}}

in this use case the JSON parses. The difference is the quotes in the number values.

Can someone help me with this issue? The customer wants to use ABAP CDS views as source.

Regards,

Biswajit

Accepted Solutions (0)

Answers (2)

Answers (2)

ujwaliyer
Advisor
Advisor
0 Kudos

Hi Biswajit- This is an expected behavior, you need to use python to cast it to the right data type before sending it downstream.

biswajit_biswas
Advisor
Advisor
0 Kudos

Hi Ujwal, I would like to differ here, why different operator would give different JSON metadata. Something coming out of the same toolset should have same output.

ujwaliyer
Advisor
Advisor
0 Kudos

True- I would expect the same. But as Lokesh previously suggested, the code that runs in the current DI version is different in the backend- hence leading to different output.

lohitinguva
Participant
0 Kudos

It looks like the ABAP CDS reader is sending the numeric values as Integrrs whereas SLT reader is sending everything as a string. You can try to use Python Opeator and convert the JSON output to string to get your desired output. Let me know if that helps.

Thanks,

Lohit

biswajit_biswas
Advisor
Advisor
0 Kudos

Yes, python is an option, but I want to understand why this kind of behavior, and if there are any out of the box solution to the JSON generation.

lohitinguva
Participant
0 Kudos

I think since SLT and CDS reader use different Function Modules in the backend, the behavior is different for both of them. As far as I know, there is no out of the box solution to JSON generation unless you want to use CDS Reader V1 and ABAP converter(JSON), which will just send the column name in the Metadata section.

Thanks,

Lohit.

biswajit_biswas
Advisor
Advisor
0 Kudos

CDS Reader V1 and ABAP converter(JSON) gives the same result. It is also strange that two different operator gives different JSON metadata. It should have been same irrespective of the operator we choose.

lohitinguva
Participant
0 Kudos

Yeah, that's strange SAP has different outputs for different operator versions. Try checking the Note 3037995, I believe that will change CDS Reader V1 operator output to something similar to V2.

Thanks,

Lohit.