Skip to Content
Jan 05, 2019 at 03:29 PM

B1if: Produce flat file in outbound


Hi folks.

This is my first scenario in B1if v.1 where I have to append in a text flat file the items created in B1.

No problem to configure B1 Events and receive data from B1 after each Items creation and I'm able to create the outbound text flat file too. The problem is that the file is empty.

In my payload by event I see the Items object and I have the Control Format for XML to FlatFile too but seems not enough.

What I have omitted in my scenario configuration?

If can help, this is the debug session overview with the payloads in inbound to the final and End blocks

Here you have the xslt script in final

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:b1e="" xmlns:b1ie="" xmlns:b1im="" xmlns:bfa="" xmlns:jdbc="" xmlns:js="" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="" xmlns:uplt="" xmlns:utils2="" xmlns:vpf="" xmlns:xci="" xmlns:xsl="" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force="" b1im:force="" uplt:force="" js:force="">
	<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
	<xsl:param name="atom"/>
	<xsl:param name="sessionid"/>
	<xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']"/>
	<xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"/>
	<xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"/>
	<xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover='P']/@Id"/>
	<xsl:template match="/">
		<xsl:variable name="vptsDoc" select="document('/')"/>
		<xsl:variable name="vpts" select="concat($vptsDoc/*/@year,'/',$vptsDoc/*/@month,'/',$vptsDoc/*/@date,' ',$vptsDoc/*/@hour,':',$vptsDoc/*/@minute,':',$vptsDoc/*/@second)"/>
			<xsl:copy-of select="/vpf:Msg/@*"/>
			<xsl:copy-of select="/vpf:Msg/vpf:Header"/>
				<xsl:copy-of select="/vpf:Msg/vpf:Body/*"/>
				<vpf:Payload Role="R" id="{$atom}" ts="{$vpts}">
					<xsl:call-template name="transform"/>
	<xsl:template name="transform">
		<Fileout type="file">
			<xsl:for-each select="$msg/BOM/BO/OITM/*">
						<xsl:value-of select="ItemCode"/>
						<xsl:value-of select="ItemName"/>
						<xsl:value-of select="ItemType"/>

and, at last, the conversion XML to Text xslt script

<?xml version="1.0" encoding="UTF-8"?>
    <segment id="Items">
        <field id="ItemCode" from="0" len="50" default="" justify="L" fillchar=""></field>
        <field id="ItemName" from="50" len="100" default="" justify="L" fillchar=""></field>
        <field id="ItemType" from="100" len="10" default="" justify="L" fillchar=""></field>

Thanks a lot for your support.



overview.jpg (407.7 kB)