Groovy script:
import com.sap.it.api.mapping.*;
def String customFunc(String arg1){
def randomID = UUID.randomUUID().toString().replace("-", "").toUpperCase();
return randomID
}
This blog is created to throw some lights on SAP CPI concepts, which experienced in my journey. Trying to explore more about HCI/Cloud platform integration/SCPI and sharing the contents to help you. Thanks for all Users your support. Please give your comments below ...
Groovy script:
| S.No. | SOAP | HTTP |
|---|---|---|
| 1. | SOAP stands for Simple Object Access Protocol. | HTTP stands for Hypertext Transfer Protocol. |
| 2. | It is XML based used for sending and receiving messages. | It is used to transfer information over the internet. |
| 3. | It supports web socket or WS-Addressing, WS-Security, SwA. | It do not supports web socket or WS-Addressing, WS-Security, SwA. |
| 4. | HTTP is over TCP and IP. | SOAP is over HTTP. |
| 5. | It support runtime checking against WSDL. | It do not support runtime checking against WSDL. |
| 6. | It support Automatic processing of Message Transmission Optimization Mechanism (MTOM). | It also support MTOM, but it must use the MIME message domain and design flow should be done to handle the attachments explicitly. |
| 7. | This protocol’s design is Data centric. | This protocol’s design is Document centric. |
| 8. | It is a light weight data interchange protocol. | It is not light weight data transfer protocol as SOAP. |
We would need to implement this feature in CPI to search on
any specific Key ID’s like CustomerID, TicketID. So we will utilize this below.
Challenges:
As of now finding the specific data in CPI using any ID
search is not implemented, as we search using timing and it is very difficult
for us to find it if there are several message on every secs.
Solution:
Interface implementation:
There is no option in the CVS to XML convertor in CPI for converting the flat file. We can customize using the groovy script to achieve this.
Input:
NHEDSAPPS220CGroovy Script:
Output:
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<Header>
<ItemType>NHE</ItemType>
<ISPID>S</ISPID>
<Rate>P</Rate>
</Header>
<Items>
<Type>16</Type>
<FullClaimNumber> 2</FullClaimNumber>
<ClaimNumber>20190523</ClaimNumber>
<AuthorizationCode>45</AuthorizationCode>
</Items>
<Items>
<Type>16</Type>
<FullClaimNumber> 2</FullClaimNumber>
<ClaimNumber>20190523</ClaimNumber>
<AuthorizationCode>46</AuthorizationCode>
</Items>
<Items>
<Type>16</Type>
<FullClaimNumber> 2</FullClaimNumber>
<ClaimNumber>20190523</ClaimNumber>
<AuthorizationCode>47</AuthorizationCode>
</Items>
<Items>
<Type>16</Type>
<FullClaimNumber> 2</FullClaimNumber>
<ClaimNumber>20190523</ClaimNumber>
<AuthorizationCode>48</AuthorizationCode>
</Items>
<Trailer>
<Type>TRAR</Type>
<NumExtendedWarranty>007</NumExtendedWarranty>
<ElectroluxCustomerId>2</ElectroluxCustomerId>
</Trailer>
</Root>