cancel
Showing results for 
Search instead for 
Did you mean: 

PI ESR mapping issue with multiple line items

Former Member
0 Kudos

Hello Gurus,

I have an issue with PI mapping that keeps failing 'Cannot create target element' when I have multiple line items. However, the same mapping works with only single line item. I have provided the screenshot for the issue. My header occurrences is 1: unbound and Item is also 1:unbound. Also 1 header record can have nulitple line items.

Thanks in advance for your inputs and help.

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Raj,

Seems like you have held back all information required to resolve the issue.

please share the mapping screen shot with source/target messages clearly visible.

Ambrish

Former Member
0 Kudos

Here's the screenshot attached of the Source and Target

And the mapping is from the Header structure I use the field to see if it holds the value "FOREIGN" then perfrom GL conversion on the line items.

The issue is when I have this mapping used for 1 header record with multiple line items it gives the error

However, the same logic works for 1 header record with signle line item.

Also I checked the when I do the GL account 1 to 1 mapping without any conversions it works for 1 header record with multiple line items.

Hope now my issue is clear.

former_member184720
Active Contributor
0 Kudos

Can you check the attached image..

sender should be your header level header field

Field 1 is your item level field and set the context to header level(1 level above)

Regards,

Hareesh

ambrish_mishra
Active Contributor
0 Kudos

HI Raj,

The issue is coming because you are using a header field in if ..; where field at then,else are at item level.

You can use useOneAsMany for your requirement. Alternatively, copyValue();

Ambrish

Former Member
0 Kudos

Thanks Hareesh for the screenshot, I tried the change you provided however still encounter error.

Currently my mapping has been changed as suggested by you. Also the Foreigntype from header structure is now context to MT_Voucher one level up.

Former Member
0 Kudos

Thanks Hareesh please ignore my previous message, I interpreted you mapping incorrectly, it pretty much works fine as you have suggested. I give you full points for your excellent help.

former_member184720
Active Contributor
0 Kudos

Thanks Raj..

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos

You need to handle the contexts..

use display queue function to see how the value are coming..

May be you may need to raise the context and add the split by value after the if else..

Please go through the below blog to understand..

http://scn.sap.com/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapp...

Regards,

Hareesh

rajasekhar_reddy14
Active Contributor
0 Kudos

You have to build mapping logic when more than one line item present in source data what you have to do?like how many records needs to be created at target.

paste mapping screenshot here with source and target.

Former Member
0 Kudos

Raja,

I have already the screenshots in the earlier message. Also my source and target structure is the same. However, when testing the scenario 1 header and multple line items the below mapping fails and it works when I use 1 Header with 1 linet item. I did make all changes the mapping remove context, mapwithDefault, etc it still doesn't.

Also when I take out mapping and have 1 to 1mapping it works for 1 Header multiple lines.