cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with suppress on root IDoc node

former_member192892
Active Contributor
0 Kudos

Dear Experts,

I'm having the most weird and basic errors in mapping. I am doing a 1:n Idoc scenario in PI 7.31 single stack. I am checking an RFC lookup from the source record values and if the lookup value is blank, then suppressing the root node of the idoc. However, the mapping is behaving weirdly where in, the child element values in the idoc are getting filled from the 1st record in source file.

So basically it is like: if my source file has total 20 records, and only one of those 20 records is valid and should create only one idoc in target then the values are getting populated from the first record of the source file and not from the actual record which was valid.

I have tried to suppress the root idoc node using multiple options like createif, ifwithoutelse keeping suppress values and ifwithoutelse but failed with all options.

Regards

Varun

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member192892
Active Contributor
0 Kudos

Sorry guys.. False alarm

I was using a lookup and while populating, the source lookup value I was doing a toUpperCase, but not while retrieving. And this screwed things up.

Regards

Varun

anupam_ghosh2
Active Contributor
0 Kudos

Hi Varun,

                   Try using an UDF instead of standard function. In the UDF try comparing the value returned by the lookup and then forward  a boolean output (true, false) to creatIf function. I think the standard function you are using are unable to capture the blank output. The sample UDF is shown below

public String defaultVal(String a, Container container) throws StreamTransformationException{ 

     if(a==null || a.length()==0 || a.equals("")) 

     { 

          return false

     } 

     return true;   

lookup value----->UDF----->creatif---->root node

Secondly if possible could you please show a snapshot of the mapping. Since I would like to know how child element values are getting populated?

Regards

Anupam