Skip to Content
0

Issue in populating correct target node

Feb 17 at 01:49 PM

97

avatar image
Former Member

Hi Experts,

Interface : XML to idoc.

Since i want to generate multiple idocs from single xml file, i am using multi mapping.

My SAP PO version is 7.5, somehow node functions removeContext and collapseContext are not working as expected.

So i have created udf and used. Reference: https://blogs.sap.com/2015/11/07/node-functions-as-udf-in-sap-pi/

Based on 1 unique value from sender records.. idocs should be generated.

Below is structure :

Mapping for ZOTC_DELVRY01:

Mapping for Z1DLHEADER:

Mapping for Z1DLITEM:

Fields :

Z1DLHEADER:

ShippingPoint

NGBSSD

Z1DLITEM:

Material

SAMPLE data used :

Record1 : ShippingPoint: SS01, NGBSSD: SH0001, Material: A

Record2 : ShippingPoint: SS01, NGBSSD: SH0001, Material: B

Record3 : ShippingPoint: SS02, NGBSSD: SH0002, Material: C

Record4 : ShippingPoint: SS02, NGBSSD: SH0002, Material:D

As per my requirement Idocs should be formed based on NGBSSD values.

Expected output from above sample data: 2 idocs should be formed.

1st idoc :

Header should have values from Record 1

Item should have Material A & Material B

2nd idoc :

Header should have values from Record 3

Item should have Material C & Material D

Current Output:

2 idocs are forming.

1st Idoc :

Header has values from Record1

Item has : Material A & Material B

2nd idoc with :

Header has values from Record1

Material C & Material D in line item.

Issue:

For 2nd idoc Header values are wrongly populated in test tab.

FYI:

when i do DisplayQueue for Z1DLHEADER i am generating correct output. but in test tab not getting correct values.

Please somebody help me with this.

Regards

Ankyy

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Ryan Crosby Feb 17 at 02:24 PM
0

Hi Ankky,

Do you have an example mapping for one of the header fields that is getting incorrect values and also a screenshot of the mapping?

Regards,

Ryan Crosby

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Please check the test data.. highlighted part should have different values (Ie SS02).

whereas in display queue i an getting correct output.

Regards

Ankita

sample-output.png (43.1 kB)
0

Hi Ankita!

And what are the mappings for SHIP_POINT and EXT_DELIVERY?

Regards, Evgeniy.

0
Former Member

For now rest of all the fields are mapped 1:1 (direct field mapping)

Regards

Ankyy

0

Direct field mapping means that your header contexts don't match the header field level values because you are generating 2 header level nodes but passing 4 sets of header field level data. You have condensed the header nodes to 2 but retained the 4 unique values using direct mapping but for that header field level you also need to use collapse context to restrict to the unique values.

Regards,

Ryan Crosby

0
Former Member

I used formatbyexample and issue got resolved.

Regards

Ankyy

0
Evgeniy Kolmakov Feb 18 at 03:21 PM
0

Hi Ankyy!

If you use direct mapping for SHIP_POINT and EXT_DELIVERY, doesn't it mean that you have four values for each of them in source queue with two pair of values? If so, the result you get is correct since the first two values are SS01/SH0001.

I guess you should apply the same mapping for it as you do for Z1DLHEADER.

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

I used formatbyexample and issue got resolved.

Regards

Ankyy

0
Anurag Tyagi Feb 18 at 05:10 PM
0

Mapping is wrong for ZOTC_DELVRY01 and Z1DLHEADER. use collapse context after change value for ZOTC_DELVRY01 mapping.And use splitByvalue after collapse context for Z1DLHEADER mapping

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Issue is resolved. Thanks for suggestion.

Regards

Ankyy

0