¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Cómo obtener los encabezados de una vista CDS en SAP S/4HANA con ABAP CDS Reader V2 y Python Script - Guía paso a paso

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 23 Vistas
0
Cargando...
For the CDS view extraction from SAP S/4HANA we are going to use ABAP CDS Reader operator in DI. It is a standard operator to read data from a CDS view.

Problem description :


Using this operator, you will not see any headers in the file by default.

There are three versions of ABAP CDS Reader operator. The main difference here is the output data type. But independent of version you are using, the headers are still not visible in the file. This problem we are going to solve in this post.

Solution:


Among these three versions, only ABAP CDS Reader V2 has information about fields in its output. The output data type of this operator is a message. A message has a body and attributes. The body of the output delivers data, and attributes some information about fields, the last batch, etc. There is no standard solution to get headers using Generation 1 graph, we must use a python script.

The pipeline looks like:




  1. First operator is the standard ABAP CDS Reader V2 operator.

  2. Second operator is a python operator with input "input2" as a message type and output "outData" as a message type.
    ...


  3. Third operator is the standard write file operator as csv.

  4. Fourth operator is again a python operator with input "input1" as a message type and output "outData1" as a message type to read the last batch information.
    ...


  5. Last operator is the Graph Terminator which will be terminated when the last batch is true.




Referenced Blog:

SAP Data Intelligence | How to get headers of CDS view | SAP Blogs

Conclusion:

Using the above approach, data is written into a CSV file with headers and the graph will be terminated. This can be helpful for the initial load.

Hope you find the content of this blog helpful. Feel free to comment for further clarifications.

Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

Sin respuestas

No hay respuestas para mostrar No hay respuestas para mostrar Se el primero en responder

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?