cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem

HarshC
Active Participant
0 Kudos

Hi All,

I've got a IDoc to Soap call scenario working for me with simple mappings. The scenario is as follows.

If any field in a segment is modified, the entire segment is sent in an IDoc to XI. This gets mapped with a SOAP call to a webservice.

<b>The Problem:</b>

The problem arises, when a field is deleted(not modified) in SAP. This triggers an IDoc to XI, which contains the segment(but the deleted field is missing). Since the field is missing, it doesn't get mapped to the SOAP call(with empty tags <tag></tag>) and the logic breaks!

<b>The Solution:</b>

a. Check if the segment exists.

b. If so, pass empty tags(<tag></tag>) for all the fields missing in the IDoc segment.

<b>The Problem with the Solution!:</b>

a. This logic needs to implemented at a per field level! So if I have 20 fields per segment and 5 segments, it means 100 modifications!

b. And if I have multiple interfaces/IDocs!!!

Is there a better way to do this?

Thanks,

Harsh

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

Harsh,

If you see your outbound idoc to file interface in ur implemenation..you can see that we used a UDF to generate mandatory fields even if source idoc doesnot provide..:)..but yes u have to do mapping at every field or use XSLT or java mapping if you wanna avoid that..:)..You are a java expert..choice is yours:)

HarshC
Active Participant
0 Kudos

Hi Guys,

Thanks for your inputs, your suggestions were helpful. Unfortunately, the logic on the SOAP side got changed. So I had fix the mapping using some other logic!

Anyway, things are fine now. Points awarded.

Regards,

Harsh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Harsh,

The approach you have taken is correct. But instead of doing a if exists check you can do like following

Source=>mapWithDefault=>Target

With this evenif the source is not having the field which is deleted, the XML tag will be generated in your target side.

But unfortunately this you need to do it at field level.

Cheers

JK