cancel
Showing results for 
Search instead for 
Did you mean: 

File to multiple idoc scenarios depending on finput field value

Former Member
0 Kudos

Hi,

i have a file to idoc scenario.

depending on a particular field of the file i have to trigger a single idoc (with all the records in the file)or multiple idocs (for each record in the file ).

for example,

the file has 5 records-

2 records have field value A (create 1 idoc for all As)

3 records have field value B (create 1 idoc for each B)

so in this case 4 idocs (1 for all A, and 3x1 for B) are created

What is the best solution ?-

1. to have several outbound idoc interfaces and check each interface mapping for field value (A or B) ?

this solution seems like overwork to me

2. handle this in mapping ?

in that case will UDF be better or ABAP mapping

3. any other way ?

Thanks in advance

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

ABAP mapping is better .

And also you have to use IDoc bundling.

So see the below links

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping - File to Multiple IDocs

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change - IDOC bundling

abap mapping - /people/alessandro.guarneri/blog/2006/03/05/managing-bulky-flat-messages-with-sap-xi-tunneling-once-again--updated

Regards

Chilla

Former Member
0 Kudos

Use 1:N mapping.

create those IDOCS using creatif or UDF function .

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

but if he has one field (on which he knows if one or more)

then it will be a nightmare to use createif for EVERY IDOC tag...

don't you think ?

I'd go for java or abap mapping (which is more suitable for him)

Regards,

michal

Former Member
0 Kudos

ok got it.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you have one IDOC type you can use ABAP mapping

this way you will handle everything in tables

and you will be able to post one IDOC (bundled)

with all IDOCs inside

also if you use ABAP mapping you will be able to incorporate changes

easily in the future I believe

for idoc bundling:

<a href="/people/michal.krawczyk2/blog/2006/10/11/xi-new-book-mastering-idoc-business-scenarios-with-sap-xi"><b>Mastering IDoc Business Scenarios with SAP XI</b></a>

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michael,

thanks for ur answer- any such example of ABAP mapping that is used for this scenario ?

thanks

MichalKrawczyk
Active Contributor
Former Member
0 Kudos

you need 2 message mappings and 2 interface mappings...

the first for a is as normal

and the message mapping for b is 1 to n mapping.

What you do is in the inbound idoc you need to change the IDOC root from occurence 1 to unbounded. Normally this is not possible with IDOCs but you can dpo it by exporting the XSD to a notepad file changing the occurence from 1 to unbounded in the XSD then re import it....

Then you make your mapping so 1 Idoc is created every time a new record is there,,,