cancel
Showing results for 
Search instead for 
Did you mean: 

mapping problem

Former Member
0 Kudos

Hello

I have an input stream that looks like this:

Order, Description

A FRED

B JIM

C HARRY

D

E

F

And an output stream that is giving me :

Order, Description

A FRED

B JIM

C HARRY

D HARRY

E HARRY

F HARRY

i.e. how do I stop the output values of Description persisting on the records where it should be blank?

(the xml tags for Description on the records for orders D,E and F are empty)

Thanks

Robert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Better to check your test message in test tab. I guess you just duplicated the last field C with a value HARRY and this the reason you are getting this value in rest of the fields.. Check your test data again..

Regards,

Sarvesh

Former Member
0 Kudos

Hello

What I have is on the input side is a record structure of :

MT_SalesOrder 1..1

>SalesOrder 1..unbounded

OrderNumber 1..1

Description 1..1

And the target is actually an ORDERS idoc, and the segment I'm having problems with is E1EDK02 which occurs 0..10

So I have a mapping of

Ordernumber -> removecontext - > splitbyvalue(value changed) -> collapsecontents -> splitbyvalue(each value) - > E1EDK02

..and then I tried :

Description -> BELNR ....and I get my problem, the last description is used on records which don't have one.

The stupid thing is, I can map:

Ordernumber -> concat ->Description -> removecontext - > splitbyvalue(value changed) -> collapsecontents -> splitbyvalue(each value) -> BELNR , and I get what I want, i.e. the description is correct on all the output records (but of course combined with ordernumber)

Regards

Robert

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Robert,

You can use the text function replaceString for this. Refer to the mapping below:

For the node BELNR



Ordernumber --> concat --> removeContext --> splitByValue:value changed --> collapseContext --> replaceString 1.
Description --> /

Ordernumber --> concat --> removeContext --> splitByValue:value changed --> collapseContext --> substring (0..fixed length of OrderNumber) --> replaceString 2. 
Description --> /

Constant: --> replaceString 3.

Then map the output to BELNR. Please take note that for this solution to work, you need to have a fixed length for OrderNumber. This can be remedied by using the formatNumber function.

Hope this helps,

Former Member
0 Kudos

That worked fine, thanks again Mark.

Thanks all others for response as well

Regards

Robert

Answers (4)

Answers (4)

siddhesh_pathak4
Contributor
0 Kudos

hello,

Verify the occurances of your field "Description". it should be 1:1.

former_member184619
Active Contributor
0 Kudos

Hi Robert,

You can use CreateIF standard function for same:

Check this blog:

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

5th option

Sachin

jyothi_anagani
Active Contributor
0 Kudos

Hi,

Can You Just share Your Mapping...............

Because it is very easy if you use simple one to one mapping.........

Thanks.

Former Member
0 Kudos

Hi,

How you have done your mapping. it seems simple 1 to 1 mapping so this problem shouldn't come.