cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue:Assign src field val to target when src field not exists

Former Member
0 Kudos

Hi

Pls guide though the following issue in Message Mapping

I do have a segment of 0...n. where the target element is manipulated based on the three fields in source segment.


<Source>
Parent Segment (1..1)
	Segment	(0...n)
		Field_1  =  23k	
		Field_2  =	 01
		Field_3  =  (either 'X' or No field in IDOC segment)


<Target>
Segment (1...1)
	t_Field  =  ( if ( ( Field_1 = '23K') & (Field_2 = '01'))  then  assign Field_3  )

How can i check or handle this Field_3 issue when its not present in IDOC segment?

Note: I am using UDF, and getting errors while retrieving Field_3 data when the field itself is not present in segment inside loop statement.

Thanks,

Vinod V

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

On your field_3, before your UdF, use a mapWithDefault with default value "FieldDoesNotExist" for instance.

And then in your UdF, use this same value to do your test.

regards.

Mickael

Former Member
0 Kudos

Thanks Mickael for the reply,

I have tried the same, and its working fine with the Display Queue. But giving following error while performing the Transformation Test.

I found that in loop Field_3 returns value at first index only. It does not increment.

Field_3's context is set to Parent Context.

Please help with inputs.

regards,

Vinod V

Former Member
0 Kudos

>>Field_3's context is set to Parent Context.

Instead of directly changing the context use below mapping for Field_3

Field_3mapwithDefault()removecontext- rest of ur mapping

Former Member
0 Kudos

And that was an awesome ans.....

Regards,

Vinod V

Answers (0)