cancel
Showing results for 
Search instead for 
Did you mean: 

FILE_to_RFC (Premature end of file)

Former Member
0 Kudos

Hello,

I'm trying to setup a FILE_to_RFC connection.

Let me explain what I want to do .

External systems sends files which should linked to SAP documents that users can later see with FB03.

This can be done by function module ARCHIV_CREATE_SYNCHRON_META or similar, but only this is remote-enabled.

Here an example:

External system sends for e.g. 3 files. All files are located in file-system.

1. file : file-aaa.pdf

2. file: file-bbb-pdf

3. file: upload.txt

Content of third file:

company-code, SAP-document number, year, file-name

0400..................6800004711...................2008..file-aaa.pdf

0400.................48000004712..................2009, file-bbb.pdf

FILE-Sender-channel is polling for the file "upload.txt". This file will convert from text to XM by Adapter, so far ok. .

RFC-Receiver-channel so far ok. Using imported RFC function module

Test Message-Mappng : OK ( MT_INVOICES --> ARCHIV_CREATE_SYNCHRON_META )

Test.Operation-Maping: OK

But the process failed with following errors: , File "upload.txt" has been archived but no other activities.

==============================================================================

SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~</SAP:P1>

<SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2>

<SAP:P3>on: Cannot create target element /ns1:ARCHIV_CREAT</SAP:P3>

<SAP:P4>E_SYNCHRON_META/AR_OBJECT. Values missing in queu~</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns1:ARCHIV_CREATE_SYNCHRON_META/AR_OBJECT. Values missing in queu</SAP:Stack>

Test-Result of configuration in the Integration Builder:

======================================

Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Premature end of file.

Maybe somebody can help here ?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184681
Active Contributor
0 Kudos

Hi Reinhard,

Certainly you have an error in your message mapping, see here:

Cannot create target element /ns1:ARCHIV_CREATE_SYNCHRON_META/AR_OBJECT. Values missing in queue

Review your message mapping: check the source field for this AR_OBJECT target field and make sure it is not empty in the test file. Or make the AR_OBJECT field optional, if it is supposed to have no value in some cases and your input file is correct.

Hope this helps,

Greg

Former Member
0 Kudos

Hello Baskar, Asshish and Greg,

I uploaded the XML from XMB-Moni into maping test.

All structure elements are on RED.

After start test I got the same error messge.

If I disable one element in the target structue the next active element will report an error.

What I found :

After click on "Clean up" in test the structure is GREEN and the maping test successful.

Further, if I change the mapping by deletion of all socurce fields and keep only some text-constans, mapping works.

It's al littel strange for me.

Regards, Reinhard

Former Member
0 Kudos

as the status is RED when u paste the paylod, now compare this payload with ur test payload that u wud have used while crfeating the message mapping. namespace could be different or some mandatory elemnets cud be missing the source payload

Former Member
0 Kudos

The payload is following: I imported this into the test area.

-


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

<MT_INVOICES>

<Recordset>

<ROW>

<TEXT1>EFLOW</TEXT1>

<TEXT2>FI_DOCUMENTS</TEXT2>

<SAP_DOCUMENT>4300005878</SAP_DOCUMENT>

<COMPANY_CODE>0401</COMPANY_CODE>

<YEAR>2005</YEAR>

<FILE_NAME>file-1.gif</FILE_NAME>

<FILE_TYPE>GIF</FILE_TYPE>

</ROW>

</Recordset>

</MT_INVOICES>

Below the XSD schema of the data type

-


<xsd:complexType name="DT_INVOICES">

<xsd:annotation>

<xsd:documentation xml:lang="EN">

Scanned invoices of eflow system

</xsd:documentation>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Recordset">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="ROW" maxOccurs="unbounded">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="TEXT1" type="xsd:string" />

<xsd:element name="TEXT2" type="xsd:string" />

<xsd:element name="SAP_DOCUMENT" type="xsd:string" />

<xsd:element name="COMPANY_CODE" type="xsd:string" />

<xsd:element name="YEAR" type="xsd:string" />

<xsd:element name="FILE_NAME" type="xsd:string" />

<xsd:element name="FILE_TYPE" type="xsd:string" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

So I see here no difference !.

rajasekhar_reddy14
Active Contributor
0 Kudos

Data type you created in for File is not matching with FCC XML, so fix this issue. it works

Former Member
0 Kudos

Hello Raja,

I don't understand FCC. Could you explan a little more in detail what's wrong and what I have to correct.

Thanks in advance.

Reinhard

Former Member
0 Kudos

>>All structure elements are on RED

i cant see the namspace with ur message type name in the xml payload??

what is the entry u r using under "Document Namespace" while doing FCC?? if not use the message type namespace over there and then chk??

Former Member
0 Kudos

Here a part of the trace   (  section    Request Message Mapping )  :

Maybe there are the right informations. Otherwise inform me what kind of information is needed to find the problem.

kind regards, Reinhard

-


Trace level="3" type="T">Version ID of Interface Mapping DBD3DEF05D5E11E1A84CEA9F8D7F3418</Trace>

  <Trace level="1" type="T">Interface Mapping http://www.ahlstrom.com/b2b-basware OM_MT_INVOICES_to_ARCHIV_CREATE_SYCHRON_META</Trace>

  <Trace level="3" type="T">Mapping Steps 1 JAVA_JDK com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SYCHRON_META_</Trace>

  <Trace level="3" type="T">MTOM Attachments are Transferred to the Payload</Trace>

  <Trace level="3" type="T">Dynamic Configuration ( http://sap.com/xi/XI/Message/30/general senderAgreementGUID eb451cbe362e3aad996f7bd7228b302c )</Trace>

  <Trace level="2" type="T">Mode 0</Trace>

  <Trace level="2" type="T">Call method execute of the application Java mapping com.sap.xi.tf._MM_MT_INVOICES_to_ARCHIV_CREATE_SYCHRON_META_</Trace>

  <Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>

  <Trace level="3" type="T">Document start</Trace>

  <Trace level="3" type="T">Start tag [ns1:ARCHIV_CREATE_SYNCHRON_META]</Trace>

  <Trace level="3" type="T">Add raw attribute [ xmlns:ns1="urn:sap-com:document:sap:rfc:functions"]</Trace>

  <Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>

  <Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SYCHRON_META_ Thrown: com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns1:ARCHIV_CREATE_SYNCHRON_META/AR_OBJECT. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the

aashish_sinha
Active Contributor
0 Kudos

Hi,

There is a problem in your Message mapping. Please test it in Message mapping editor and you will get the root cause.

Thanks

Aashish Sinha

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Best way to troubleshoot this issue is copy the value from sxmb_moni and use it in the ESR test tool and debug. Certainly some mandatory element requires value which is missing at mapping runtime and that cause this exception. CHeck all the mandatory node and its element and use the map test tool to check.

Also make sure you open and close the xml tag elements at your source file side or any problem at the first line syntax error at the source file