Skip to Content

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.

image

INTEGRATION REPOSITORY:

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

image

image

image

image

image

image

image

image

image

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).

image

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://weblogs.sdn.sap.com/weblogs/images/40885/IP1.JPG|border=0!

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

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://weblogs.sdn.sap.com/weblogs/images/40885/cc1.JPG|border=0!

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

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://weblogs.sdn.sap.com/weblogs/images/40885/RD1.JPG|border=0!

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

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://weblogs.sdn.sap.com/weblogs/images/40885/RA.JPG|border=0!

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.

To report this post you need to login first.

14 Comments

You must be Logged on to comment or reply to a post.

  1. Hi Anish,
            it was a great blog, at difficult times xlst really comes to rescue and showed a path!
    keep up the great work.
    always,
    Anirban.
    (0) 
  2. Roger Myers
    A while back we implemented Business Connector. We had business requirements and we weren’t ready for XI.

    We wanted to develop our maps in a way that would simplify the porting of the maps from Business Connector to XI when the time came. Our choice was to do the mapping with XSL rather than BC flow logic.

    Your blog shows we made the right choice.

    Thanks

    (0) 
  3. Praveen Sirupa
    Good job !!

    I fail to understand the need for an Integration Process in this scenario. We can have the ISU system as the direct receiver of the message from file system. Can you elaborate on this?

    thx
    praveen

    (0) 
    1. Anish Abraham Post author
      Thanks Praveen!

      The Integration Process is used to send multiple Idocs. You can eliminate IP if you do not have multiple Idocs to be send from the same input file. There are some work arounds to send multiple Idocs without IP also.
      Please let me know if you need any help on this.

      Regards,
      Anish

      (0) 

Leave a Reply