on 2022 Nov 22 7:30 PM
Hello All,
I am using a GEN2 graph to extract data from a CDS view on on-prem S/4HANA. I am using a Python3 operator to add a new custom header into the existing headers, which is basically the current year. However, it keeps erroring out with the following error:
"Record constructor does not supports <class 'str'>"
This error is raised when api.outputs.output.publish method is called in the script that I attached at the bottom of this post.
How can I add a custom header via Python?
Below is the script that I am using in the script:
import datetime
global now
now = datetime.datetime.now()
def on_input(msg_id, header, data):
new_header = header.copy()
new_header['myyear'] = str(now.year)
data_val = data.get()
api.outputs.output.publish(data_val, new_header)
api.set_port_callback("input1", on_input)
Request clarification before answering.
Please have a look at this example https://blogs.sap.com/2021/02/15/sap-data-intelligence-how-to-get-headers-of-cds-view/
Seems like it is supposed to be in JSON format
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
57 | |
10 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.