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

Mapping - Create Item level Ship To from Header or Item level on IDOC

Hello,

I am trying to send our SHIP TO fields from the IDOC into the Item level Ship To on our outgoing XML document. In our IDOC the field E1EDKA1 when PARVW = WE this segment relates to SHIP TO. But in some cases the fields are stored on the item level of the IDOC in E1EDPA1 (also where PARVW = WE).

I need to set up my mapping to create the Item level Ship To on my outbound XML for each item. If E1EDPA1 contains the fields I use them, but if not then I need to use E1EDKA1 fields.

My current mapping is not returning the expected results:

                                                             E1EDPA1  (context ITEM)
PARVW (context E1EDPA1)-------------                              |
                                       equalsS  ---------IF----Then-----------------------ShipToLocation
Constant "WE" -----------------------                         Else
                                                                  |
PARVW (context E1EDKA1)-------------                             |          
                                       equalsS--------IF -------Then
Constant "WE" --------------------                                |
                                                                E1EDKA1  (context Document)

Then I repeat this IF for each field required for the ShipToLocation.

Any ideas?

Thanks,

Matt

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2010 at 08:50 PM

    Does the second IF-THEN has queue suppressed when the condition if false ?

    Could you describe more what unexpected result do you get ?

    Regards

    Liang

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2010 at 06:49 PM

    Any other ideas?

    I need to show the header level ShipToLocation if it exists on every line item. But if it does not exists then I need to show the line item ShipToLocation from each line to its corresponding line item on the new document.

    Thanks,

    Matt

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2010 at 09:09 PM

    Hello,

    Thanks for the response.

    The unexpected result is no ShipToLocation node being created.

    The 2nd IF/Then returns:

    IFWithoutElse: In0   IFWithoutElse:Out
     <null>                      <null> (grey)
    <false>                   SUPPRESS  (grey)
    <false>                    SUPPRESS  (grey)
    <false>                    <null>  (white)
    <false>                    <null>  (dark grey)
    <true>                     +blank+   (white)
    <true>                     +blank+    (white)

    Does that help?

    Thanks,

    Matt

    Edited by: Matthew Herbert on Oct 6, 2010 11:11 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 12, 2010 at 07:48 AM

    use node function exists:

    PARVW (context E1EDPA1)-------------                              |
                                           equalsS  ----*exists* ---IF----Then-----------------------ShipToLocation
    Constant "WE"

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2010 at 07:33 PM

    Thanks for the suggestions.

    I have tried using "Exists" without any luck. I will try using RemoveContext and CollapseContext returns the fields from other E1EDKA1 segments even if they do not have PARVW = "WE". So I might get the Fax Number stored in the Buyer Address stored in the Ship To Address for the outbound document.

    This might help clarify the problem. My inbound IDOC may look like either of the following documents:

    Document 1:

    <IDOC>

    <E1EDKA1 SEGMENT="1">

    <PARVW>AG</PARVW>

    ...Buyer Address...

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

    <PARVW>LF</PARVW>

    ...Ship From Location...

    </E1EDKA1>

    <E1EDKA1 SEGMENT="1">

    <PARVW>WE</PARVW>

    ...Ship To Location...

    </E1EDKA1>

    <E1EDP01>(Items)

    </E1EDP01>

    </IDOC>

    Document 2:

    <IDOC>

    <E1EDP01>(items)

    <E1EDPA1>

    <PARVW>LF</PARVW>

    ...Item 1 Ship From Location...

    </E1EDPA1>

    <E1EDPA1>

    <PARVW>WE</PARVW>

    ...Item 1 Ship To Location...

    </E1EDPA1>

    </E1EDP01>

    <E1EDP01>

    <E1EDPA1>

    <PARVW>LF</PARVW>

    ...Item 2 Ship From Location...

    </E1EDPA1>

    <E1EDPA1>

    <PARVW>WE</PARVW>

    ...Item 2 Ship To Location...

    </E1EDPA1>

    </E1EDP01>

    </IDOC>

    As you can see. I need to check for PARVW = "WE" every time whether the address is stored at the header (E1EDKA1) or at the item (E1EDPA1) level. And then if it is at the item level, I need to be sure that Item 1 has its corresponding Ship To Address.

    Does that help?

    Thanks,

    Matt

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2010 at 08:00 PM

    Thanks for all the suggestions.

    Here's what I learned.

    The equalsS mapping tool does not throw a "false" if the field does not eist. It gives a <null> which then causes the IF to fail. So I need to check to see if the field exists before I can check to see if PARVW equalsS WE.

    I also needed a useOneAsMany to replicate the Header Address fields for each line item.

    Then I had to create a UDF to determine whether or not to create the "Communication" node for Phone, Fax and Email because this node does not exist every time the Address node is created.

    Altogether a complicated mapping for a rather simple concept.

    Thanks to all.

    Matt

    Add a comment
    10|10000 characters needed characters exceeded

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.