cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Problem ORDERS Idoc to Edifact

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi all,

thanks for your suggestions.

I solved the problem changing different contexts still using my UDF.

Regards

Dominic

Former Member
0 Kudos

Hi,

please mark the question as answered if solved.

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Rinku,

could you please give me some hints how to use your udf?

Regards

Dominic

Former Member
0 Kudos

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--


>udf--


>target field(node)

e1edpt2----


>

if you still face the problm please reply me back.

Thanks

Rinku

Former Member
0 Kudos

please mark the question as answered if solved

Thanks

Rinku

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi AKshay,

it's not that simple. I have to map the field TDLINE to the fields 7008 (from the first PT2) and 7008_2 (from the second PT2). It's not possible to do it only with context changes (at least it's not working for me).

Regards

Dominic

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Sushil,

unfortunately I have to use the graphical mapping. I need a solution for this kind of mapping.

Regards Dominic