<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Data from Python into Structured Operator in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584289#M4719217</link>
    <description>&lt;P&gt;Rudi - &lt;/P&gt;&lt;P&gt;Can you try to add the scalar type in the lower right panel of your graph then add it to the table definition?&lt;/P&gt;&lt;P&gt;See screenshot, it is located below the configuration panel on your source graph.   &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2056860-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Once you define the scalar, you should be able to select it in your dropdown for Scalar Type ID in your version (I assume it is an on-premise version of DI)&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 13:09:21 GMT</pubDate>
    <dc:creator>jimgiffin</dc:creator>
    <dc:date>2022-06-15T13:09:21Z</dc:date>
    <item>
      <title>Data from Python into Structured Operator</title>
      <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaq-p/12584286</link>
      <description>&lt;P&gt;Greetings Everyone,&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;Apologies for the lengthy details.&lt;/P&gt;
  &lt;P&gt;______________________________________________________________________&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Sample Pipeline&lt;/STRONG&gt;&lt;BR /&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057859-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Custom table created, to be able to map the fields in the structured operators.&lt;BR /&gt; &lt;EM&gt;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&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057861-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Data Transform&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057862-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;SAP Application Producer&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057863-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Python Script&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;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)&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Python Output Port&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057864-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;aDSO on BW4HANA&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057865-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Error Message when executing&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057866-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;STEPS THAT are WORKING with only INT values&lt;/STRONG&gt;&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;Changed the PART_NUMBER on the custom table “com.tbw.battery_part” to type INT32.&lt;/LI&gt;
   &lt;LI&gt;Updated the Data Transform to reflect the change from STRING to INT32&lt;/LI&gt;
   &lt;LI&gt;Updated the aDSO for PART_NUMBER to also an INT4.&lt;/LI&gt;
   &lt;LI&gt;Remapped the SAP Application Producer and ensure the fields mapped are all now of type INT.&lt;/LI&gt;
   &lt;LI&gt;Ran the pipeline and the entries was stored correctly in the adso.&lt;/LI&gt;
   &lt;LI&gt;Both the Part Number Length and Part Number columns are of type INT4 on the adso and all working 100%.&lt;/LI&gt;
  &lt;/UL&gt;
  &lt;P&gt;Data written into adso&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057868-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Have anyone came across this, or have suggestions to try?&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 09:20:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaq-p/12584286</guid>
      <dc:creator>beavis</dc:creator>
      <dc:date>2022-06-14T09:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data from Python into Structured Operator</title>
      <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584287#M4719215</link>
      <description>&lt;P&gt;Have you tried creating a scalar with length for your table in the graph data types? In the view port, data types areas do not choose "select", choose "create" and give it the length desired.    See screenshot below.  &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2056837-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 23:55:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584287#M4719215</guid>
      <dc:creator>jimgiffin</dc:creator>
      <dc:date>2022-06-14T23:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Data from Python into Structured Operator</title>
      <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584288#M4719216</link>
      <description>&lt;P&gt;Thanks for the suggestion James, I have tried to create the entry but do not see the option as in your example.&lt;BR /&gt;I do not see the the "Scalar Type: Select / Create&lt;/P&gt;&lt;P&gt;Is this version related perhaps or maybe I do not have the required access.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2057922-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 07:47:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584288#M4719216</guid>
      <dc:creator>beavis</dc:creator>
      <dc:date>2022-06-15T07:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data from Python into Structured Operator</title>
      <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584289#M4719217</link>
      <description>&lt;P&gt;Rudi - &lt;/P&gt;&lt;P&gt;Can you try to add the scalar type in the lower right panel of your graph then add it to the table definition?&lt;/P&gt;&lt;P&gt;See screenshot, it is located below the configuration panel on your source graph.   &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2056860-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Once you define the scalar, you should be able to select it in your dropdown for Scalar Type ID in your version (I assume it is an on-premise version of DI)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584289#M4719217</guid>
      <dc:creator>jimgiffin</dc:creator>
      <dc:date>2022-06-15T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Data from Python into Structured Operator</title>
      <link>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584290#M4719218</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Again thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 06:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/data-from-python-into-structured-operator/qaa-p/12584290#M4719218</guid>
      <dc:creator>beavis</dc:creator>
      <dc:date>2022-06-20T06:21:47Z</dc:date>
    </item>
  </channel>
</rss>

