cancel
Showing results for 
Search instead for 
Did you mean: 

Direct Pass through scenario-Truncating issue when converting Idoc xml file to flat file

former_member463616
Contributor
0 Kudos
286

Hi Team,

We are using standard adapter module IDOCXmlToFlatConvertor to converting Idoc xml file to flat file by using direct pass through functionality (Idoc to file scenario). It is converting Idoc xml data to flat file data but it is truncating spaces of the last field value for each row in flat file.

We need to keep applicable spaces for last field value as well for each row in target flat file.

Please provide your valuable inputs that would be appreciated.

Thanks,

P.Rajesh

Accepted Solutions (0)

Answers (3)

Answers (3)

christopherko
Explorer
0 Kudos

Hi rajesh.kumar20

I have just tested it. I used a standard SAP IDoc for this. The last field in this Idoc is a 10-character CHAR field according to the Idoc definition. If this field does not exist in the Idoc XML, 10 spaces are written. As many as the length of the field. If I write only 9 or less characters in the field, missing characters are replaced by a space.

Example: "111111111" (9 characters) becomes "111111111_" in the Flat-Idoc. ("_" means space)

If there are leading spaces in the Idoc-XML, these are also taken over correctly.

Example: "_____11111" (5 spaces followed by 5 characters) remains exactly the same in the Flat-Idoc.


Which Idoc type do you use? What is the data type of the last field in which the spaces are lost?

Greetings
Christopher


anupam_ghosh2
Active Contributor
0 Kudos

Hi rajesh.kumar20,

you need custom adapter module before the standard one IDOCXmlToFlatConvertor. The custom module will replace all space within symbols ">" and "</" with symbol "#". Then after conversion to flat file spaces will not get truncated. Then on receiver channel you need another adapter module to replace all "#" with space.

Regards

Anupam

vossk2
Explorer
0 Kudos

Hello Rajesh,

could you provide an example?

BR David

0 Kudos

David,

Thanks for responding.

An example is EDIDC40 Segment , last field is <SERIAL>. It is 20 characters long. SAP is sending only 7 characters, the rest of the characters needs to be trailing blank since this Fixed length file(left justified). Generated file does not restore trailing blanks.

Thanks

vossk2
Explorer
0 Kudos

Hello Shikha,

could you please provide a blurred example picture?

BR David