Skip to Content
avatar image
Former Member

how to do the mappinng for the following scenario .

if E2EDP19001.QUALF = "002" then ( if EDI_DC40.RCVPRN = "0010000039" (trimleft zeroes and map E2EDP19001.IDTNR) else map last 5 characters ) mapPO107

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 24 at 03:04 AM

    Hi Utkarsh,

    This can be achieved with a simple If else node function in graphical mapping. Please provide the input payload if you find any problem to achieve this.

    regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded

  • May 24 at 06:17 AM

    Hi Utkarsh Awasthi,

    Either you can use a UDF like below for your case, where you need to pass three inputs

    1. input1 for value of E2EDP19001.QUALF
    2. input2 for value of EDI_DC40.RCVPRN
    3. input3 for value of E2EDP19001.IDTNR

    and use below code

    publicString TestUdf(String input1,String input2,String input3, Container container) throws StreamTransformationException{
    
    
    		String result = "";
    		if (input1.equals("002")) {
    			if (input2.equals("0010000039")) {
    				//trim left zeroes and map E2EDP19001.IDTNR
    				String strPattern = "^0+";
    				result = input3.replaceAll(strPattern, "");
    				return result;
    			}else{
    				//map last 5 characters
    				result = input3.substring(input3.length() - 5);
    				return result; 
    			}
    		}else{
    			return null;
    	       }
    
    }

    Thanks & Regards,

    Dilip

    Add comment
    10|10000 characters needed characters exceeded