cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong Order in which Header, Detail and Trailer Records written in the file

Former Member
0 Kudos

Hi All,

My scenario is proxy to file. Within proxy,Idoc String is generated as source message and hits the PI. File is first created and appended in the temporary folder and once completely written, a window script transfers the file into different folder. For this scenario, based on the field content (START, DETAIL, END) in the source message,message is identified and written on the file

Start message --> Header record

Detail message -> Detail Record

END message --> Trailer Record

For this scenario, condition is defined in the interface determination and separate communication channels are used to write the file. Once START message comes, file is created and header record is written, then Detail message comes and records are appended in the same file and lastly END message comes and trailer is appended in the file. Within CC for Trailer record, the script is place in the "RUN Operating system command after message processing" to move the file. Also FCC is used to convert XML to flat file.File Type is specified as Text and file encoding as UTF-8.

FCC parameters used are:

TRAILER.fieldFixedLengths 1,9,626

TRAILER.endSeparator 'nl'

TRAILER.fieldNames INDICATOR,RECORD_COUNT,FILLER

HEADER.fieldFixedLengths 1,8,4,11,612

HEADER.endSeparator 'nl'

HEADER.fieldNames INDICATOR,RUNDATE,TIME,IDENTIFIER,FILLER

DETAIL.fieldFixedLengths .........

DETAIL.fieldnames ......

DETAIL.endSeparator 'nl'

DETAIL.fixedLengthTooShortHandling Cut

__Issue:__

The message is successful, but file is written in wrong order

Header Record

Trailer Record

Detail Record

eg..

H201101041618

T539

D010000 ......

Due to which script was not able to move the file. In SXMB_MONI, the message is successful and proper interface, receiver and Communication channel is identified in the trace. Not sure why trailer record is written before detail records?

Also the message coming from proxy is in order .. first start(Header), then detail and then end(Trailer).

Please advice what is going wrong in the scenario

Thanks

Shikha Jain

Edited by: Jain Shikha on Jan 5, 2011 5:20 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

> Not sure why trailer record is written before detail records?

Do you use mapping? Does mapping change the order?

Former Member
0 Kudos

Hi,

ignore above reply

Can you please check RecordSetStructure in FCC,

RecordSetstructure should be like Header,,Deatil,,Trailer,*

Former Member
0 Kudos

Hello Jayan,

Since i am using different communication channels for writing HEADER, DETAIL and TRAILER records,recordset structutre is as follows:

For --

START message -> Header CC -> *HEADER* -- its in create mode

DETAIL Message --> Detail CC -> *DETAIL* -- Append Mode

END message --> Trailer CC -> TRAILER -- Append Mode

Stefan,

Yes.. i am using java mapping followed by message mapping in Operation mapping. There are different operation mapping for start, detail and end message but it does not change the order of the message. The same scenario is working in other environments.

Thanks

Shikha Jain

Edited by: Jain Shikha on Jan 5, 2011 2:22 PM

stefan_grube
Active Contributor
0 Kudos

When you use different channels, you need EOIO and make sure, that the channels are called in the valid order.

I recommend to write the whole file with one channel.

Former Member
0 Kudos

Stefan,

Does putting a delay between Detail and end message coming from proxy might make a difference?

Thanks

Shikha Jain

stefan_grube
Active Contributor
0 Kudos

> Does putting a delay between Detail and end message coming from proxy might make a difference?

If the system is down for some reason and the messages are queued, then it is no garantuee that the messages are processed in correctorder after restart.

In ABAP proxy you can easily assign a queue id to keep EOIO. This should help.

Former Member
0 Kudos

In ABAP proxy you can easily assign a queue id to keep EOIO.

--> Can you guide me how to go about it .

In Proxy, one we receive acknowledgement for start message, then only detail message is sent and similar case is with trailer message. This scenario happened only one day.. now its again processing properly.. I noticed the time(start and end) of messages and came to know that trailer message came in before the detail message is processed..

Start time End Time

16:18:02 16:18:02 - Start message

16:18:06 16:18:25 - Detail message

16:18:17 16:18:25 - End message

Thanks

Shikha Jain

Edited by: Jain Shikha on Jan 5, 2011 4:13 PM

Former Member
0 Kudos

Got the reason of error ... Many Thank for your help

Thanks

Shikha Jain

Former Member
0 Kudos

Hi,

Can you please RecordSetStructure in FCC,

RecordSetstructure should be like Header,,Deatil,,Trailer,*