cancel
Showing results for 
Search instead for 
Did you mean: 

Complex Mapping

Former Member
0 Kudos

I have a scenario RFC to Soap. I'm with issues in Message Mapping.

RFC structure:

T_ORDER[] 1..N

T_REG[] 1..N

The relationship between tables is Order Id. For wich T_ORDER.Order_ID I can have lot of T_REG.

Example:

T_ORDER.ORDER_ID = 1

T_ORDER.ORDER_ID = 2

T_REG.ORDER_ID = 1

T_REG.REGCODE = 1

T_REG.ORDER_ID = 1

T_REG.REGCODE = 2

T_REG.ORDER_ID = 2

T_REG.REGCODE = 1

T_REG.ORDER_ID = 2

T_REG.REGCODE = 2

And in my expected Soap Receiver Structure is:

Soap Structure:

- Order 1

- Order ID 1

- REGCODE 1

- REGCODE 2

- Fields

- Order 2

- Order ID 2

- REGCODE 1

- REGCODE 2

- Fields

How can I do this mapping T_REG to the respective Order ID?

Thanks

Maicon.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Mark,

Thanks a lot. You solved my problem.

Now, I am with another issue in the same Interface.

The issue is:

In the RFC structure I have a fields

T_ORDER.ORDER_ID = 1

*T_ORDER.CODETEXT1*

*T_ORDER.TEXT1*

*T_ORDER.CODETEXT2*

*T_ORDER.TEXT2*

*T_ORDER.CODETEXT3*

*T_ORDER.TEXT3.*

An in the Soap Receiver is:

- Order

-- Order ID

-- REGCODE 1

-- REGCODE 2

*-- Texts 0..N*

---Text

--- CodeText

I need to transfer the Field CODETEXT and TEXT to the deep structure in the Soap Structure.

Example:

T_ORDER.ORDER_ID = 1

*T_ORDER.CODETEXT1 = codetext1*

*T_ORDER.TEXT1 = text1*

*T_ORDER.CODETEXT2 = codetext2*

*T_ORDER.TEXT2 = text2*

*T_ORDER.CODETEXT3 = codetext3*

*T_ORDER.TEXT3 = text3*

An in the Soap Receiver is:

- Order

-- Order ID = 1

-- REGCODE 1 = 1

-- REGCODE 2 = 2

-- Texts 0..N

--- Text = text1

--- CodeText = codetext1

-- Texts 0..N

--- Text = text2

--- CodeText = codetext2

-- Texts 0..N

--- Text = text3

--- CodeText = codetext3

Any idea to solve this?

Thanks a lot.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

An in the Soap Receiver is:

- Order

-- Order ID = 1

-- REGCODE 1 = 1

-- REGCODE 2 = 2

-- Texts 0..N

--- Text = text1

--- CodeText = codetext1

-- Texts 0..N

--- Text = text2

--- CodeText = codetext2

-- Texts 0..N

--- Text = text3

--- CodeText = codetext3

In your message mapping screen, right-click on the Texts node and then select duplicate subtree. Do this until you have thee Texts node. And then you can map accordingly e.g for first Texts node, use the values in codetext1 and so on

Hope this helps,

Mark

Former Member
0 Kudos

Mark

Worked now with your suggestion, but I need to do this mapping just when the Fields in RFC are filled.

Like this:

T_ORDER.CODETEXT1 = '1' -


Order.CodeText[1]

T_ORDER.CODETEXT2 = empty -


I can't map the node

T_ORDER.CODETEXT3 = '3' -


Order.CodeText[2]

Any suggestion?

I am trying to use CreateIF or Exists Functions but don't work.

Thanks again.

Maicon

Former Member
0 Kudos

Hi Mark

You answered in another thread:

The solution: FIELD01 -> equalsS: -> not -> createIf -> target

Do you how can I put this code inside UDF? Because a have a lot of fields in RFC in the same situation.

Thanks a lot.

Former Member
0 Kudos

chk whether this helps u or not??

input will be "a"...execution type: all values of a context

this udf will suppress the node when the input is null or empty..

if( (a == null) || (a.length == 0) )

{

result.addSuppress();

}

markangelo_dihiansan
Active Contributor
0 Kudos

The solution given by Amit should work.

Regards,

Mark

Former Member
0 Kudos

Hi,

Please check this example :

[http://help.sap.com/saphelp_nw04/helpdata/en/59/f6ae42e0fac911e10000000a1550b0/content.htm]

Regards,

Beena.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

This mapping is based on the assumption that the ORDERID for TREG is already sorted (as was provided in your example). Otherwise, additional logic should be implemented by using sort and sortByKey.

For Order


ORDER_ID(T_ORDER) -> removeContext -> Order

For REGCODE


                            REGCODE -> removeContext -> formatByExample -> REGCODE
ORDER_ID(T_REG) -> removeContext -> splitByValue:ValueChanged -> /

Hope this helps,

mark