cancel
Showing results for 
Search instead for 
Did you mean: 

Query about context change

Former Member
0 Kudos

Hi Experts

Getting confused as to how to put the context change in below scenario.

ECC is sending idoc via standard IDOC adapter. The segments and fields are as below

E1EDP01

E1EDP05

KSCHL

KOTXT

BETRG - this is condition value

E1EDP05

KOTXT

BETRG - this is total

Note that for the condition value the field KSCHL is present in the segment while for the total it is not.

I want to put the condition value in target field conval. I want to put the total value in the total.

Mapping rule is : Conval : If KSCHL is CONDI then send BETRG to conval

Mapping rule is: Total : If KSCHL is not present then send BETRG to total

All contexts are set at parent of E1EDP05 segments, E1EDP01

Display queue on KSCHL tells me that only the segments where KSCHL is present are seen and mapping rule is ok for them.

The segment with CONDI comes after segment with no KSCHL field.

Thus value for total is not put correctly since i see CONDI as the KSCHL when the mapping rule for total is considered.

This seems to be a case of idoc segment having optional field, hence the payload does not have corresponding tag, and hence the context values are unequal (3

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

use a mapwith default for KSCHL and in ur condition check if KSCHL is blank then map to toal

former_member214364
Active Contributor
0 Kudos

Hi Gary,

please do mapping as given in the following links.

http://www.flickr.com/photos/14144840@N02/6913266821/in/photostream/

http://www.flickr.com/photos/14144840@N02/6913267037/in/photostream/

if its not working still please give issue details.

Cheers,

Jag

Former Member
0 Kudos

Hi

I did the mapping as suggested with removecontexts - it works only for the first item.

The data has 5 line items - the mapping works without raising the context of KSCHL to parent segment E1EDP05.

Once I raise the context the mapping stops working.

How can I make the mapping work for each line item

Former Member
0 Kudos

Hi Gary,

Can you try this way....

a) E1EDP01-->[root node]

b) E1EDP05>SplitByValue>removeContext-->[parent node of conval & total]

c) KSCHL>exists> AND>removeContext>SplitByValue>If WithOutElse[add BETRG in then]>Conval

KSCHL-->equalS[Contant=CONDI]

d) KSCHL>exists>NOT>AND>removeContext>SplitByValue>If WithOutElse[add BETRG in then]-->Total

Thanks

Ray...