cancel
Showing results for 
Search instead for 
Did you mean: 

XI Mapping

Former Member
0 Kudos

Hi XI Master,

I am XI beginner. I would like to have some advise from expert about how to do mapping. My target should group by Pay_Type. As long as same Pay_Type, the customer will group under the same Pay_Type.

Let say if my source have 4 different Pay_Type, so my target should have 4 Pay_Type group. Under each of the Pay_Type, it will have more than 1 customer.

Example: I got 1 csv file. the file format is like below:

<u>SOURCE Structure:</u>

<Recordset>

<Record>

<Cust_cd>C001</Cust_cd>

<Pay_Type>P1</Pay_Type>

<Amount>1.5</Amount>

</Record>

<Record>

<Cust_cd>C002</Cust_cd>

<Pay_Type>P2</Pay_Type>

<Amount>2.5</Amount>

</Record>

<Record>

<Cust_cd>C003</Cust_cd>

<Pay_Type>P3</Pay_Type>

<Amount>3.5</Amount>

</Record>

<Record>

<Cust_cd>C004</Cust_cd>

<Pay_Type>P1</Pay_Type>

<Amount>10.5</Amount>

</Record>

</Recordset>

<u>Target structure</u>

<Recordset>

<Type_P1>

<Cust>

<Cust_cd>C001</Cust_cd>

<Pay_Type>P1</Pay_Type>

<Amount>1.5</Amount>

</Cust>

<Cust>

<Cust_cd>C004</Cust_cd>

<Pay_Type>P1</Pay_Type>

<Amount>10.5</Amount>

</Cust>

</Type_P1>

<Type_P2>

<Cust>

<Cust_cd>C002</Cust_cd>

<Pay_Type>P2</Pay_Type>

<Amount>2.5</Amount>

</Cust>

</Type_P2>

<Type_P3>

<Cust>

<Cust_cd>C003</Cust_cd>

<Pay_Type>P3</Pay_Type>

<Amount>3.5</Amount>

</Cust>

</Type_P3>

</Recordset>

Thank you very much and appreciate for your help.

Regards

Lord

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Hello Lord,

I've picturised the mapping logics , please find them in the below URL.

Please see the structure , that I've been created as per ur reqmt.

http://www.flickr.com/photo_zoom.gne?id=976271020&size=o

In the above URL, U might wonder why I created the third Data type ,

since the sub-structure is common across Type_P1 & Type_P2 & Type_P3.

I created as separate data type ans used them.

How to use it, please refer the below URL. I knew it's out of scope for

your requirement. Just thought of sharing it.

http://www.flickr.com/photo_zoom.gne?id=976271096&size=o

<b>Mapping Structure & Logic.</b>

Mapping for segment Type_P1& Type_P2 & Type_P3

http://www.flickr.com/photo_zoom.gne?id=976271312&size=o

UDF used for the above segment's

http://www.flickr.com/photo_zoom.gne?id=976271330&size=o

Mapping for segment Type_P1/Cust & Type_P2/Cust & Type_P3/Cust

http://www.flickr.com/photo_zoom.gne?id=976271382&size=o

Mapping for segment Type_P1/Cust/Cust_cd & Type_P2/Cust/Cust_cd & Type_P3/Cust/Cust_cd

http://www.flickr.com/photo_zoom.gne?id=976271390&size=o

Mapping for segment Type_P1/Cust/Pay_Type & Type_P2/Cust/Pay_Type & Type_P3/Cust/Pay_Type

http://www.flickr.com/photo_zoom.gne?id=976278338&size=o

Mapping for segment Type_P1/Cust/Amount & Type_P2/Cust/Amount & Type_P3/Cust/Amount

http://www.flickr.com/photo_zoom.gne?id=976277974&size=o

<b>Results</b>

http://www.flickr.com/photo_zoom.gne?id=976278352&size=o

http://www.flickr.com/photo_zoom.gne?id=976278344&size=o

I hope it helps you!!

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

Thank you very much and really appreciate of your expert advise. I will try it out.

Btw, if you don't mind, can i have your email so next time you can guide me in XI.

Best regards

Former Member
0 Kudos

Hi Raj,

Do you have any idea how to do in such a way that, if i do not know how many Pay_Type in the source and i want it to be like as long as there is new Pay_Type, the target structure will automatically create new Type_PX where X is any number.

Best regards

justin_santhanam
Active Contributor
0 Kudos

Hello,

I thought it initially. Before I started working on it, I must have confirmed with u about the structure. But I was confident bcoz in ur structure u have given as Type_P1, Type_P2 and so on. So I had assumption that u will have only 3 paytypes. As per ur new reqmt , u can do it easily, but one criteria u need to change the data type structure.

My email id is sapient.xi@gmail.com. You can mail me, but I'll suggest u to post the questions here, please don't mind that I'm saying this for points. The reason i'm saying this is bcoz there are lot of our friends will have different methods to implement the same, so u can choose the best. I can support u at anytime offline, send me an e-mail.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

I have been trying to create the dynamic target structure for many times. however i still cannot figure out how to get ride of the Mapping Constant. I have modified the target structure where it only consist of Type_PX and source structure remain the same.

Would you be able to give me some idea how to create the dynamic mapping?

Thousand times of Thanks.

Best regards

justin_santhanam
Active Contributor
0 Kudos

Hi,

Surely!! But can u give me sometime. Tom morning after reaching the office I'll give u the solution. I don't have access to my office XI server. In the mean time our friends will suggest u to sove the issue.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

No problem. No hurry.

Btw, i am quite interested how you master the XI mapping? Maybe you can give me some advice to become very good in XI. I come from SAP ABAP background and currently switch to SAP XI.

Many thanks for your help and advise.

Best regards

justin_santhanam
Active Contributor
0 Kudos

Hi,

Thanks for the patience.

<i>Btw, i am quite interested how you master the XI mapping?</i>

Not at all. There are lot of our friends who is more talented than me, I'm just beginner, please never say that I'm master .:-)

To be frank with you, I started exploring and working my mapping experience only in SDN Forum. I must really thankful to the forum. I'll suggest you to look for the past mapping problems or the current one's and try to simulate them. Trust me , you will learn a lot.

Best regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Hello,

Please find the mapping according to ur new reqmt.

http://www.flickr.com/photo_zoom.gne?id=1055773214&size=o

http://www.flickr.com/photo_zoom.gne?id=1055773256&size=o

http://www.flickr.com/photo_zoom.gne?id=1055773268&size=o

http://www.flickr.com/photo_zoom.gne?id=1055773292&size=o

http://www.flickr.com/photo_zoom.gne?id=1055773276&size=o

UDF - http://www.flickr.com/photo_zoom.gne?id=1054918191&size=o

Results -http://www.flickr.com/photo_zoom.gne?id=1055773306&size=o

I hope it helps!!! Also please do the complete testing, if you find any discrepancies let me know.

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

Very sorry for late reply coz i have to settle something else. Thank you very much for your help. It work according to what i want. Furthermore, i have made some modification on it.

Really thousand many thank to you.

Best regards

Answers (3)

Answers (3)

Former Member
0 Kudos

HI,

use copy per value followed by Split by value function in mapping and context change.

Regards,

S.RamNarender

Former Member
0 Kudos

Hi RamNarender,

First of all, Thanks for the fast reply.

Can you explain in more detail? Coz i am XI greenhorn.

I have this User-defined function call copyPerValue and try SplitbyValue in exercise. However I still cannot figure out how to apply in my problem.

Thank you and appreciate your help XI expert guidance.

Former Member
0 Kudos

Hi Lai,

Refer this blog...

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

might help you..

vasanth

Former Member
0 Kudos

check with this

/people/srinivas.vanamala2/blog/2007/02/05/step-by-step-guide-xml-file-2-xml-file-scenario-part-i

/people/srinivas.vanamala2/blog/2007/02/05/step-by-step-guide-xml-file-2-xml-file-scenario-part-ii

Thanks

Former Member
0 Kudos

Hi Lai,

Go thorugh the link..

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1 - File to File Part 1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 - File to File Part 2

might help you ....

vasanth