Example of a Catalog Interface 

The following excerpts are examples of the HTML and XML source code generated by a catalog engine after a user has finished selecting items for a shopping cart. You can extract the source code and display the data in a Web browser.

HTML version

In the HTML version, all the line items are placed as name/value pairs in an HTML form as shown below. This can be done as text or hidden fields. The parameter HOOK_URL has to be placed in the action parameter of that form, so that the HTML form can be sent to the SAP Business-to-Business Procurement system.

HTML Form (interface.asp):

<HTML>

<HEAD>

<HEAD>

<H1>SAP Open Catalog Interface: HTML - Example</H1>

</HEAD>

<P>This is an example, what needs to be generated by the catalog engine, if the user is done with picking items in his shopping basket.</P>

<P>View the source of this file to see all the text inputs.</P>

<BODY bgcolor="#DED6C2">

<FORM action="<%=Request.QueryString("HOOK_URL")%>" method=post target=_top>

<!--For more information about the interface fields, refer to the catalog interface description-->

<!--Item number 1-->

<input type="hidden" name="NEW_ITEM-DESCRIPTION[1]" value = "Pen, Easytouch, Medium, Black">

<input type="hidden" name="NEW_ITEM-MATNR[1]" value = "">

<input type="hidden" name="NEW_ITEM-MATGROUP[1]" value = "">

<input type="hidden" name="NEW_ITEM-QUANTITY[1]" value = "1">

<input type="hidden" name="NEW_ITEM-UNIT[1]" value = "EA">

<input type="hidden" name="NEW_ITEM-PRICE[1]" value = "0.50">

<input type="hidden" name="NEW_ITEM-PRICEUNIT[1]" value = "5">

<input type="hidden" name="NEW_ITEM-CURRENCY[1]" value = "USD">

<input type="hidden" name="NEW_ITEM-LEADTIME[1]" value = "1">

<input type="hidden" name="NEW_ITEM-VENDOR[1]" value = "1768">

<input type="hidden" name="NEW_ITEM-VENDORMAT[1]" value = "648570">

<input type="hidden" name="NEW_ITEM-MANUFACTCODE[1]" value = "4711">

<input type="hidden" name="NEW_ITEM-MANUFACTMAT[1]" value = "4712">

<input type="hidden" name="NEW_ITEM-CONTRACT[1]" value = "111">

<input type="hidden" name="NEW_ITEM-CONTRACT_ITEM[1]" value = "1111">

<input type="hidden" name="NEW_ITEM-SERVICE[1]" value = "">

<input type="hidden" name="NEW_ITEM-EXT_QUOTE_ID[1]" value = "111">

<input type="hidden" name="NEW_ITEM-EXT_QUOTE_ITEM[1]" value = "1111">

<input type="hidden" name="NEW_ITEM-EXT_PRODUCT_ID[1]" value = "11111">

<input type="hidden" name="NEW_ITEM-LONGTEXT_1:132[]" value = "longtext_1: The best pen in our program, lightweight and easy to handle">

<input type="hidden" name="NEW_ITEM-CUST_FIELD1[1]" value = "custf 1.1">

<input type="hidden" name="NEW_ITEM-CUST_FIELD2[1]" value = "custf 1.2">

<input type="hidden" name="NEW_ITEM-CUST_FIELD3[1]" value = "custf 1.3">

<input type="hidden" name="NEW_ITEM-CUST_FIELD4[1]" value = "custf 1.4">

<input type="hidden" name="NEW_ITEM-CUST_FIELD5[1]" value = "custf 1.5">

<!--Item number 2-->

<input type="hidden" name="NEW_ITEM-DESCRIPTION[2]" value = "Palm Pilot, the second item">

<input type="hidden" name="NEW_ITEM-MATNR[2]" value = "">

<input type="hidden" name="NEW_ITEM-MATGROUP[2]" value = "">

<input type="hidden" name="NEW_ITEM-QUANTITY[2]" value = "1">

<input type="hidden" name="NEW_ITEM-UNIT[2]" value = "EA">

<input type="hidden" name="NEW_ITEM-PRICE[2]" value = "225">

<input type="hidden" name="NEW_ITEM-PRICEUNIT[2]" value = "222">

<input type="hidden" name="NEW_ITEM-CURRENCY[2]" value = "USD">

<input type="hidden" name="NEW_ITEM-LEADTIME[2]" value = "1">

<input type="hidden" name="NEW_ITEM-VENDOR[2]" value = "">

<input type="hidden" name="NEW_ITEM-VENDORMAT[2]" value = "">

<input type="hidden" name="NEW_ITEM-MANUFACTCODE[2]" value = "">

<input type="hidden" name="NEW_ITEM-MANUFACTMAT[2]" value = "">

<input type="hidden" name="NEW_ITEM-CONTRACT[2]" value = "">

<input type="hidden" name="NEW_ITEM-CONTRACT_ITEM[2]" value = "">

<input type="hidden" name="NEW_ITEM-SERVICE[2]" value = "">

<input type="hidden" name="NEW_ITEM-EXT_QUOTE_ID[2]" value = "">

<input type="hidden" name="NEW_ITEM-EXT_QUOTE_ITEM[2]" value = "">

<input type="hidden" name="NEW_ITEM-EXT_PRODUCT_ID[2]" value = "">

<input type="hidden" name="NEW_ITEM-LONGTEXT_2:132[]" value = "longtext_2: The award-winning Palm Computing organizers, designed as companion products to personal computers, enable mobile users to manage their schedules, contacts and other critical personal and business information on their desktops and remotely. Palm Computing organizers automatically synchronize their information's with a personal computer locally or over a local or wide area network at the touch of a button. Their most distinguishing features include shirt-pocket size, instant response, an elegant graphical user interface and an innovative desktop docking cradle which facilitates two way synchronization between the PC and organizer.">

<input type="hidden" name="NEW_ITEM-CUST_FIELD1[2]" value = "custf 2.1">

<input type="hidden" name="NEW_ITEM-CUST_FIELD2[2]" value = "custf 2.2">

<input type="hidden" name="NEW_ITEM-CUST_FIELD3[2]" value = "custf 2.3">

<input type="hidden" name="NEW_ITEM-CUST_FIELD4[2]" value = "custf 2.4">

<input type="hidden" name="NEW_ITEM-CUST_FIELD5[2]" value = "custf 2.5">

<!--and so on...-->

<input type="submit" value="Transfer Items to B2B shopping basket" id=submit1 name=submit1><br>

</FORM>

&copy; 2000, SAP AG

</BODY>

</HTML>

XML version

In the XML version, the data from a shopping cart can be generated into a separate file which is then linked to the HTML form. The XML data is expected to be in the value of an input field with the name ~xmlDocument. It can be set there dynamically using the function SAP_encode_b64(Str) , as shown in the example below. In the input field ~xmlType, you have to specify the type of schema used to generate the XML data. Possible values for this field are: ESAPO (Encoded SAP Object) and ERNO (Encoded RosettaNet Object).To view the SAP XML schema refer to the file pdi_oci.xsd in SAPNet. To access this files, enter the URL http://www.sap.com/, specifying the alias CSP/scenarios/ and choose the menu options SAP B2B Procurement ® B2B-OCI.

HTML Form (interface.asp)

<HTML>

<script language="JavaScript1.2">

function SAP_encode_b64(Str) {

var encStr = "";

var base64 = [

'A','B','C','D','E','F','G','H','I','J','K','L','M',

'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',

'a','b','c','d','e','f','g','h','i','j','k','l','m',

'n','o','p','q','r','s','t','u','v','w','x','y','z',

'0','1','2','3','4','5','6','7','8','9','+','/' ];

for (var i = 0; i < Str.length; i += 3) {

encStr += base64[(Str.charCodeAt(i) >>> 2)];

if(!Str.charAt(i+1)) {encStr += '=='; break;}

encStr += base64[(((Str.charCodeAt(i) & 0x03) << 4) | Str.charCodeAt(i+1) >>> 4)];

if(!Str.charAt(i+2)) {encStr += '='; break;}

encStr += base64[(((Str.charCodeAt(i+1) & 0x0F) << 2) | Str.charCodeAt(i+2) >>> 6)];

encStr += base64[(Str.charCodeAt(i+2) & 0x3F)];

}

return encStr;

}

</script>

 

<HEAD>

<H1>SAP Open Catalog Interface: XML - Example</H1>

</HEAD>

 

<P>This is an example, what needs to be generated by the catalog engine,

if the user is done with picking items in his shopping basket.</P>

<P>View the source of the file 'example1.xml' to see all the items.</P>

 

<!-- insert the order -->

<BODY bgcolor="#DED6C2">

 

<XML ID=xmlid src="example1.xml"></XML>

 

<!-- Transfer the order to the B2B Application -->

<form action="<%=Request.QueryString("HOOK_URL")%>" method="post" name="OrderForm" onSubmit="OrderForm['~xmlDocument'].value = SAP_encode_b64(xmlid.xml)">

 

<input type="hidden" name="~xmlDocument" value="" >

<input type="hidden" name="~xml_type" value="ESAPO">

<input type="submit" value="Transfer Items to B2B shopping basket" id=submit1 name=submit1><br>

 

</form>

&copy; 2000, SAP AG

</BODY>

</HTML>

XML data (example1.xml)

<?xml version ="1.0"?>

<BusinessDocument>

<CatalogHeader>

</CatalogHeader>

<Catalog>

<CatalogID>11</CatalogID>

<Product ProductType = "Good">

<CatalogKey>11111</CatalogKey>

<ParentCategoryID>44120000</ParentCategoryID>

<Description Language = "EN">Pen, Easytouch, Medium, Black</Description>

<ShoppingBasketItem RefVendorDescription = "0" RefManufacturerDescription = "1">

<Quantity UoM = "EA">1</Quantity>

<NetPrice>

<Price Currency = "USD">0.50</Price>

<PriceUnit>5</PriceUnit>

</NetPrice>

<LeadTime>1</LeadTime>

<Quote>

<QuoteID>111</QuoteID>

<QuoteItemID>1111</QuoteItemID>

</Quote>

<ItemText Language = "EN">

The best pen in our program, lightweight and easy to handle

</ItemText>

</ShoppingBasketItem>

<ManufacturerDescription ID = "1">

<PartnerProductID Code = "Other">4712</PartnerProductID>

<PartnerID Code = "Other">4711</PartnerID>

</ManufacturerDescription>

<VendorDescription ID = "0">

<PartnerProductID Code = "Other">648570</PartnerProductID>

<PartnerID Code = "Other">1768</PartnerID>

<LeadTime>1</LeadTime>

<BuyerContract>

<ContractID>111</ContractID>

<ContractItemID>1111</ContractItemID>

</BuyerContract>

</VendorDescription>

</Product>

<Product ProductType = "Good">

<ProductID Code = "Buyer">KB-SPEZ</ProductID>

<CatalogKey>22222</CatalogKey>

<Description Language = "EN">Palm Pilot, the second item</Description>

<ShoppingBasketItem RefVendorDescription = "2" RefManufacturerDescription = "3">

<Quantity UoM = "EA">1</Quantity>

<NetPrice>

<Price Currency = "USD">225</Price>

<PriceUnit>222</PriceUnit>

</NetPrice>

<LeadTime>1</LeadTime>

<Quote>

<QuoteID>222</QuoteID>

<QuoteItemID>2222</QuoteItemID>

</Quote>

<ItemText Language = "EN">

The award-winning Palm Computing organizers, designed as companion products to personal computers, enable mobile users to manage their schedules, contacts and other critical personal and business information on their desktops and remotely. Palm Computing organizers automatically synchronize their information with a personal computer locally or over a local or wide area network at the touch of a button. Their most distinguishing features include shirt-pocket size, instant response, an elegant graphical user interface and an innovative desktop docking cradle which facilitates two-way synchronization between the PC and organizer.

</ItemText>

</ShoppingBasketItem>

<ManufacturerDescription ID = "3">

<PartnerProductID Code = "Other">222</PartnerProductID>

<PartnerID Code = "Other">2222</PartnerID>

</ManufacturerDescription>

<VendorDescription ID = "2">

<PartnerProductID Code = "Other">12345</PartnerProductID>

<PartnerID Code = "Other">1768</PartnerID>

<LeadTime>1</LeadTime>

<BuyerContract>

<ContractID>222</ContractID>

<ContractItemID>2222</ContractItemID>

</BuyerContract>

</VendorDescription>

</Product>

<Product ProductType = "Good">

<CatalogKey>33333</CatalogKey>

<Description Language = "EN">Palm Pilot, the third item</Description>

<ShoppingBasketItem RefVendorDescription = "4" RefManufacturerDescription = "5">

<Quantity UoM = "EA">77</Quantity>

<NetPrice>

<Price Currency = "USD">225</Price>

</NetPrice>

<LeadTime>1</LeadTime>

<Quote>

<QuoteID>333</QuoteID>

<QuoteItemID>3333</QuoteItemID>

</Quote>

<ItemText Language = "EN">

The award-winning Palm Computing organizers, designed as companion products to personal computers, enable mobile users to manage their schedules, contacts, and other critical personal and business information on their desktops and remotely. Palm Computing organizers automatically synchronize their information with a personal computer locally or over a local or wide area network at the touch of a button. Their most distinguishing features include shirt-pocket size, instant response, an elegant graphical user interface and an innovative desktop docking cradle which facilitates two-way synchronization between the PC and organizer.

</ItemText>

</ShoppingBasketItem>

<ManufacturerDescription ID = "5">

<PartnerProductID Code = "Other">333</PartnerProductID>

<PartnerID Code = "Other">3333</PartnerID>

</ManufacturerDescription>

<VendorDescription ID = "4">

<PartnerProductID Code = "Other">12345</PartnerProductID>

<PartnerID Code = "Other">1768</PartnerID>

<LeadTime>1</LeadTime>

<BuyerContract>

<ContractID>333</ContractID>

<ContractItemID>3333</ContractItemID>

</BuyerContract>

</VendorDescription>

</Product>

</Catalog>

</BusinessDocument>