cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Mapping-Programm (1:n)

0 Kudos

Hi,

I have to make a 1:n Mapping with the graphical mapping editor. The situation is as follows:

I have 1 ORDER with n positions and I have to convert this order to n ORDERS with 1 position in each order. My problem is, that I have to use the header-data of the input-order for each of the output orders and I have to use the first position of the input-order for the frist output-order the second postition for the second order and so on. Which mapping-steps do I have to use. I think this is an ordnary problem, but I could not find anything in the XI-help about this. Maybe anyon has got an idea. THANKS !!!

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Thanks to all of you, but I fear, that my question did not come out clear enough: I have already created a mapping-programm, which allows me to map from a message with 1 IDOC to a message with n IDOC's, and the next-but-one-step to integrate the interface-mapping into the business-process comes later. Now I'm fighting with the mapping-programm, because I have to use the header-data (e.g. E1EDK01), which is only 1 time in the source-message n times (for each position in the source-message) in the target messages. (E.g. Source: 1 ORDER with 3 POSITIONS - Target: 3 ORDERS with each 1 POSITION. I thought, that the function UseOneAsMany is suitable here, but I got great troubles with Queues and Contexts...But I keep on trying

Former Member
0 Kudos

Hi Werner

Main Constraint in UseAsManyFunction, it has three inputs:

1 st input: header data field

2nd input is position

3rd input is position

Note: Context of 1st and 2nd input should be same.

then use split by value for mapping into three different oder.

And check display queue.

If its okay then check mapping.

And for further proessing just refer my weblog:

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Cheers.

Piyush

Answers (9)

Answers (9)

Former Member
0 Kudos

Hello Werner,

I could not reproduce this behavior. In our system (SP14), the <i>collapseContexts</i> function always produces empty values for contexts with missing fields, independent of the place of the context where the field is missing.

What SP are you working with?

Best regards

Joachim

Former Member
0 Kudos

Hello Werner,

If the number of the E1EDK14 segments is always exactly 4 per IDOC, you may use the duplicate subtree functionality. Therefore you have to place your mouse-pointer on the E1EDK14 segment in your target structure and right-click un your mouse. You'll get a context menu, where you can select duplicate subtree. After having done this three times, you can define the mappings for the 4 E1EDK14 segments independently.

The <i>useOneAsMany</i> function should work also. But you have to make sure that the queue of the first and the second input field contain the same number of <b>contexts</b>, whereas the second and the third input field have to contain the same number of <b>values</b>.

Please check the figure on http://help.sap.com/saphelp_nw04s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm

for details.

Best regards

Joachim

0 Kudos

Hi Joachim,

I think I solved the problem now, but I had to make 2 userdefined java-functions wich build my context-changes and I had to use the built-in function "CollapseContexts" But in this function, I think I had found and error:

If you have a queue with 3 context-changes and no value in the last context, the "CollapseContexts"-function returns only 2 instead of 3 Values. If the empty context is in the first or second context the function workes well. Did you also expect this problem ? - thx!!!

Former Member
0 Kudos

Hello Werner,

If your header field is really only once in the source-message, you can also use the <i>copyValue</i> function. It works like the constant function but uses the input value to produce as many fields as required (by the cardinality of the target field).

The <i>UseOneAsMany</i> function is used to copy multiple headers of the source message to the correct context on the target side.

Best regards

Joachim

0 Kudos

Hi Joachim,

thanks a lot. The first part of my problem is solved. The copyValue was enough. But now I'm facing the next (I hope the last problem:

E1EDK14-Segment is in the context of IDOC and can appear 0-12 times. In my case I have 4 E1EDK14-Segments and 3 E1EDP01 segments in my source-message. That means I get 3 target-messages. For each of these I need the 4 E1EDK14-segments. And now I really don't now how to solve this. I can't get it going with the "UseOneAsMany". I always get the error: "Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ]" Have you got any Idea ? - Thanks a lot !!!

Former Member
0 Kudos

hey the following blogs are helpful too.i just came accross them n thought of sending them to u..it for a beginer..

Check them out

/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

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

Former Member
0 Kudos

hey the following blogs are helpful too.i just came accross them n thought of sending them to u..it for a beginer..

Check them out

/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

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

former_member91687
Active Contributor
0 Kudos

Hi Werner,

Take a look at these links:

http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/42/f3ca2529491bc7e10000000a11466f/frameset.htm

It gives a very good explantion on multi mappings which you can follow to suit your requirements, and dont forget to reward points for helpful answers.

Cheers,

Chandra

Former Member
0 Kudos

the best mapping technique is to use ABAp XSLT mapping for the scenario u just explained..

the following links may be helpful..

/people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping

Former Member
0 Kudos

there is no such thing like "best mapping technique". personally i believe that the above situation is standard and can be easily achieved using message mapping. No need for XSLT or even ABAP XSLT here...

I'm not sure, but if ORDERS refers to the according IDoc, the easiest way for this scenario is described in the following weblog: https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2762. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

best regards

Christine

Former Member
0 Kudos

Hi,

To help you more am sending these links.

this is a thread similar to your question:

this link might also help.

http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/content.htm

regards,

P.Venkataramanan

Former Member
0 Kudos

check & see if these weblogs would help...

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

/people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure

hope you already searched on SDN....if not try searching and you will find many more links...

Thanks,

Renjith