cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with context on an WMMBID02 idoc

Former Member
0 Kudos

Hello

I am mapping a flat file of PO receipts to a WMMBID02 idoc

The input file consists of

PO, GRN, Item, Qty, and the data looks something like this:

A1, B1, Fred, 1

A1, B1, Harry, 1

A2, B2, Fred, 1

A2, B2, Harry,1

So, with data like that I want to create 2 idocs , one for each PO/GRN , and each with 2 E1MXBYI segments for the items. This is my problem. I am getting the 2 idocs, but I'm only getting one E1MXBYI segment created for the first product within each PO/GRN

E1MXBYI occurs 1..9999 and is a segment below E1MXBYH which occurs 1..1 The data in E1MXBYH is good.

I have tried various combinations of mapping, playing with context and value changes, but I can't get it to work, even though when I display the queue, everything looks o.k.

(I did get all the item lines appearing against the first idoc when I simply did item>removecontext>E1MXBYI , but when I try to re-introduce any kind of context changing into the mapping , it reverts to a single segment again)

Regards

Robert

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Did you mapped your occurence of items to E1MBXY segment so that E1MBXY occurs as many as items

Rajesh

Former Member
0 Kudos

Hello

I just have E1MXBYI mapped to the item

Just to clarify, the input file looks like this

PO_RECEIPT 1..unbounded

PO 1..1

GRN 1..1

Item 1..1

Qty 1..1

I have the E1MXBYH mapped to a change in context in a combination of PO/GRN

PO >

GRN > concat > removecontext > splitbyvalue(valuechange) > collapse > splitbyvalue(each value) > E1MXBYH

..and then I've tried lots of variations to map to E1MXBYI

item > E1MXBYI

PO >

GRN > concat >

ITEM > concat > removecontext > splitbyvalue(valuechange) > collapse > splitbyvalue(each value) > E1MXBYI

and others. The queue looks good, but I only seem to get one segment.

Regards

Robert

former_member181962
Active Contributor
0 Kudos

Try with a UDF.(Chose queue radio button)

inputs PO, GRN, ITEM

pseudo logic.

for(int i =0;i<PO.length;i++)

{

if( lastpo != PO<i> and lastgrn != GRN<i> )

result.addValue("");

lastpo = PO<i>.

lastgrn = GRN<i>

}

Regards,

Ravi

Former Member
0 Kudos

hello Ravi

Thanks for the reply. I tried this and again I get the right contexts in the queue as I did with my previous attempts, but for some reason I'm still only getting one output segment on my idoc

.

It must be the structure of parent segments that's stopping it from working

Regards

Robert

Former Member
0 Kudos

managed to get context right