cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with mapping [Idoc to EDI]

Former Member
0 Kudos

Hi experts,

i am facing a new problem in my mapping (idoc to edi scenario)

my target is as follow:

InvoiceDME

>Invoice 1..1

>>InvoiceHeader 1..1

>>>IncotermsCode 1..1

My Idoc is as follow:

IDOC

>E1EDK17 0..20

>>QUALF

>>LKOND

>>LKTEXT

There can be 2 scenarios in my source:

1st:

IDOC

>E1EDK17

>>QUALF = 001

>>LKOND = lkond001

>>LKTEXT

2nd:

IDOC

>E1EDK17

>>QUALF = 001

>>LKOND = lkond001

>>LKTEXT

>E1EDK17

>>QUALF = 002

>>LKOND = lkond002

>>LKTEXT = lktext002

If QUALF=002 then I have to take both values of LKOND and LKTEXT and map them to incotermcode

else if qualf=001 alone, then map LKOND to incotermcode

my mapping is as follow:

http://www.flickr.com/photos/30317046@N05/2862446903/

as you can see, the problem is if i am in my second scenario, i get the wrong value in incotercode (lkond001 instead of the concatenate of LKOND and LKTEXT for QUALF = 002)

Do you have any idea how I can solve this??

Thanks a lot,

Regards,

Jamal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Actually i used java mapping:

    //write your code here
 try
{
	String returnString = "";
	for (int i = 0; i < QUALF.length; i++)
	 {
		if (("002".equals(QUALF<i>.trim())))
		{
			returnString = returnString +" "+ LKOND<i> +" "+ LKTEXT<i>;
			result.addValue(returnString);			     
		}
	}
}

catch(Exception e)
{
	e.printStackTrace();
} 

and the condition on the 'count' of QUALF (if = 2 then else)

Thanks,

Regards,

Jamal

Former Member
0 Kudos

i still get the wrong values...

if qualf=001 it will always take its values instead of the 002

any input?

kind regards,

jamal

Former Member
0 Kudos

Hi,

You change the source field context and try. And one more is you have to check the condition at else part because if it is not 002 then else part it executes without checking the condition(it may be 001 or 003 or 005 or....).

Suppose first you got other than 002 then also it takes the wrong value.