Skip to Content
Author's profile photo May Thitsa Oo

Adding SDK created extension field in Excel Upload Template (SalesOrder)

Hi,

I would like to share how to add extension fields in standard Excel Upload template.

Step1 : Create SalesOrder xbo.

Step2 : Create Process Extension Scenario of SalesOrder BO.

I’ll create one ext field in Root and one in Item node, so, two PES is also needed to create for Root and Item node.

Check Inbound service (ManageSalesOrderIn) with MaintainBundle operation.

PES_SalesOrder_Root.xs for Root node.

/wp-content/uploads/2015/12/1_841981.png

PES_SalesOrder_Items.xs for Item node.

/wp-content/uploads/2015/12/2_842000.png

Active and CheckIn PES.

/wp-content/uploads/2015/12/3_842001.png

Step 3 : Add PES name in front of the extension field. Save and Activate xbo.

/wp-content/uploads/2015/12/4_842002.png

Step 4 : Download Excel Template from browser.

/wp-content/uploads/2015/12/excelso_842006.png

Step 5 : Also download SalesOrder wsdl (MaintainBundle operation).

/wp-content/uploads/2015/12/wsdlpic_842007.png

Step 6 :  Manually change download excel file extension as zip and click OK.

/wp-content/uploads/2015/12/zp_842008.png

Step 7 : Unzip the file and open to see the contents. Then open xmlMaps.xml with text editor (I’m using Notepad++).

/wp-content/uploads/2015/12/xl_842012.png

Step 8 : Add the root level extension field.

In this case, the datatype of this ext field is declared as SalesTypeCode (custom code list datatype) in xbo.

So, type should be the same as xbo.

/wp-content/uploads/2015/12/rt_842013.png

But, this datatype “SalesTypeCode” is custom type so we need to add that also in xml. You can see other standard datatypes are contained about the middle of xml. Just copy some type and edit.

/wp-content/uploads/2015/12/stt_842014.png

Step 8.1 : Add item level extension field.

You should add this under “Item” contents. Data type is declared as Text types in xbo, so it can be declared as string.

/wp-content/uploads/2015/12/it_842018.png

This is used standard type so no need to declare datatype.

Step 9 : Search this codes in your xml.

match=”*[contains(local-name(),’__’)]

And add the following codes before that.

<xsl:template match=”salesTypeTest”>

  <xsl:element namespace=”http://refsystems.sap.com/YGPXKE9HY_” name=”salesTypeTest”>

  <xsl:value-of select=”.”/>

  </xsl:element>

</xsl:template>

<xsl:template match=”itemTest”>

  <xsl:element namespace=”http://refsystems.sap.com/YGPXKE9HY_” name=”itemTest”>

  <xsl:value-of select=”.”/>

  </xsl:element>

</xsl:template>

You can find the namespace in wsdl file.

Open wsdl file with text editor and search your ext field name and copy namespace.

/wp-content/uploads/2015/12/namspc_842056.png

Save the xml.

Step 10 : Select these files and create zip.(I used 7zip)

/wp-content/uploads/2015/12/zpp_842261.png

Step 11 : Chane the zip file extension as xlsx.

/wp-content/uploads/2015/12/xlsxcg_842262.png

Open excel file and now you can see your extension fields in excel template xml.

/wp-content/uploads/2015/12/rtxl_842268.png

/wp-content/uploads/2015/12/itemxls_842269.png

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Belinda Lloyd
      Belinda Lloyd

      Thank you, very helpful!

       

      Author's profile photo Yogaraj Gunasekaran
      Yogaraj Gunasekaran

      HI May Thitsa Oo,

      Very nice document and you described it in detail.

      Please help me with the functionality below.

      I have created two new extension fields at the item level in Sales Order. The two new extension field data type is Amount and Date. So, how do to add those two fields to the SO Standard Excel?

      Thanks in advance,

      Regards,
      Yogaraj

      Author's profile photo May Thitsa Oo
      May Thitsa Oo
      Blog Post Author

      Hello Yogaraj,

       

      Adding item extension field also explained in the blog. Could you please describe what exactly part you don't get? (eg: DataType in xml)

       

      Regards,

      May

      Author's profile photo Yogaraj Gunasekaran
      Yogaraj Gunasekaran

      Hi May Thitsa Oo

      Hope you are doing well and thank you very much for your response.

      I have tested all the functionality as you mentioned in the above document which works well (If that field is text (string)).

      I would like to add 2 new extension fields in the SAP standard SO excel upload tool. So, I have created two new extension fields in the system and those fields are extended to SO webservice. The field data type is Date and Amount.

      My two new extension fields Data type is the date and amount. I changed my data type in XML. But I am getting an error message in excel. So, here my request is: How to add Amount and Date field datatype extension field in a standard template.

      Thanks in advance,

      Regards,

      Yogaraj

      Author's profile photo May Thitsa Oo
      May Thitsa Oo
      Blog Post Author

      Hello Yogaraj,

      So, DataType declaration missing is the error cause in your case.

      If the fields are Date and Amount, in Step 8, try as below in Item nodes.

      <xs:element minOccurs="0" maxOccurs="1" name="yourdatefield" type="tns:Date"/>
      <xs:element minOccurs="0" maxOccurs="1" name="youramountfield" type="tns:AmountType"/>

      And, for the datatype declaration, Date is already available in the existing xml, you just need to declare the AmountType  as below.

      <xs:simpleType name="Amount.Content">
      	<xs:restriction base="xs:decimal">
      		<xs:totalDigits value="28"/>
      		<xs:fractionDigits value="6"/>
      		<xs:maxInclusive value="9999999999999999999999.999999"/>
      		<xs:minInclusive value="-9999999999999999999999.999999"/>
      	</xs:restriction>
      </xs:simpleType>
      <xs:complexType name="AmountType">
      	<xs:simpleContent>
      		<xs:extension base="tns:Amount.Content">
      			<xs:attribute name="currencyCode" type="tns:CurrencyCode"/>
      		</xs:extension>
      	</xs:simpleContent>
      </xs:complexType>
      

       

      Hope this helps.

      Regards,

      May

      Author's profile photo Yogaraj Gunasekaran
      Yogaraj Gunasekaran

      Hi May,

      Thank you very much for the detailed information on this.

      Here, I have created an extension field (Field Name: TestAmount) in the Sales Order screen at the item level via Adaptation mode. After that, I have followed the above steps in the XML file. As per your above instruction.

      First, I have declared the extension field value in XML. And converted from zip format to xlsx format the field is available in xlsx then I have mapped it in excel. but the value is not updated/added in the Sales Order screen.

      Below I have given step by step which I tried in the Standard excel template to get the extension field value in ByD.

      Image 1:

      declaration

      Image 2:

      2

      Image 3: I have mapped the field successfully without any error on the excel file.

      3

      Image 4: I have tested the file with some sample data. I am getting a successful message in an excel file.

      4

      Image 5: The given amount value is not added in the Sales Order Item.

      5

      Kindly help me with this issue to resolve.

      Thanks in advance!

      BR,

      Yogaraj G