on 08-06-2020 11:54 AM
Hi SAP community
I am looking for some help with message mapping in SAP PO.
We have an interface that takes a text file from one system, and creates IDocs using message type CONF_ACT10, and Idoc type CONF_ACT1001. It currently creates 1 IDoc for each record in the file.
The source data file contains 6 fields, and the current mapping is as follows:
So if the source file contained the following data, it would post 3 IDocs:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Messages xmlns:ns1="http://sap.com/xi/XI/SplitAndMerge">
<ns1:Message1>
<ns0:MT_JP_FlatFile_Source xmlns:ns0="http://PALLETT.com/Test/FlatFileToIDoc">
<RecordSet>
<Record>
<EmployeeID>0902160</EmployeeID>
<WorkStartDate>29/07/2020</WorkStartDate>
<ActivityNumber>PM</ActivityNumber>
<NetworkNumber>PM0000090790450150</NetworkNumber>
<ActualWork>92</ActualWork>
<Source>SAP-MES</Source>
</Record>
<Record>
<EmployeeID>0902162</EmployeeID>
<WorkStartDate>30/07/2020</WorkStartDate>
<ActivityNumber>PM</ActivityNumber>
<NetworkNumber>PM0000090790450152</NetworkNumber>
<ActualWork>92</ActualWork>
<Source>SAP-MES</Source>
</Record>
<Record>
<EmployeeID>0902160</EmployeeID>
<WorkStartDate>29/07/2020</WorkStartDate>
<ActivityNumber>PP</ActivityNumber>
<NetworkNumber>PM0000090790450150</NetworkNumber>
<ActualWork>92</ActualWork>
<Source>SAP-MES</Source>
</Record>
</RecordSet>
</ns0:MT_JP_FlatFile_Source>
</ns1:Message1>
</ns1:Messages>
I am now looking at changing the mapping so that instead of posting each record as a separate IDoc, it posts one IDoc per employee. The segment E1BP_CORU_ACTIV should then be populated n number of times depending on the number of records for each employee. As an example, if we received the sample message above:
I have tried following a similar scenario I found in another question (example), but I can't quite get it to work. I have tried a few different things, but I either get 1 IDoc and E1BP_CORU_ACTIV is populated 3 times, or I get 2 IDocs, but all of the E1BP_CORU_ACTIV data is only populated in IDoc 1, and IDoc 2 is effectively empty.
Instead of each record being mapped to the IDoc, I have changed it to this:
I'm guessing it's not quite right, but I've never used the node functions before, so not entirely sure how they work! If anyone can help, it would be much appreciated. Thanks.
Hi Khusal
Thanks for the message, I've already updated the IDoc from 1 to unbounded.
I made some changes last week and have now managed to get it working, but only if the source data is sorted by EmployeeID. If the source data isn't in order, some of the data gets added to the wrong IDoc...
This is the mapping at the CONF_ACT1001 IDOC header level, it now creates 1 IDoc per EmployeeID:
And this is the mapping at the segment we want to populate each time there is a record for an employee:
I will try and get it working today, I think I just need some extra sorts, but couldn't work it out last week! Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is probably because of the idoc occurrence in the structure is one.
I suggest try to change the xsd of the idoc from 1 to unbounded or use multi-mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.