Order_no: random alphanumeric string of length 6 and concat it with quantity and Item as below.
Example: Item:- xyz, Quantity: 1 => Order_no = AB12CDxyz1
TransactionId:- Random alpha character string of length 10 and concat it with the Order_no.
Example: ABCDEFGHIJAB12CD1xyz
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order_root">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Orderno" />
<xs:element name="Cust_Name" type="xs:string" />
<xs:element name="Cust_Add" type="xs:string" />
<xs:element name="Item" type="xs:string" />
<xs:element name="Action" type="xs:string" />
<xs:element name="Quantity" type="xs:unsignedByte" />
<xs:element name="Email" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order_root">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Orderno" />
<xs:element name="Cust_Name" type="xs:string" />
<xs:element name="Cust_Add" type="xs:string" />
<xs:element name="Item" type="xs:string" />
<xs:element name="Action" type="xs:string" />
<xs:element name="Quantity" type="xs:unsignedByte" />
<xs:element name="Company" type="xs:string" />
<xs:element name="Email" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
import com.sap.it.api.mapping.*;
def String customFunc(String arg1){
def chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
def random = new Random();
def sb = new StringBuilder(6);
for (int i = 0; i < 6; i++) {
sb.append(chars.charAt(random.nextInt(chars.length())));
}
return sb.toString();
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order_root">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Orderno" />
<xs:element name="Cust_Name" type="xs:string" />
<xs:element name="Cust_Add" type="xs:string" />
<xs:element name="Item" type="xs:string" />
<xs:element name="Action" type="xs:string" />
<xs:element name="Quantity" type="xs:unsignedByte" />
<xs:element name="Company" type="xs:string" />
<xs:element name="Email" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order_root">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Orderno" type="xs:string" />
<xs:element name="Cust_Name" type="xs:string" />
<xs:element name="Cust_Add" type="xs:string" />
<xs:element name="Item" type="xs:string" />
<xs:element name="Action" type="xs:string" />
<xs:element name="Quantity" type="xs:unsignedByte" />
<xs:element name="Company" type="xs:string" />
<xs:element name="Transition_ID" type="xs:string" />
<xs:element name="Email" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
import com.sap.it.api.mapping.*;
def String customFunc(String arg1){
def chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
def random = new Random();
def sb = new StringBuilder(10);
sb.append(arg1);
for (int i = 0; i < 8; i++) {
sb.append(chars.charAt(random.nextInt(chars.length())));
}
return sb.toString();
}
<Order_root>
<Order>
<Orderno></Orderno>
<Cust_Name>Sahil</Cust_Name>
<Cust_Add>xyz</Cust_Add>
<Item>Pen</Item>
<Action>Pending</Action>
<Quantity>1</Quantity>
<Email>abc@gmail.com</Email>
</Order>
<Order>
<Orderno></Orderno>
<Cust_Name>Dushyant</Cust_Name>
<Cust_Add>xyz</Cust_Add>
<Item>Notebook</Item>
<Action>Delivered</Action>
<Quantity>4</Quantity>
<Email>efg@gmail.com</Email>
</Order>
<Order>
<Orderno></Orderno>
<Cust_Name>Aman</Cust_Name>
<Cust_Add>xyz</Cust_Add>
<Item>Pencil</Item>
<Action>Not Available</Action>
<Quantity>2</Quantity>
<Email>ijk@gmail.com</Email>
</Order>
</Order_root>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |