cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping issue

rajan_s
Participant
0 Kudos

How do I bring in all source data elements that have no values into target elements. I would like to bring the empty source data elements with spaces in the target data elements. Not all the data elements are mapped. Any idea?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Rajan,

Use the combinaiton of exists and if-else function in message mapping. Check for that field exists or not? If it exists then pass that field and if it doesnot pass the constants in the else part.

If you get suppress then have a look at this blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3468. [original link is broken] [original link is broken] [original link is broken] [original link is broken]

In solution 3 under 3. Mapping of <ProductQuantity> you find a solution for a very similar problem. I think the trick is to keep the SUPPRESS value in your result list.

---Satish

rajan_s
Participant
0 Kudos

I'm not sure if the field exists, how to pass the value since the value is not constant. If there is no value coming in, then how do I fill with empty spaces in the target?

Former Member
0 Kudos

>>I'm not sure if the field exists, how to pass the value since the value is not constant. If there is no value coming in, then how do I fill with empty spaces in the target?

Exactly the function of "MapWIthDefault" Function. Map your source to MapWithDefault function and map the output to the target node. In runtime, if te source node is present with some value then it is passed to the target node. If the source doesnot exist, then empty value is passed. You can change this value too. By changing the property of MapWithDefault function.

Regards,

Jai Shankar

rajan_s
Participant
0 Kudos

Thanks for the replies. If I don't want to map the source to the target but still want to show the target fields with blank spaces to create a flat file with fixed lengths, how would I do that?

Former Member
0 Kudos

Rajan,

Then use the function constant and give the value you need and map it to target.

Regards,

Jai Shankar

rajan_s
Participant
0 Kudos

I don't want to give any value but just fill in with spaces.

Former Member
0 Kudos

That is what I said. Use a constant and change the vlaue to a single space or even no space(empty constant).

Regards,

Jai Shankar

bhavesh_kantilal
Active Contributor
0 Kudos

Exactly, for this use a Constant as pointed by jai Shankar. This constant will have a value which is a space.

Regards

Bhavesh

rajan_s
Participant
0 Kudos

Thanks everybody, your response was greatly appreciated.

Answers (0)