cancel
Showing results for 
Search instead for 
Did you mean: 

Message mapping problem

HammerM
Active Participant
0 Kudos

Hi All

I have a message mapping problem that I would like help with please:

I have a list of rows from a JDBC source that I need to map to an IDOC (ORDERS05)

The source file looks like:

HeaderID  LineType  Value

1               HDR            NULL

1               LINE1          NULL
1               LINE2          15

1               LINE3          15

2               HDR            NULL

2               LINE1          NULL

2               LINE2          20

2               LINE3          20

2               LINE2          8

2               LINE3          8

I split each change in HeaderID into a new IDOC by using:

HeaderID -> removeContext -> sort -> SplitByValue (value change) -> collapseContext -> IDOC

So this is giving me 2 separate IDOCS - which is great.

My problem is that I also need to be able to create a node in each IDOC only for each LINE3 that appears

So in the above the IDOC split would be:

1     LINE3     15

2     LINE3     20

       LINE3     8

I've tried various options but cannot work out a way to do this?

If you are able to help a detailed answer would be great.

Thanks in advance

Mark

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Mark,

Use below mapping.

Mapping Test:

Regards,

Praveen.

HammerM
Active Participant
0 Kudos

Hi Praveen

Thank you very much for your answer, it definitely pointed me in the right direction. My scenario was slightly different but your answer really helped.

Thanks again

Mark

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If Line Type = LINE3, then HeaderID -> removeContext -> sort -> SplitByValue (value change) -> collapseContext -> IDOC.

Also, in signature tab, please maintain the occurrence of target service interface as 0..2 or 0..unbounded as per your requirement of number of IDocs.

Thanks,

Souvik

HammerM
Active Participant
0 Kudos

Hi Souvik

I think you may have misunderstood my question.

I already have achieved 1 IDOC per HeaderID change but how do I put its associated number of Value fields.

I hope I am explaining correctly enough.

Thanks again

Mark

nitindeshpande
Active Contributor
0 Kudos

Hi Mark,

Which is your target field, where the Line3 must be mapped?

You can directly map the field by using the below logic -

If Linetype = Line3-> map with default -> Target Field

As IDoc is the main field, this field will be generated only if the IDoc field is generated.

Regards,

Nitin