cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping wisdom

Former Member
0 Kudos

Hi everyone,

I'm looking for some wisdom on this mapping problem;

Source Message

row 0...unbounded

Refidx 0..1

prodid 0..1

date 0..1

field3 0..1

The REFIDX field identify the nature of the record;

- header

- detail

- summary

Therefore on the source xml message I will get a record for the header, a record for the detail and a record for the summary for each materials.

The Target Message is an IDOC

IDOX 0..unbounded

EDI_DC40 1...1

POSDW_-E1POSTR_CREATEMULTIP 0..1

POSDW-EBPTRANSACTION 0..9999999999

POSDW-EBPRETAILLINEITEM 0..9999999999

Base on the source message I want to create only one IDOC (target) and for each details from the source I want to send it to POSDW-EBPRETAILLINEITEM !

I've tried node functions to collapseContexts and to no avail!

Could you please help?

Thank you very much!

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi Shubhankar,

Thank you for your solution! It worked!

<b>ProductId</b> -


>[SplitByValue]-->[RemoveContext]--> <b>IDOC</b> But I'm having a hard time getting consistent occurrences for the underneath segments. I do not have any problems with the target segment POSDW_E1POSTR_CREATEMULTIP 0..1 but the ones beneath this one like this; <b>ProductId</b> -


> [RemoveContext] -
> [SplitByValue] -


> <b>EBPRETAILLINEITEM</b> 0...999999999

Therefore I'm expecting that for each ProductId where the record starts with the PREFIDX = DTL, there should be one occurence of EBPRETAILLINEITEM!

And I'm only getting one occurences when for one productid repeats itself every PREFIDX = DTL!

Do you have any solution on this one???

Former Member
0 Kudos

Hi Raj,

I'm sorry for the sample, Yes the Record3 should be read as follow;

Record3

-


REFIDX:SUM

ProdcutId: ABCD

Date : 2007/04/13

Taxes : 1.00

Total: 50.50

And yes the root node of the source is unbounded!

Former Member
0 Kudos

ProdcutId----


> IDOC (Direct mapping) - this depicts that no of times ProductId occurs those many IDoc nodes will get generated..

for mapping child nodes play around with context . try using split ByValue as per requirement....

Former Member
0 Kudos

Hi Emmanuel,

I was tring the almost the same thing. See the below link.

If your ProdcutId is coming in Sequence then you can use below rule:

ProdcutId [Change Context to higher node]---SplitByValue[Value Changed]---CollapseContext---Idoc

and if you want to populate ProdcutId under some field then use

ProdcutId [Change Context to higher node]---SplitByValue[Value Changed]---SplitByValue[EachValue]----Output_ProdcutId

If your ProdcutId is not coming in sequence then you have to write to UDF to return the unique value.

Please try and give your feedback.

Thanks

Shubhankar

Former Member
0 Kudos

Hi Raj,

I like we people ask questions to get a better understanding on problems!

To anwser you question, YES! You put your finger on the problem!

How would you suggest to map this solution?

justin_santhanam
Active Contributor
0 Kudos

Emmanuel,

Record3

-


REFIDX:SUM

ProdcutId: ABCD

Date : 2007/04/13

ProdcutId: ABCD

Date : 2007/04/13

Taxes : 1.00

Total: 50.50

In the above structure u have ProductID and date more than one time. But your source structure you defined earleier is not unbounded!! It has to be unbounded right?

raj.

Former Member
0 Kudos

Hello Raj,

I want to create as many IDOC as the occurrence of a product ID that includes it's header record, detail record & summary record!

Example

Record1:

-


REFIDX: HDR

ProdcutId: ABCD

Date : 2007/04/13

Record2:

-


REFIDX: DTL

ProdcutId: ABCD

Date : 2007/04/13

quantity : 10

price: 5.00

Record3

-


REFIDX:SUM

ProdcutId: ABCD

Date : 2007/04/13

ProdcutId: ABCD

Date : 2007/04/13

Taxes : 1.00

Total: 50.50

Now I want one IDOC that has Product ID ABCD with it's underline segments!

How would I be able to achieve this?

Thank you in advance for your help!

justin_santhanam
Active Contributor
0 Kudos

Emmanuel,

Please never mind that I'm asking these many questions. So it will be easier for us to suggest the solution.

From the source you can have more than one Product ID right? So each Product ID has its own header , detail and summary. Finally your IDOC must be unbounded based on the source. I mean if I have two Product[Header,detail,Summary] you need to create two IDOC's correct?

raj.

Former Member
0 Kudos

Hi There, as anyone have an answer on the following?

I want to create an IDOC for each occurrence of an product id record.

My source XML is as follow;

Row 0...Unbounded

REFIDX 0...1

ProductId 0..1

date 0..1

quantity 0..1

price 0...1

total 0...1

taxes 0...1

And the target:

IDOC 0..unbounded

EDI_DC40 1...1

POSDW_-E1POSTR_CREATEMULTIP 0..1

POSDW-EBPTRANSACTION 0..9999999999

POSDW-EBPRETAILLINEITEM 0..9999999999

Therefore I'm looking for one occurrence of an IDOC for each productid that are in the records.

I've tried to following to no avail;

ProductId -


> SplitbyValue -


> IDOC

Please I will really appreciate any help on that!

Thank you very much!

justin_santhanam
Active Contributor
0 Kudos

Emmanuel,

Are u going to create as many IDOC's as the occurrence of ProductID. If yes then

ProductID[ remove context]-----> IDOC.

If not please reply back.

raj.

Former Member
0 Kudos

Prabhu, I'm very sorry but I don't understand the concept of IDOC bundeling???

The IDOC is 0...Unbounded and the Source message where I'm trying to do is to get for each ProductID, I want to create one IDOC eventhough that in my source message I'm getting for each product ID at least three records that represents an Header, Detail & Summary.

I've tried the splitbyvalue and to no success!!!

Could you tell me on how would the IDOC bundeling concept play a role in this solution?

Thanks you very much for your indulgence & help!

Former Member
0 Kudos

Hi Prabhu,

Do you mean the following;

REFIDX -


> SplitbyValue -


> IDOC ????

prabhu_s2
Active Contributor
0 Kudos

not exactly this same but playing with context and making use of node f/n's like splitbyvalue will help in mapping ur scenario....and if u wanna to create an idoc for every item then maybe u need to consider idoc bundeling

prabhu_s2
Active Contributor
0 Kudos

did u check by setting the context of Refidx to its parent and using the nodes functions like splitbyvalue etc i hope this could be done