Thursday, 23 February 2017

SAP PI/PO: Java Program to fetch the values from value mapping table


The below java code in ESR will take the data from the value mapping table maintained in ID

String context = "http://sap.com/xi/XI";
   String senderAgency = "ECC";
        String senderScheme = "Directory";
        String receiverAgency = "Bank";
        String receiverScheme = "Filename";
        
        IFIdentifier source = XIVMFactory.newIdentifier(context, senderAgency, senderScheme);
     IFIdentifier target = XIVMFactory.newIdentifier(context, receiverAgency , receiverScheme);
        IFRequest request = XIVMFactory.newRequest(source,target,filename_bank_concat);
        String destvalue = "";
      IFResponse response = XIVMService.executeMapping(request);
           String[] targetValues = response.getTargetValues();
           // take first value of result
      if(targetValues.length>0)

      destvalue= targetValues[0];

You can use the destvalue and perform your logic.





1 comment: