добавить заказ клиента, не возвращая номер документа из sap - PullRequest
0 голосов
/ 05 марта 2019

Я новичок в интегрированной среде sap. Я создаю сценарий для размещения заказа клиента. Мне нужен номер документа в качестве ответа в последнем атоме. Пожалуйста, проверьте мой последний атом xsl здесь.

<?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=&apos;S&apos;]"></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=&apos;P&apos;]/@Id"></xsl:variable>
    <xsl:template match="/">
        <xsl:variable name="vptsDoc" select="document(&apos;/com.sap.b1i.internal/xml/timestamp&apos;)"></xsl:variable>
        <xsl:variable name="vpts" select="concat($vptsDoc/*/@year,&apos;/&apos;,$vptsDoc/*/@month,&apos;/&apos;,$vptsDoc/*/@date,&apos; &apos;,$vptsDoc/*/@hour,&apos;:&apos;,$vptsDoc/*/@minute,&apos;:&apos;,$vptsDoc/*/@second)"></xsl:variable>
        <vpf:Msg>
            <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
            <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
            <vpf:Body>
                <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
                <vpf:Payload Role="R" id="{$atom}" ts="{$vpts}">
                    <xsl:call-template name="transform"></xsl:call-template>
                </vpf:Payload>
            </vpf:Body>
        </vpf:Msg>
    </xsl:template>
    <xsl:template name="transform">
        <xsl:attribute name="pltype">json</xsl:attribute>
        <xsl:variable name="SectionC" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos;]"></xsl:variable>
        <io xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="json" xsi:schemaLocation="urn:com.sap.b1i.bizprocessor:bizatoms json_pltype.xsd">
            <object>
                <!--optional multiple of the following elements-->
                <string name="Message">
                    <xsl:value-of select="$SectionC/@DImsg"></xsl:value-of>
                </string>
                <string name="Result">
                    <xsl:value-of select="$SectionC/@DIresult"></xsl:value-of>
                </string>
                <string name="Document number">
                    <xsl:value-of select="$SectionC/DocObjectCode"></xsl:value-of>
                </string>
            </object>
        </io>
    </xsl:template>
</xsl:stylesheet>
...