cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data from Python into Structured Operator

beavis
Explorer
0 Likes
1,715

Greetings Everyone,

We try to load data from AWS (S3) into BW4HANA. We need to apply some logic in transformations and therefore require a python operator and then using the SAP Application Producer to write the entries directly into an adso on BW4HANA.

This is all working 100% when using any INT value, the moment a STRING value is used a data type mismatch error occur on the sap application producer.

Apologies for the lengthy details.

______________________________________________________________________

Sample Pipeline

Custom table created, to be able to map the fields in the structured operators.
A dynamic table option was tried, however as these tables are only “created” at runtime, the fields are not available for mapping for example in the Data Transform operator

Data Transform

SAP Application Producer

Python Script

counter=0

def gen():
    
    global counter
    tbl = []
    
    tbl = [[counter+i,str(counter+i*1000000011)] for i in range(1,11)]  
    
    table = api.Table(tbl, "com.tbw.battery_part")
    
    api.outputs.myDynamicPort.publish(table)
    
    counter += 10
    
    return 5

api.add_timer(gen)

Python Output Port

aDSO on BW4HANA

Error Message when executing

STEPS THAT are WORKING with only INT values

  • Changed the PART_NUMBER on the custom table “com.tbw.battery_part” to type INT32.
  • Updated the Data Transform to reflect the change from STRING to INT32
  • Updated the aDSO for PART_NUMBER to also an INT4.
  • Remapped the SAP Application Producer and ensure the fields mapped are all now of type INT.
  • Ran the pipeline and the entries was stored correctly in the adso.
  • Both the Part Number Length and Part Number columns are of type INT4 on the adso and all working 100%.

Data written into adso

Have anyone came across this, or have suggestions to try?

Thanks

View Entire Topic
beavis
Explorer
0 Likes

Thank you James, I tried using the global tables, which did not had the options you suggested, when creating the table in the pipeline I could get the same options as in your screenshot with type string, that has worked.

Again thank you 🙂