cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter Mapping

Former Member
0 Kudos

Hi,

I have a problem in the file-idoc scenario. The input file is a text file.

During testing of the mapping, direct filling of the values in the fields provided, i dont have any issues.

During execution of the file, the file is read and it is also deleted. So the file adapter seems to be working fine. But I am getting some problem in the message mapping. Following is the error:

"Cannot produce target element /ZMREPT02. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd"

I saved the xml file that is available in the payload of the runtime monitor. Following is the same:

<?xml version="1.0" encoding="utf-8" ?>

- <ns:Employee_Monthly_OB_09 xmlns:ns="urn:yash-com:training:09">

- <ns:MonthlyDet xmlns:ns="urn:yash-com:training:09">

- <Z1EMHDR>

<SSN>1290</SSN>

<LNAME>suraj</LNAME>

<FNAME>kumar</FNAME>

<DOB>09-07-1974</DOB>

</Z1EMHDR>

- <Z1WKDET>

<WEEKNO>1</WEEKNO>

<TOTHOURS>40</TOTHOURS>

<HRLYRATE>25</HRLYRATE>

</Z1WKDET>

- <Z1CLDET>

<CLSITE>yash</CLSITE>

<WORKDESC>developer</WORKDESC>

</Z1CLDET>

- <Z1SUMRY>

<TOTHOURS>40</TOTHOURS>

<TOTAMOUNT>25</TOTAMOUNT>

</Z1SUMRY>

</ns:MonthlyDet>

</ns:Employee_Monthly_OB_09>

Following is the xml file generated in the test mapping, when values are filled directly in the fields:

<?xml version="1.0" encoding="UTF-8" ?>

- <ns:Employee_Monthly_OB_MT_09 xmlns:ns="urn:yash-com:training:09">

- <MonthlyDet>

<Z1EMHDR SSN="1290" LNAME="Suraj" FNAME="Kumar" DOB="" />

<Z1WKDET WEEKNO="1" TOTHOURS="40" HRLYRATE="26" />

<Z1CLDET CLSITE="yash" WORKDESC="developer" />

<Z1SUMRY TOTHOURS="40" TOTAMOUNT="25" />

</MonthlyDet>

</ns:Employee_Monthly_OB_MT_09>

Could anyone please let me know the problem?

Thanks in anticipation.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

have a look at my weblog on how to test your mapping:

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

then you'll be able to correct the mapping

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Former Member
0 Kudos

Michal,

I tried the same thing and am getting the error mentioned above.

My question was when i am filling the values directly i dont have any problems. But when the xml file from the payload, i am getting the above mentioned error.

Could you please let me know if I am missing anything.

MichalKrawczyk
Active Contributor
0 Kudos

yes,

this means that the two xml are not the same

just check if these xmls are the same in the source view

and compare cause for sure there're not the same:)

Regards,

michal

Former Member
0 Kudos

Thanks for your immediate response.

I have pasted both xml files in my first message. As per my observation, both of them seems to be the same. Could you please let me know if you could find any difference?

Former Member
0 Kudos

Hi,

<i>"Cannot produce target element /ZMREPT02. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd"

</i>

But in your xml i donot see this <b>/ZMREPT02</b>, is that a segment??, also your file is getting deleted, but have you checked the content conversion, if it is correct at runtime, from moni??

Regards,

Anirban.

MichalKrawczyk
Active Contributor
0 Kudos

open then in a notepad and compare:)

don't know any other ways

or just start debugging your message mapping with the

real xml

Regards,

michal

Former Member
0 Kudos

Hi Anirban,

ZMREPT02 is the idoc type and the others mentioned in the xml file are its segments.

From the payload xml, i could understand that File conversion is taking place correctly.

Former Member
0 Kudos

Hi,

Thanks for the reply,hard code the <b>BEGIN</b> Field with a constant as 1 in message mapping, it will work then,the begin field will be after each segment in the idoc.

and see if you have mapped all mandatory fields and no fields are in red.

Regards,

Anirban.

Former Member
0 Kudos

I was missing this one earlier. Even after hard coding the BEGIN field and other mandatory fields, I am still facing with the same error.

Former Member
0 Kudos

Hi,

Some more pointers, almost every common mistakes have been discussed but still you may try these,

1. open your source xml file in a browser and see if its wellformed.

2. open message type, goto edit mode, just below data type used you see a field xml namespace, remove that, save and activate, retest.

3. check the namespace in each object of configuration and see the receiver determination, if correct mapping is called.

Regards,

Anirban.

Former Member
0 Kudos

Problem Solved. Thanks Anirban for your valuable answers.

Former Member
0 Kudos

Bingo Nikhil, thats great and it was a pleasure interacting with you.

Regards,

Anirban.

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi Nikhil,

I think the XML posted by you were for the source side...

In the following XML (available in payload of the runtime monitor)

<?xml version="1.0" encoding="utf-8" ?>

- <ns:Employee_Monthly_OB_09 xmlns:ns="urn:yash-com:training:09">

- <ns:MonthlyDet xmlns:ns="urn:yash-com:training:09">

- <Z1EMHDR>

<SSN>1290</SSN>

<LNAME>suraj</LNAME>

<FNAME>kumar</FNAME>

<DOB>09-07-1974</DOB>

</Z1EMHDR>

- <Z1WKDET>

<WEEKNO>1</WEEKNO>

<TOTHOURS>40</TOTHOURS>

<HRLYRATE>25</HRLYRATE>

</Z1WKDET>

- <Z1CLDET>

<CLSITE>yash</CLSITE>

<WORKDESC>developer</WORKDESC>

</Z1CLDET>

- <Z1SUMRY>

<TOTHOURS>40</TOTHOURS>

<TOTAMOUNT>25</TOTAMOUNT>

</Z1SUMRY>

</ns:MonthlyDet>

</ns:Employee_Monthly_OB_09>

Each <SSN>, <LNAME>, etc are <b>sub elements</b> of <Z1EMHDR>

But in this XML where values were filled directly in the fields

<?xml version="1.0" encoding="UTF-8" ?>

- <ns:Employee_Monthly_OB_MT_09 xmlns:ns="urn:yash-com:training:09">

- <MonthlyDet>

<Z1EMHDR SSN="1290" LNAME="Suraj" FNAME="Kumar" DOB="" />

<Z1WKDET WEEKNO="1" TOTHOURS="40" HRLYRATE="26" />

<Z1CLDET CLSITE="yash" WORKDESC="developer" />

<Z1SUMRY TOTHOURS="40" TOTAMOUNT="25" />

</MonthlyDet>

</ns:Employee_Monthly_OB_MT_09>

They are all <b>attributes</b>....

Can you specify your source DT.

Regards

Suraj

Message was edited by: S.R. Suraj