Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

File to Multiple IDocs




The complexity of file to IDoc scenario depends on the complexity of the incoming file and the IDoc posting criteria. Graphical mapping becomes difficult as the complexity increases. In such cases we have to go for other
mapping options like XSLT and Java mapping.




Scenario:





IDocs have to be posted for every occurrence of REJFL and TROUT in the
incoming file (Please refer to the Sample file).




Sample input file:





"HEADR","RSUPD","G","M","B","S",20041211,"202457","PN0","
PRT",16668,4605




"REJFL","PN085",20041211,"202457"




"REJRS","JFL","02108","Invalid
Incoming "




"REJRS","JFL","02108","Invalid
Incoming "




"RESPN","PN5",20041211,"202457"




"TROUT","RSUPD","REJCT",89007,"2081439","UPDTE",""




"REJRS","JFL","02108","Invalid
Incoming "




"TRANS","00454","TRA3","000454","UPDTE","ADD","000454","00001454","PASS","PASS","A",13052005,"BB","BK",13052005,13052005




"REJRS","JFL","02108","Invalid
Incoming "




"MTPNT","MTPNT",12091,"M","PS","LE","LE30EB","INST",1,13052005,2




"REJRS","JFL","02108","Invalid
Incoming "




"ADDRS","ADDRS","ADDRS","286","WESTERN ROADquot;,"ADDRS","NARBO
ROADquot;,"CITY
CENTRE","ADDRS","LEICESTER","LEICESTERSHIRE","LE30EB",1,1,1,"FREE"




"REJRS","JFL","02108","Invalid
Incoming "




"REJRS","JFL","02108","Invalid
Incoming "




"REJFL","PN085",20041211,"202457"




"REJRS","JFL","02108","Invalid
Incoming "




"TRAIL"







As per this sample file, three IDocs should get posted.





In the incoming text file there can be one or more REJRS nodes
(cardinality 0 to unbounded) after every REJFL, TROUT, TRANS, MTPNT, and ADDRS.
The complexity comes as the key field value for all these reasons are the same
“REJRS”. So the file content conversion will generate a flat XML
with the same node name for all occurrences of REJRS. Message mapping is not
possible in this case as the REJRS node name remains the same through out the
file. Hence I have used XSLT mapping.






The picture below would give a better idea about the IDoc posting criteria.

INTEGRATION REPOSITORY:




A flat data type (DT_RSUPD) is created as shown.

Interface Mapping:

Create
the interface mapping with the outbound message interface as the source and
abstract message interface as the target and use the XSL as the mapping
program( select the XSLT program imported in IA).

Integration Process:


Create a simple integration process as in the screen shot.




This integration process will receive the output of XSLT mapping and send it to ISU system as IDocs.



!https://weblogs.sdn.sap.com/weblogs/images/40885/IP1.JPG|height=321|alt=image|width=600|src=https://...!



!https://weblogs.sdn.sap.com/weblogs/images/40885/IP2.JPG|height=324|alt=image|width=600|src=https://...!




INTEGRATION DIRECTORY:



Create two communication channels



Sender channel with File adapter



Receiver channel with IDoc adapter





The content conversion parameters have to be defined in the sender
side.



!https://weblogs.sdn.sap.com/weblogs/images/40885/cc1.JPG|height=336|alt=image|width=600|src=https://...!



!https://weblogs.sdn.sap.com/weblogs/images/40885/cc2.JPG|height=275|alt=image|width=600|src=https://...!



Receiver Determination:




There will be two receiver determinations.



1) The output of XSLT mapping is given to Integration process.



2) The output of Integration process is given to ISU system.



!https://weblogs.sdn.sap.com/weblogs/images/40885/RD1.JPG|height=280|alt=image|width=600|src=https://...!



!https://weblogs.sdn.sap.com/weblogs/images/40885/RD2.JPG|height=271|alt=image|width=600|src=https://...!



Interface Determination:



There will be two interface determinations accordingly.



Sender Agreement:



Mention the sender communication channel.



Receiver Agreement:



Mention the receiver channel and the sender service also as in the screen shot.



!https://weblogs.sdn.sap.com/weblogs/images/40885/RA.JPG|height=331|alt=image|width=600|src=https://w...!









Monitoring:




The monitoring can be done in two steps.



In SXMB_MONI give the sender service name and see if the chequered flag has come.



If you get a checked flag, then give the Integration process name as the sender service and check if you get chequered flag for that too.



In the ISU system, go to WE02 and see if the expected number of IDocs has been posted.










Hope this document could give you a better idea about the file to multiple IDoc scenarios using XSLT mapping.

14 Comments