on 01-04-2006 11:00 PM
Hi,
Can anyone help me with the following mapping issue?
I am only giving the segments concerning the issue.
Input
<E1EDP01>
<E1EDP19>
<QUALF> 002 </QUALF>
<IDTNR> 111 </IDTNR>
</E1EDP19>
<E1EDP19>
<QUALF> 001</QUALF>
<KTEXT> XXX </KTEXT>
</E1EDP19>
</E1EDP01>
<E1EDP01>
<E1EDP19>
<QUALF> 002 </QUALF>
<IDTNR> 222 </IDTNR>
</E1EDP19>
<E1EDP19>
<QUALF> 001</QUALF>
<KTEXT> YYY </KTEXT>
</E1EDP19>
</E1EDP01>
Output
<ItemDetail 0..unbounded>
<PartNumbers 0...1>
<SellerPartNumber 0...1>
<Part ID 1..1/>
</sellerPartNumber>
</PartNumbers
<ItemDescription 0..1/>
</ItemDetail>
This is the mapping I did.
E1EDP01 ==> ItemDetial
If QUALF=002[Context=E1EDP01] then E1EDP19[Context=E1EDP01]=SellerPartNumber
If QUALF=002[Context=E1EDP01] then IDTNR[Context=E1EDP01] = PartID
If QUALF=001[Context=E1EDP01] then KTEXT[Context=E1EDP01] = ItemDescription
But the problem is it is missing some occurances.I have 3 items in my input, but I am getting only two in the output.The second occurance is completely missed and the third shows as the second. I tried different techniques like changing the contexts in different combinations.The solution may be fairly simple,but obviously I miss something here.
Any help is appreciated.
Thanks
Raju
Hi raju
Its obvious that you will get two items only.
as your E1EDP01 occurs twice.
For every ocurence it will map its first item to the output side.
I would say go for user defined funtion which will check how many items are there and output of user defined function will contol of item detail.
I hope you will get all three items right now.
Regards
Piyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your responses.
Stefan, I tried your suggestion, didn't work.
Piyush,I am afraid you didn't get my point, I am using the higher context for QUALF,so that I will get both 002 and 001 QUALF per one E1EDP01. But I appreciate your suggestion to use user defined function and will try it.
Thank you
Raju
Hi Raju,
now I have updated my proposal.
The problem is easier as it looks first. But you have to be sure, that in each E1EDP01 segment there is just one IDTNR and one KTEXT.
But always remember:
When you have a 1:1 occurancy, you should never apply conditions to it. This leads to errors.
It is sufficiant, that there is a condition on the parent node.
Regards
Stefan
Stefan,
That is exactly what I did. Strange as it may look, it didn't work.Remember, I can't map "constant" to Seller Part Number but only when QUALF=002.
it is Buyer Part number if it's QUALF=001.
So, only if it's 002 I need to create Seller Part Number, that is why I did
If QUALF=002 then E1EDP19=Seller PartNumber and then IDTNR=PartID...and so on.
You are right, I can't place conditions for 1..1, but that is least of my problems now and it was not cribbing because I was always getting a 002.I corrected that.
What I suspect is there is no higher node for Description to map E1EDP19 as I did for Seller Partnumber(which is the higer node for PartID), so I am not able to bring it to the next context of E1EDP19....but I may be wrong.(Seller Part number and description are at the same level)
Appreciate your response.
My mapping proposal worked for the data you provided. If your source is different, you should provide it for me.
Maybe that helps:
QUALF=002[Context=E1EDP01] createIf -> SellerPartNumber
IDTNR[Context=E1EDP<b>19</b>] -> PartID
If QUALF=001[Context=E1EDP01] then KTEXT[Context=E1EDP01] = ItemDescription
That worked for me as well.
Regards
Stefan
Pls check this map & see if it helps...
E1EDp01 -- ItemDetail
E1EDp01-- splitbyvalue -- Partnumbers
qualf(P01) =002
\
if -- splitbyvalue -- sellerpartnumber
/
qualf(P01)
qualf(P01) =002
\
if -- splitbyvalue -- Part ID
/
IDTNR(P01)
qualf(P01) =001
\
if -- splitbyvalue -- Item Description
/
KTEXT(P01)
Thanks,
Renjith
hi Raju,
is this the output you want??
<ItemDetail>
<PartNumbers>
<SellerPartNumber>
<PARTID>111</PARTID>
</SellerPartNumber>
</PartNumbers>
<ItemDescription>xxx</ItemDescription>
</ItemDetail>
<ItemDetail>
<PartNumbers>
<SellerPartNumber>
<PARTID>222</PARTID>
</SellerPartNumber>
</PartNumbers>
<ItemDescription>yyy</ItemDescription>
</ItemDetail>
else just let me know what is your required out.
regards,
Jesse
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jesse,
Yes, that is the exact output I need, in a simplified scenario(assuming I am dealing only with QUALF=002 for Partnumber, and QUALF=001 for description)This will become more complex if I get a buyer part number also, but for now, this is the output I needed.
thank you and appreciate any insight on this.
Raju
The occurancy of Part_id is 1..1, so you must not have a condition here.
Just do:
IDTNR[Context=E1EDP01] - PartID
KTEXT[Context=E1EDP01] - ItemDescription
E1EDP01 - ItemDetail
Constant() - PartNumbers
Constant() - SellerPartNumber
Regards
Stefan
Message was edited by: Stefan Grube
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.