cancel
Showing results for 
Search instead for 
Did you mean: 

useOneAsMany - Example

Former Member
0 Kudos

Hi friends,

Im working with the node function useOneAsMany for the first time using help.sap.com

I think you people had gone through the example below:

http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm

Field Name Occurrence Field Name Occurrence

OrdersByType 1..1 OrdersByRecords 1..1

order 0..unbounded record 0..unbounded

type 1..1 orderType 1..1

itemGroup 1..unbounded itemCategory 1..1

category 1..1 itemName 1..1

name 1..unbounded

Target-Field Mapping (and Explanation)

/OrdersByRecords/record=

/OrdersByType/order/itemGroup/name[context=/OrdersByType]

(a record is to be created in the target structure for each occurrence of name)

/OrdersByRecords/record/orderType=

SplitByValue([type=Each value]

useOneAsMany(

/OrdersByType/order/type ,

/OrdersByType/order/itemGroup/name[context=order] ,

/OrdersByType/order/itemGroup/name))

(see below)

/OrdersByRecords/record/itemCategory=

SplitByValue([type=Each value]

useOneAsMany(

/OrdersByType/order/itemGroup/category ,

/OrdersByType/order/itemGroup/name ,

/OrdersByType/order/itemGroup/name))

My doubt is while mapping the name, what is the meaning of [context:OrdersByType] and [context:Orders].

We have only one name under itemgroup, should we map the same "name" with the target field?

Thanks in Advance

Divya

Edited by: Divya Nancherla on Dec 10, 2008 1:34 PM

Edited by: Divya Nancherla on Dec 10, 2008 1:35 PM

Accepted Solutions (1)

Accepted Solutions (1)

SudhirT
Active Contributor
0 Kudos

Hi Divya,

Note that this is the context we can set by right clicking on the field and selecting Context, there will be a list of all upper level nodes in that Hierarchy (Orders,OrderByType in this case) You just need to select them to change the context of Name field

check the source structure in which OrderByType is on the Top and then comes the Orders .

Hope I am clear.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:OrdersByType xmlns:ns0="http://com.sap/b">

  <order>
    <type>external</type>
    <itemGroup>
      <category>Guitars</category>
      <name>Fender Strat V1</name>
      <name>Ovation Light</name>
    </itemGroup>
    <itemGroup>
      <category>Percussion</category>
      <name>Sticks (Standard)</name>
    </itemGroup>
  </order>

Thanks!

Former Member
0 Kudos

Hi Sudhir,

thanks a lot for the help. done with it.

Thanks all for your help.

Regards,

Divya

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks all for the help.

-Divya

Shabarish_Nair
Active Contributor
0 Kudos
My doubt is while mapping the name, what is the meaning of context:OrdersByType and context:Orders.

It means to keep the context of the field in the context specified. i.e when you right click a field, you can change the context to higher nodes. So as per the help doc, they are asking you to keep/change the context to the specified

Former Member
0 Kudos

Have a look in to this blog:

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

cheers