cancel
Showing results for 
Search instead for 
Did you mean: 

Create UDT and Fields through b1if

naraayanan
Explorer
0 Kudos

Dear All,

I need to Create UDT and Fields through B1if from One B1 to another B1 .Please how to do this?

Accepted Solutions (1)

Accepted Solutions (1)

naraayanan
Explorer
0 Kudos

Dear All,

I have created UDT through B1if from One B1 to another B1 using Object . Here the Solution .

  • Inbound Identifier : 153
  • Inbound Process Trigger: B1Event
  • Outbound Identifier :153
  • Outbound Format : DI Object
  • Outbound Key Name : TableName

Call below Code in the FinalAtom0

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:js="com.sap.b1i.bpc_tools.Javascript" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:uplt="urn:com.sap.b1i.xcellerator:upltdoc" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:output>
    <xsl:param name="atom"></xsl:param>
    <xsl:param name="sessionid"></xsl:param>
    <xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']"></xsl:variable>
    <xsl:variable name="vptsDoc" select="document('/com.sap.b1i.internal/xml/timestamp')"></xsl:variable>
    <xsl:variable name="vpts" select="concat($vptsDoc/*/@year,'/',$vptsDoc/*/@month,'/',$vptsDoc/*/@date,' ',$vptsDoc/*/@hour,':',$vptsDoc/*/@minute,':',$vptsDoc/*/@second)"></xsl:variable>
    <xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"></xsl:variable>
    <xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"></xsl:variable>
    <xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover='P']/@Id"></xsl:variable>
    <xsl:template match="/">
        <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
            <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
            <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
            <Body>
                <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
                <Payload Role="R" id="{$atom}" ts="{$vpts}">
                    <xsl:call-template name="transform"></xsl:call-template>
                </Payload>
            </Body>
        </Msg>
    </xsl:template>
    <xsl:template name="transform">
        <BOM>
            <!--DB Table Name: -->
            <BO>
                <AdmInfo>
                    <!--multiple such elements are allowed-->
                    <Object>153</Object>
                    <Version>2</Version>
                </AdmInfo>
                <QueryParams>
                    <!--multiple such elements are allowed-->
                    <TableName>
                        <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/BOM/BO/*//TableName"></xsl:value-of>
                    </TableName>
                </QueryParams>
                <UserTablesMD>
                    <!--multiple such elements are allowed-->
                    <row>
                        <!--multiple such elements are allowed-->
                        <TableName>
                            <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/BOM/BO/*//TableName"></xsl:value-of>
                        </TableName>
                        <TableDescription>
                            <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/BOM/BO/*//TableDescription"></xsl:value-of>
                        </TableDescription>
                        <TableType>
                            <!-- Grab the value -->
                            <xsl:variable name="TblType" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/BOM/BO/*//TableType"></xsl:variable>
                            <xsl:choose>
                                <xsl:when test="$TblType='bott_NoObject'">
                                    <xsl:text>0</xsl:text>
                                </xsl:when>
                                <xsl:when test="$TblType='bott_NoObjectAutoIncrement'">
                                    <xsl:text>5</xsl:text>
                                </xsl:when>
                                <xsl:when test="$TblType='bott_MasterData'">
                                    <xsl:text>1</xsl:text>
                                </xsl:when>
                                <xsl:when test="$TblType='bott_MasterDataLines'">
                                    <xsl:text>2</xsl:text>
                                </xsl:when>
                                <xsl:when test="$TblType='bott_Document'">
                                    <xsl:text>3</xsl:text>
                                </xsl:when>
                                <xsl:when test="$TblType='bott_DocumentLines'">
                                    <xsl:text>4</xsl:text>
                                </xsl:when>
                            </xsl:choose>
                        </TableType>
                        <Archivable>
                            <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/BOM/BO/*//Archivable"></xsl:value-of>
                        </Archivable>
                    </row>
                </UserTablesMD>
            </BO>
        </BOM>
    </xsl:template>
</xsl:stylesheet>


Now , you assigned Sender System and Receiver System in the Package Setup ,Activate and test it . It's working fine.




Answers (0)