cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping: IDoc

Former Member
0 Kudos

Dear All

I am using JAVA Mapping to amp an XML file to an IDoc. I require to disable a few fields in IDoc structure.

Please let me know how to accomplish this in JAVA mapping.

Thanks

Sourabh

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Sourabh,

IF the target IDoc field is having minOccurs = 0 then no need of disabling.. But if they have min)ccurs =1 then you canot disable them using java mapping.. What I will suggest is to have a java mapping which will create dummy value for minOccurs = 1 fields (ie field which you want to disable) and then use another message mapping, with source and target a IDoc. there you can do a 1:1 mapping and disabel the field that you dont need..

But is there any specific requirement that you are choosing java mapping?? can't you handle that using some udf?? Give it a thought

Regards

Suraj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can do it in 2 ways::

1. By using node function

2. By using UDF, eg.

Queue type UDF

{

for(int i=0;i<idoc.length();i++)

{

else if(a[0].equals("X"))

{result.addValue(Idoc<i>);

}

else if(a[0].equals("y"))

{

result.addValue(Idoc<i>);

}

else

{

result.addSuppress();

}

}

Please modify the code (there may be syntax erros )

Is this to be done only by java mapping??

Hope this help u

Regards,

Sushama