cancel
Showing results for 
Search instead for 
Did you mean: 

How to update an UDT with B1if ?

former_member219577
Participant
0 Kudos

Hi every body,

I would like to synchronize a UDT between 2 company DBs.

Thanks to a gentleman, I succeed to export the content from the UDT (using a SAP Business One component and choosing the SQL object type) by a SQL query.

But unfortunately, I don't understand how to insert data in the UDT. I have chosen as outbound

SAP Business One

SQL

But I understand which nodes I have to put into the XSL file to run the update queries.

Does anyone know how to do that?

Thank you for your help! 🐵

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Damien,

I selected the in the OutBound, Database and used the following code. Make sure your SLD is of JDBC type.

I am updating the SAP table ITM1, all you have to do is change the table name and sql select/insert/update statement.

<xsl:template name="transform">
<DBout xmlns="" type="sql">
<xsl:for-each select="$msg/row[position()&gt;0]">
<sql>UPDATE [ITM1] SET Price =  <xsl:value-of select="col[10]"/>, U_ORCFU_Date = CAST(&apos;<xsl:value-of select="col[8]"/>&apos; AS date), U_ORCFU_Time = REPLACE(&apos;<xsl:value-of select="col[9]"/>&apos;, &apos;:&apos;, &apos;&apos;) WHERE ItemCode = &apos;<xsl:value-of select="col[6]"/>&apos; AND PriceList = (SELECT ListNum FROM [OPLN] WHERE ListName = RTRIM(&apos;<xsl:value-of select="col[1]"/> &apos;) +  LTRIM(&apos; <xsl:value-of select="col[3]"/>&apos;))</sql>
</xsl:for-each>
</DBout>
</xsl:template>

Good Luck,

Mike

Edited by: Mike Hardwick on Feb 9, 2012 9:17 PM

former_member219577
Participant
0 Kudos

Thank you Mike. That's exactly what I needed!

Answers (0)