Blog Archive

Thursday, April 6, 2017

SAP PI udf && frequently used java api && skip suppress and null and context separation

Om

 

Add suppress
remove context seperation including null;

checking context separation and supress and null in array.
















































Example: helps 
add suppress
remove suppress
( also validation of context separation and null empty )



Remove Leading zeros in string in HCI

import com.sap.it.api.mapping.*;

//Add MappingContext as an additional argument to read or set Headers and properties.
def String removeLeadingZero(String inputValue){
   
    if(inputValue != null && inputValue.length() > 0){  
    char[] inputValueChars = inputValue.toCharArray();
    int index = 0;

    for (; index < inputValue.length(); index++)
    {
        if (inputValueChars [index] != '0'){
            break;
        }
    }
        return (index == 0) ? inputValue:inputValue.substring(index);
    }
    return null;
}

No comments:

Post a Comment