cancel
Showing results for 
Search instead for 
Did you mean: 

do not create target structure if particular field is not present in source structure

Former Member
0 Kudos

Is there a way as to not create target structure if a particular field is absent in the source.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Vicky,

You can achieve that in Message Mapping without failing the message using a few node and text functions , but the occurrence of the target message be either 0..1 or 0..Unbounded.

I created two sample message types 'DemoSrc' and 'DemoTarget' and tested the same in message mapping.

In the below map, I didn't want to target message 'DemoTarget' to be created if the field 'Field' is not present in the source message 'DemoSrc'.

Test when the element 'Field' is present in the source message.

Test when the element 'Field' is absent in the source message.

In both the cases, the mapping is executed successfully.

Hope this helps..

Regards,

Samanth Kunapareddi.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You can also use createIf  node function to handle the same. Check below link for further details

http://scn.sap.com/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-part-ii

Former Member
0 Kudos

My question is not a particular field in the target but the whole target structure .

Former Member
0 Kudos

Hi Vicky,

you've wrote "if a particular field is not present" at the topic!

cheers,

Edu

Muniyappan
Active Contributor
0 Kudos

You can handle this in receiver  determination.

Former Member
0 Kudos

The mapping is invoked but if a particular field is missing (dynamic header field) than do not create the target message.

former_member184720
Active Contributor
0 Kudos

You can read header values using UDF right ?validate if the value is available or not. If it is empty do not create target message type..

what is your scenario?

Former Member
0 Kudos

If I have the root element not created in the target message ... the receiver channel (SOAP) will still be invoked...right?

former_member184720
Active Contributor
0 Kudos

Nope.. It'll be a mapping failure. Your channel will not be invoked.

Former Member
0 Kudos

Well than that doesn't help.

former_member184720
Active Contributor
0 Kudos

It's not clear what you are trying to achieve.

If your channel has to be invoked and there should be no payload then change the occurrence of target MT to 0..1

It just sends messages/messages 1 tags to target web service but there won't be any payload  in it.

I just gone through your other thread but what is this mapping is for?  is it for second interface?

Former Member
0 Kudos

Hi Vicky,

simply insert an 'if' with an 'exists' (node function).

Cheers,

Edu