Skip to Content
author's profile photo Former Member
Former Member

Mapping: Element in Subnode / not regularly provided

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 25, 2006 at 01:12 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.