cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping - How to repeat whole message context

Former Member
0 Kudos

Hello Colleagues,

I need to achieve following message mapping result

MT_Employee_In

     Name

          FullName

     Contact

          StreetNumber

          ZipCodeTown

     ContactData

          Phone

          Email

     Name

          FullName

     Contact

          StreetNumber

          ZipCodeTown

     ContactData

          Phone

          Email

For 2 Employee test User records

I already created a respective message mapping with following DT structures.

Source Structure

Target Structure

Test Input

After executing under message mapping test I receive following context

Please what is wrong and how I am able to get the right structure?

Many thanks in advance!

Regards,

Jochen

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Jochen,

add a level of hierarchy in your structure.

MT_EMPLOYEE_Out

     Records    - declare this 0...unbounded.

           Name                (same structure like yours below)

                    first name

                         ......................

Have a similar structure at the target. Map and test again

Ambrish

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Ambrish, Hello ALL,

first of all, many thanks to you for your great reply!

All of you helps me very much!

The mapping context issue is solved by additional tag at source structure.

Please see below the adapted mapping configuration

... and the result after executing

Finally one question please.

During my tests regarding occurrences on the source side, I didn't identify any effects to the mapping at all.

It looks like to me, for occurrences on source there is no need to change anything?!

Here you are able to see "UserDate" at source structure is set to 1..1. and it works.

Changes for occurrences only done at target structure.

Regards,

Jochen

anupam_ghosh2
Active Contributor
0 Kudos

Hi Jochen,

                     In source structure you have given max occurrence of UserDate as 1..1. but while running the test I think you are duplicating the node. This makes UserDate appear twice which is more than its max count of 1. Thus the the data not according to source XSD design.

This works during testing but in  actual runtime you will find only first of the queue value is picked up for mapping and not the rest.

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

please find message mapping configuration and the result of the real file test executing below.

For this test I configured a real test scenario with a sender and receiver file adapter (communication channel).

Anupam, you will see that source tag for "FirstName" and "SurName" is still set to 1..1.

"FullName" on the target side is set to 1..unbounded.

Add Test File I added additional tags for "FirstName" and "SurName".

This shouldn't allowed by configuration in the source structure but it works

.

Regards,

Jochen

ambrish_mishra
Active Contributor
0 Kudos

Hi Jochen,

Anupam is right in saying that you need to make User Data in source data type as 1--unbounded.

else it will not work in an end to end test.

Ambrish

anupam_ghosh2
Active Contributor
0 Kudos

Hi Ambrish,

                    It seems it works. Jochen did an end to end test.

Regards

Anupam

anupam_ghosh2
Active Contributor
0 Kudos

Hi Jochen,

                   Before we conclude, one last question: I guess you are not doing FCC. Am I right?

If you are not doing an FCC PI skips the XML validation part.

Regards

Anupam

Message was edited by: Anupam Ghosh

Former Member
0 Kudos

Hi Anupam,

you are right I didn't activate "File Content Conversion" under Message Protocol for the respective Sender Communication Channel.

You mean, this is the cause why source structure will be not verify during executing?

Many thanks to you!

Regards,

Jochen

anupam_ghosh2
Active Contributor
0 Kudos

Hi Jochen,

                     

"You mean, this is the cause why source structure will be not verify during executing?"

ans) yes

Try activating the FCC you will receive errors or you will get only the first line from the file in mapping.

Regards

Anupam

anupam_ghosh2
Active Contributor
0 Kudos

Hi Jochen,

                    Another thing in your source structure max occurrence of Name, address and Contact is 1. Thus In run time if you want to generate multiple Names /address/ contact you have to make them 1... unbounded. 

  

Even if you change the occurrence the structure is not suitable since you cannot know which address corresponds to which name. Sender has to to strictly maintain the order, in case of mistakes data might garble up at receiver end.

Regards

Anupam

ambrish_mishra
Active Contributor
0 Kudos

Hi Anupam,

If you encapsulate the NAME, Address and Contact node within a record, which is 0...unbounded, then changing the occurrence of Name, address etc is not required. Joen would need to change the target structure as well and do one to one mapping.

Off course the data from the source should come in sequence per employee.

Hope you agree!

Ambrish

anupam_ghosh2
Active Contributor
0 Kudos

Hi Ambrish,

                        I understand your point, in fact in my mapping example I did the same.

Then I was trying to do the mapping keeping source structure as provided by Jochen. Then felt that this kind of source structure should not be used as in real production scenario it will be difficult to relate name with address while troubleshooting.

Regards

Anupam

ambrish_mishra
Active Contributor
0 Kudos

Agree with you!

file should be like below:

Name1

Address1

contact1

Name2

Address2

contact2

Name3

Address3

contact3

and not like

name1

name2

name3

address1

address2

address3

contact1

contact2

contact3

Ambrish

Former Member
0 Kudos

Hello,

Very similar to what u need:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/01/14/file-conversion-using-nodeception

Tweak ur target structure (as already suggested above by others) and then use java mapping

Thanks

Amit Srivastava

anupam_ghosh2
Active Contributor
0 Kudos

Hi  Jochen,

                   Try following source and target structure

Mapping should be like this

Test results

I have shown mapping only for the name part, rest will will be similar.

Regards

Anupam