cancel
Showing results for 
Search instead for 
Did you mean: 

Segment creation problem

Former Member
0 Kudos

I have a File to IDoc scenario. The IDoc imported has a particular segment E1EDPAD occuring only once in the structure. I have PRI and QUALF in that segment. For a particular source field X, I need to send the value of QUALF as 3 and then the value of X to PRI.  For another source field Y, I need to send the value of QUALF as 7 and then the value of Y to PRI.

The problem is the source IDoc has one occurence of segment E1EDPAD. How do I add a segment the second time in Idoc with the respective values?

The QUALF values are always hard coded. The other values,X and Y change

Accepted Solutions (0)

Answers (2)

Answers (2)

sendhil_kumar
Active Participant
0 Kudos

Midhun,

Based on what condition, the multiple E1EDPAD segments are required. Is it based on any of the Source field or can it have maximum number of instances (for example say 10) .

--

Sendhil

Former Member
0 Kudos

Its tagged to both Header and Lin Items, Line items can come multiple times

sendhil_kumar
Active Participant
0 Kudos

Midhun,

I am trying to understand, based on what condition the E1EDPAD segment should be repeated and number of times of repeating is based on What field?

If it is fixed number, you can use CreateIf function to populate Values only if the Values of Source are present else, it wont be created in the target idoc.

--

Sendhil

0 Kudos

Hi Midhun,

You can right click on E1EDPAD in your target structure and select  duplicate subtree option in mapping with which you can create other segment.

I hope it answers your question.

Regards,

Sudha

Former Member
0 Kudos

Hi Sudha,

If I create duplicate subtree option, will it change the structure in the IDoc that I have imported? Will this work at runtime?

Also what will happen if the value that I created do not come in the source file? Both X and Y are mandatory fields

Regards

0 Kudos

Hi Madhav,

If I create duplicate subtree option, will it change the structure in the IDoc that I have imported? Will this work at runtime?

--Ideally it will not change the structure, But it serves your mapping rquirement.

Yes, It will work at runtime.

Also what will happen if the value that I created do not come in the source file? Both X and Y are mandatory fields

-- If the the source fields are mandatory it is senders responsibility to send the fields. If you need to avoid error when the fields are not coming then you can use exist func to create the segment.

Regards,

Sudha


Former Member
0 Kudos

The problem is the IDoc segment is mapped to a node in target that comes multiple times. How will the mapping work if the fields come many times and I use duplicate sub tree?

0 Kudos

Hi Midhun,

As per your explanation. Idoc id target structure and you need to create 2 segments one for QUALF= 3 and other for QUALF= 7.

If the above understanding is correct then you can use duplicate subtree.

If you need more help then post source and target structures with sample data.

naveen_chichili
Active Contributor
0 Kudos

Hi Midhun,


You have two optioins:


1.Try using UseoneasMany node function and check if your condition is satisfying.


2. can export the IDOC structure to and modify the XSD and reimport into external defenition and use the IDOC strucre


Regards,

Naveen    



Former Member
0 Kudos

The Functional specs says that I have to send the field that occur once in Header and the same field that occur many times in line item to the same field of the same segment in IDoc.

I mean if it was just line items then I would have mapped the nodes od line item and IDoc segment.

I kind of feel this is impossible to do from PI