cancel
Showing results for 
Search instead for 
Did you mean: 

Different IDOCs

Former Member
0 Kudos

Hi All,

I am getting a file from Legacy. I want to send this to SAP. So I have imported my IDOC into XI. Now in my IDOC I have three segements. In the second segment I have three fields. This three fields are mapped from File. Now if any one of the fields in this three changes then I have to post it is a new IDOC. Can anybody tell me how to proceed for this?

korobee

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Korobee,

If I understand this correctly you want to create multiple IDocs of the same type when the file contains different values in a specific field.

First of all you need to enable the mapping of multiple IDocs in you message. In order to do so, get the dtd/xsd for the IDoc (from transactio we60 in SAP R/3 or http://ifr.sap.com) and change the maxoccurs attribute of the IDOC node to unbounded. Import this dtd/xsd in the Repository and use this in the message mapping. Leave the interface mapping as it is. Note that the IDoc adapter does support multiple IDOC segments, it's just the imported IDoc that doesn't show it.

In your message mapping you can now create multiple IDocs by mapping the IDOC node as follows, where ff1 is the field from the flat file with the changing value:

ff1 (Context 'root') -> SplitByValue (On Changed value) -> CollapseContext -> IDOC.

Hope this helps,

Koen

Former Member
0 Kudos

Hi,

What exactly do you mean by "changes"? As in, will you be checking it with a value that has been sent by the earlier file?? Or with some constant...?

Regards,

Sushumna

Former Member
0 Kudos

Hi

Within one file there might be different values. So if the value changes then I have to post it to a different Idoc and if the value dont change then i have to post in the same idoc.

korobee

moorthy
Active Contributor
0 Kudos

Hi,

Do you have different types of Idocs in target side ? i.e mutliple Idoc types ?

How are you going to identfy the idoc types ? Based on one field or based on the pattern which you get in your file ..

Anyway I suggest/prefer , to go with Java Mapping here. because first of you need to group all the idocs of same type.

Once it is done, you need to split it into different idoc types..

Hope this helps,

regards,

Moorthy

Former Member
0 Kudos

Korobee,

With what <b>reference value</b> are u planning to check if the value has changed or not??

Regards,

Sushumna

Former Member
0 Kudos

Hi Korobee,

I think you want to use two IDocs, i.e. there will be two target structures. In that case, the mapping program will contain one source structure & two target(IDoc) structure.

Another option is using two different interfaces.

If you are getting multiple records in file, then you need to use IDoc bundling.

Regards

Akshay

P.S. Reward points for helpful answers

Former Member
0 Kudos

Krishna

I dont have different IDOC types. I have only one IDOC type. How can I proceed for this krishna?

Korobee

Former Member
0 Kudos

Hi Korobee,

There is another question posted by you-"File-XI-IDoc" with exactly the same question. Based on the response you have given there, looks like you want to classify IDocs as valid/invalid based on one particular field that you are getting from the source IDoc. Which means you already have a constant value with you and you check in your incoming IDoc if one particular field has it, and if it doesnt, you will have to post it as a separate IDoc else you will be sending the source IDoc as it is-Confirm if my inference is correct!

Assuming this is the scenario, and if the validation is as simple and straight forward as I assumed it to be, you can as well do this check either using the adapter module processor or the "enhanced" interface determination. You can also do the check in the mapping editor, but then you will have to probably use a bpm to direct the target messages to the correct receivers.

Regards,

Sushumna

Message was edited by: Sushumna Parupalli