cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping: Element in Subnode / not regularly provided

Former Member
0 Kudos

Hello,

I am searching for more understanding about mapping functions. This is what I am astonished about in a scenario I am working on:

Source file has such structure:

Node1

- SubNode2

-SubNode3

- Subnode4

- Elements

(so subnode3 is a subnode of subnode2, 4 is a subnode of 3, elements are in subnode 4)

Target is an IDOC DELFOR02

Per Subnode2 existing one IDOC has to be generated.

Here we are fine!

But: Subnode 3 possible is not provided in the source.

So in DELFOR02 in E1EDP10 in E1EDP16 we have to fill field EDATUV and other fields by that rule:

Subnode3 exists -> use fields from Subnode4-Elements area.

Subnode3 is missing -> fill EDATUV with fct. current date.

So we generate E1EDP16 with a check "if exists" for subnode4:

Yes -> subnode4 mapped to E1EDP16

No -> constant mapped to E1EDP16

EDATUV is mapped like that:

If subnode4 exists map an element from subnode4 to EDATUV else map current date.

The segment under E1EDP16 is provided with a constant.

Then we started a test where we duplicated Subnode2.

Second Subnode 2 has no Subnode3 as described before.

Node1

- SubNode2

-SubNode3

- Subnode4

- Elements

- SubNode2

(not provided)

- SubNode2

-SubNode3

- Subnode4

- Elements

(remember: subnode3 is a subnode of subnode2, 4 is a subnode of 3, elements are in subnode 4)

Result:

3 DELFOR02 are generated (one for each subnode2) -> OK

E1EDP16 is generated in each DELFOR02 under E1EDP10 -> OK

The first E1EDP16 is provided as expected! -> OK

The second w/o subnode3 is generated as expected (so with the current date for EDATUV).

The 3rd E1EDP16 is generated, with one element in it, the segment. The rest is missing.

The queue says that here e.g. the result for EDATUV is suppressed (If I understand that right).

In another test we had 4 subnodes2, where the two ones in the middle had no subnode3.

Again, everything is fine, except the last DELFOR02 which again is missing the entries in the E1EDP16 segment (only segment is generated in E1EDP16).

Made one more test. result is that generated elements in E1EDP16 is always working when we have no subnode3, for source subnode 2 with subnode3 it is only working fine when it is provided first in the source , on all other places in the source the result is that the queue shows "suppress" .

What´s going on there?

Do you have an idea what we are doing wrong?

Best regards

Dirk

Message was edited by: Dirk Meinhard

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Dirk,

That was a long and detailed thread )

Before analyzing your problem, one quick suggestion,

Instead of using EXISTS + IF --> use the node function MAPWITHDEFAULT. It is used exactly for avoiding the complex EXISTS + IF logic.

Regards,

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

thank you for this hint. I had never before a look at this function and will check it now.

But I got the solution right now.

The context of the element providing EDATUV was set to the subnode3 which is not regularly provided. I changed it to subnode2 which always exists.

After that EDATUV is provided as expected in all cases.

Simple but the mapping we have here is so complex that we lost the overview.!

Best regards

Dirk

Answers (0)