cancel
Showing results for 
Search instead for 
Did you mean: 

Premature end of file.

sahana_ps
Participant
0 Kudos

Hi all,

I have a SFTP(Flat Text File) to IDOC Scenario.

The SFTP channel is green ,it picks the file and deletes it after picking.But I can see error in Message Monitoring as

"Premature End of File"

I have used Message Transform Bean in Sender SFTP Channel to convert Flat text file to xml.

If I go to message monitoring- >message content->i dont see any payload here??????

Can anyone help in resolving this error.

Accepted Solutions (0)

Answers (5)

Answers (5)

martini
Explorer
0 Kudos

Hi Sahana,

I have the same problem...I think in part is over "xml.recordsetStructure" where you put "Item.*" instead of the correct number of "Items"..., when you put the number of "Items" works...this is wrong for me, but for now, I don't have any other idea.

Can you help me? do you fix the problem?

sahana_ps
Participant
0 Kudos

Hi  Martin,

For me error was because of the item and trailer "xml.keyFieldValue" which was blank. i.e,in my file the first field of item and trailer used to be blank always for 4 spaces,so i had maintained key value as blank.so was facing this error.

I resolved it my merging first two fields in mapping and reading this field as one in content conversion.

martini
Explorer
0 Kudos

Hi Sahana,

Thanks a lot for you explanation. I guess, my problem is other.  Here is part of the "module" data using MessageTransformBean Class (Plain2XML key).

As you can see, the last line "xml.recordsetStructure", the parameter Phone had a * (asterisk) because I don´t know the occurrence (0,1,5,etc).

So, when I put * (asterisk) the inbound message is in blank, but when I put i.e. 5 (the correct number the phones) the message work fine...

Plain2XML    xml.MarketSegment.fieldFixedLengths    50,20,2

Plain2XML    xml.MarketSegment.fieldNames    DBSObjectName,DBSVerb,MKTSEG

Plain2XML    xml.MarketSegment.keyFieldValue    DBS_Market_Segment

Plain2XML    xml.MarketSegment.missingLastFields    ignore

Plain2XML    xml.MarketSegment.processFieldNames    fromConfiguration

Plain2XML    xml.Phone.fieldFixedLengths    50,20,2,50

Plain2XML    xml.Phone.fieldNames    DBSObjectName,DBSVerb,IDSCCD,PHNEML

Plain2XML    xml.Phone.keyFieldValue    DBS_Phone

Plain2XML    xml.Phone.missingLastFields    ignore

Plain2XML    xml.Phone.processFieldNames    fromConfiguration

Plain2XML    xml.ProfileData.fieldFixedLengths    50,20,1,2,4,4,4,4,4,4,4,4,3,1,3,1,3,1,3,1,13,5,5,6,6,6,6,6,6,6,6,6,6,5

Plain2XML    xml.ProfileData.fieldNames    DBSObjectName,DBSVerb,DIVI,CUSIZ2,IDCD01,IDCD02,IDCD03,IDCD04,IDCD05,IDCD06,IDCD07,IDCD08,SLMN01,SLMT01,SLMN02,SLMT02,SLMN03,SLMT03,SLMN04,SLMT04,PCCUNO,MachineCount,NonMachineCount,CUPR00,CUPR01,CUPR02,CUPR03,CUPR04,CUPR05,CUPR06,CUPR07,CUPR08,CUPR09,DBSFiller

Plain2XML    xml.ProfileData.keyFieldValue    DBS_CustomerProfileData

Plain2XML    xml.ProfileData.missingLastFields    ignore

Plain2XML    xml.ProfileData.processFieldNames    fromConfiguration

Plain2XML    xml.conversionType    StructPlain2XML

Plain2XML    xml.documentName    YUKPI_MT_CustomerMaster

Plain2XML    xml.documentNameSpace    urn:uk.finning.co.uk/dbs/customer

Plain2XML    xml.fieldContentFormatting    nothing

Plain2XML    xml.keyFieldName    DBSObjectName

Plain2XML    xml.keyFieldType    CaseInsensitiveString

Plain2XML    xml.recordsetName    Recordset

Plain2XML    xml.recordsetStructure    CustomerData,1,ProfileData,1,LocationAddress,1,Phone,*,MarketSegment,1,CreditData,1

I'll create a SAP note for show the error. May be...is necessary some parameter(s). If you can see some error, please write me!

Thanks again!

martini
Explorer
0 Kudos
Hi Sahana, thank for your help! the problem was the "xml.keyFieldValue" as you said. I had the key and blanks at the end...e.g: "DBS_Customer" is filled in the parameter, but in the physical file said "DBS_Customer   " so, the key was mismatch. Now, I've fixed the channel and the asterisk works at parameter "xml.recordsetStructure".

Thanks again!

Former Member
0 Kudos

Hi Sahana,

Please check is u have missed any parameter , this is list of parameter needed for flat file to convert xml

Module :-

1 localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean <Plain2XML>

2 localejbs/CallSapAdapter Local Enterprise Bean entry

Parameters

<Plain2XML> Transform.Class com.sap.aii.messaging.adapter.Conversion

<Plain2XML> Transform.ContentType text/xml;charset=utf-8

<Plain2XML> xml.Detail.additionalLastFields ignore

<Plain2XML> xml.Detail.endSeparator 'nl'

<Plain2XML> xml.Detail.fieldNames Record_Type,Cost_Centre,Group,Division

<Plain2XML> xml.Detail.fieldSeparator ,

<Plain2XML> xml.Detail.keyFieldValue DTL

<Plain2XML> xml.Header.additionalLastFields ignore

<Plain2XML> xml.Header.endSeparator 'nl'

<Plain2XML> xml.Header.fieldNames Record_Type,Processing_Date_Time

<Plain2XML> xml.Header.fieldSeparator ,

<Plain2XML> xml.Header.keyFieldValue HDR

<Plain2XML> xml.Trailer.additionalLastFields ignore

<Plain2XML> xml.Trailer.endSeparator 'nl'

<Plain2XML> xml.Trailer.fieldNames Record_Type,Record_Count

<Plain2XML> xml.Trailer.fieldSeparator ,

<Plain2XML> xml.Trailer.keyFieldValue TLR

<Plain2XML> xml.addHeaderLine 0

<Plain2XML> xml.conversionType StructPlain2XML

<Plain2XML> xml.documentName MT_CCDivGroup_File

<Plain2XML> xml.documentNamespace http://XXXXXXXXXXX/pi/a2a/global/ApprovalProcess

<Plain2XML> xml.enclosureConversion YES

<Plain2XML> xml.end.fieldSeparator 'nl'

<Plain2XML> xml.fieldContentformatting nothing

<Plain2XML> xml.keyFieldName Record_Type

<Plain2XML> xml.keyFieldType CaseSensitiveString

<Plain2XML> xml.processFieldNames fromConfiguration

<Plain2XML> xml.recordsetName Record_Set

<Plain2XML> xml.recordsetStructure Header,1,Detail,*,Trailer,1

sahana_ps
Participant
0 Kudos


Hi Rudra,

Thanks for the help,I checked everything is same .But ,no luck still facing same error

Former Member
0 Kudos

Hi Sahana,

There can be two reasons for premature end of file.

1. MTB module should be first executed among your other modules.

2. May be some parameters are missing for your Structure.

Please provide the structure and module snap shots for details .

sahana_ps
Participant
0 Kudos

Hi Rudra,

Yes MTB module is first .i checked,all the parameters are present.

I have added the screenshot above

Former Member
0 Kudos

Hi Sahana,

We have faced the similar situation many times earlier in Production environment .

"Premature End of File" -->This error comes when there is no payload in the input structure .No need to panic ,just notify to source system folks on this .They will take care of it .


When source system pushes the file/http/soap message with no payload to PI .Above error comes.


Regards

Venkat

sahana_ps
Participant
0 Kudos

Hi Venkat,

Source system has data.I am only placing source flat text file in sftp server and testing it

iaki_vila
Active Contributor
0 Kudos

Hi Sahana,

Could you share a file example and your content conversion parameters?

Are you using SimpleXML2Plain module?

Have you set fieldFixedLengths or fieldSeparator parameters?


Regards.

sahana_ps
Participant
0 Kudos

Hi,

Below are the screenshots

Source File

ESR Data Type

ID

iaki_vila
Active Contributor
0 Kudos

Hi Sahama,

I think it's no possible to set a blank like KeyFieldValue. You can try to set to 4 blanks in the configuration.

I think you have the same fieldNames like  fieldFixedLengths,  haven't it?

Regars.