cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping doubt

Former Member
0 Kudos

I have a IDoc to File scenario. The receiver side has given me the fields that they require. Also they need taget as xml file.

How can I create xml file in PI? How do I create Data Type for that? When I create xml file, do we need to create segments like how we have in IDoc? If one segment is repeating how do I create multiple values in target?

Accepted Solutions (1)

Accepted Solutions (1)

anand_shankar10
Active Participant
0 Kudos

Hi Radhika,

If I understood correctly, you have to create a simple mapping that can be 1..1 or 1..n based on the line items in the IDOC. by default PI creates xml file and you need to to send it to target using a particular receiver channel.

You have the fields that exists in xml file so create a data type with those that has to be used in mapping.

You must be aware about the cardinality or else keep it 1..n so that it will work for all the idocs.

Map it using the mapping logic/ mapping sheet.

What else you have in mid do share and we people will try to answer that.

Thanks

Anand

Former Member
0 Kudos

Suppoze I have a segment X which has three fields and the segment comes 5 times. I have made a target structure with the three fields mapped one to one.

If the segment comes many times, the fields in the segment also comes many times and how do I handle that/

My target structure is like this

DT_........

  a
  b
  c
  x
  y
  z

The target structure does not expect segments

Former Member
0 Kudos

Hi,

Your understanding Source IDOC target file.

source

IDOC                                                                 x(0..1),y(0..1),z(0..1)

     ZCONVERSION (0..unbound)

               FIELD1

               FIELD2

FIELD1 = X then map field2 with x

FIELD1 = Y then map field2 with y

FIELD1 = Z then map field2 with z

anand_shankar10
Active Participant
0 Kudos

Do you wish to have all the fields under same parent node, if yes then I feel you should cross check the requirement, else you can have multiple segments in the xml with each of the respective fileds coming under different segment.

Lets say the segment X comes multiple times then in the target structure you too have to create a segment X and the cardinality should be 0..n or 1..n

Thus it will create all the respective fields of X as many times the segment X appears in the source structure.

Regards

Anand

Former Member
0 Kudos

Hi,

Suppoze I have a segment X which has three fields and the segment comes 5 times. I have made a target structure with the three fields mapped one to one.

If the segment comes many times, the fields in the segment also comes many times and how do I handle that?

In order to meet your requirement you should create a target structure in such a way that a segment with (0..unbound) on top of 3 target fields .

Regards

Venkat

Former Member
0 Kudos

Hi Anand,

If there is only one field under segment X that comes many times, do we need to create a segment X in target?

i mean if I just make the occurence of the field that ccurs many times to i..unbounded, will it create many fields in target?

So if I understand correctly, my target structure without any nodes will work only correctly if the fields in it from different segments come ONLY once, right?

If all the fields from the different segments from soucre should come under one node, then the fields can occur only once, right?

anand_shankar10
Active Participant
0 Kudos

Yes, this is what I meant

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Radhika,

---->How can I create xml in PI?

No need to create separately, you will get xml automatically in PI.

>How do I create Data Type for that?

Based on the target structure in FS u will create data type.

>When I create xml file, do we need to create segments like how we have in IDoc?

Automatically XML will come, so no need to change anything, according to your receiver structure you have to create.

>If one segment is repeating how do I create multiple values in target?

change the occurrence as unbound and map according to your requirement.

Let me know if you find any difficulty.

Thanks & Regards,

A.Neelima.

PeterJonker
Active Contributor
0 Kudos

In PI all communication is in XML, you do not have to do anything to do that.

Create a datatype based on the input of the receiving side, create a message type based on this datatype and a service interface based on this message type.

Map the IDoc fields to the corresponding message type fields in a message mapping. Add the mesage mapping to a operation mapping and start configuration.

Former Member
0 Kudos

Hi ,

Before kick starting the build prepare the mapping sheet by coordinating with end systems .

>>When I create xml file, do we need to create segments like how we have in IDoc

Below is the example for your understanding.

For example you need to generate output file records based on no. of idocs.

IDoc(0..unbound) -->Bodyrecord(0..unbound)

Regards

Venkat