on 08-16-2011 8:02 PM
Hello,
I am trying to map up to 2 segments from an ORDERS IDOC into one segment in my PO XML.
In the target PO XML document both segments UltimateCustomer and ParticipatingDealer are under the heading SalesOrderData.
<Header>
...<SalesOrderData>
.......<UltimateCustomer>
............<Name>
............<address>
....................<street>
....................<city>
......<ParticipatingDealer>
............<Name>
............<address>
....................<street>
....................<city>
So I only create the SalesOrderData segment if at least one of the two E1EDKA1 segments exists where PARVW = ZO or ZU then I want to repliate those segments into their target fields.
ZO - Ultimate Customer
ZU - Participating Dealer
When both values exist I am only getting the data from the first segment (ZO or ZU) but not both. With the following mapping.
If PARVW (IDOC Context) = ZO or PARVW (IDOC Context) = ZU ...CreateIf...SalesOrderData
If PARVW = ZO...CreateIf...UltimateCustomer.
If PARVW = ZU ...CreateIf...ParticipatingDealer.
I tried many context combinations to get both segments to appear but the only time I could get them both to appear is if I force the creation of SalesOrderData. (Constant[]...SalesOrderData). This of course creates a blank node when ZO and ZU do not exist. Which is not a good solution.
Any suggestions?
Thanks,
Matt
Try this-
If PARVW (IDOC Context) = ZO or PARVW (IDOC Context) = ZU ...collapseContexts...SalesOrderData
If PARVW = ZO.then PARVW (without Else.)....UltimateCustomer.
If PARVW = ZU then PARVW (without Else.)......ParticipatingDealer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to both of you!
CollapseContext was the solution here. By using CollapseContext in SalesOrderData I was able to process both sub elements separately from the IDOC context.
It seems to me that any time I change the context to IDOC I should be able to move to that level. But when the higher segment (SalesOrderData) was created with the "ZO" E1EDKA1 segment I was unable to access the "ZU" E1EDKA1 segment for the sub elements.
Thanks again.
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
chk this:
Mapping of "Header":
PARVW(context IDOC)----
--------------------equals ----
Constant(ZO)
-------------------------------------OR-----IfWithoutElse(Constant()----then)--------collapseContext------HEADER
PARVW(context IDOC)----
--------------------equals ----
Constant(ZU)
Mapping of "UltimateCustomer":
PARVW----
--------------------equals ----IfWithoutElse(Constant()----then)-----removecontext---------UltimateCustomer
Constant(ZO)
Mapping of "ParticipatingDealer":
PARVW----
--------------------equals ----IfWithoutElse(Constant()----then)-----removecontext---------ParticipatingDealer
Constant(ZU)
Mapping of "name" under "UltimateCustomer":
PARVW----
---------------equals ----IfWithoutElse(Name(from source)---then)--removecontext----splitbyvalue(each value)--Name
Constant(ZO)
In the same way (like "Name" field mapping) proceed for the rest of the target fields....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.