on 10-08-2007 10:52 AM
Hi,
I have a mapping problem with the IDOC ORDERS:
I get the IDOC with several E1EDP01. Each E1EDP01 has several E1EDPT1, where i want only the first one (which I get over the TDID value). Each E1EDPT1 has min. 1 E1EDPT2.
Now I have to map each field TDLINE from first two E1EDPT2 of the first E1EDPT1 to the Edifact fields /LIST/S_UNB/S_UNH/G_SSG25/S_LIN/S_IMD[1]/C_C273/D_7008 (from the first E1EDPT2) and, if a second E1EDPT2 exists in /LIST/S_UNB/S_UNH/G_SSG25/S_LIN/S_IMD[1]/C_C273/D_7008_2.
I use following UDF:
//a = TDLINE
//b = Number of entry in the List
int pos =Integer.parseInt(b[0]);
if ( pos < a.length )
result.addValue(a[pos]);
else
result.addValue(ResultList.SUPPRESS);
Unfortunatly, I think becaus of the context problems (not every E1EDPT1 has two E1EDPT2), it's not working. Could somebody help me with this problem?
Thanks in advance
Dominic
Dear Dominic ,
I had same problem when I was trying to do the same thing for FTX segment.
Your UDF is fine but you don't need else condition.
//a = TDLINE
//b = Number of entry in the List
int pos =Integer.parseInt(b[0]);
if ( pos < a.length )
result.addValue(a[pos]);
for C_C273 assigned contant value and
D_7008 assigned TDLINE but change the context to E1EDPT1
and for D_7008_2
TDLINE(context to E1EDPT1 )
====>UDF====>D_7008_2
Contant(=1)
It should work becasue my map is working fine. If not let me know error message.
Thanks
Shubhankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shubhankar,
thanks for the information. my mapping already looks like you described it (except of the else condition in the udf).
But due to the data I get from the Idoc, the result isn't what it should be. The Idoc contains also several E1EDPT1/E1EDPT2 which are uninteresting but also in the context. I'm not able topick the right data out of the context. That's my problem...
Did you try your mapping under this conditions? How to you create the S_IMD?
Dominic
Hi
you can use the fiollowing UDF it will take only the first occurence in each UNH.
int flag = 0;
for(int i=0; i<unh.length;i++)
{
flag = 0;
for(int j=0;j<sg25.length;j++)
{
if(flag == 1)
break;
for(int k=0;k<qty.length;k++)
{
if(qty[k].equals("21"))
{
result.addValue("");
flag =1;
break;
}
}
}
}
Thanks
Rinku
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
according to your requirement yuo want to process only the first occurence for E1EDP01.
the udf has three inputs
1.First will be E1EDP01
2. second will be your E1EDPT1
3.Third will be the E1EDPT2
e1edp01----
>
e1edpt1--
>target field(node)
e1edpt2----
>
if you still face the problm please reply me back.
Thanks
Rinku
Hi Rinku.
as I wrote, getting E1EDP01 is no problem, I get it over TDID 8usually it's the first).
My problem is to map TDLINE in the fields 7008 (TDLINE from the first E1EDPT2) and 7008_2 (TDLINE from the second E1EDPT2). It's not possible to do this with contexts. I can not create the target field/node depending on the occ. of E1EDPT2 due to the edifact structure (ORDERS D93A). And not every E1EDPT has two E1EDPT2...!!??!!
Any other idea?
Dominic
Hi,
If you want to take only first E1EDPT1 then no problem...you can do normal mapping....whatever occurances E1EDPT! may have you will always get first occurance only.Just keep context on UNH.
Same with E1EDPT2...map them directly to target nodes.
Regards,
AKshay.
Reward points if find useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi dominic,
You can easily achieve this using XSLT mapping,
bcoz you can explicitly mention the instance of the source that you want ,.,,,of the source node....
Regards,
Sushil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
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.