cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion

Former Member
0 Kudos

Hi experts,

i have some sample data that is in txt format,i have to send this data to SAP system using File adapter using FILECONTENT Conversion.

plz help me how to write the code.

This is the sample code...and this all data have to come in a single output line

HEADER 200704050203328593893099203

STOCKDIFF 00000000000014008770380347UA 0000000864.000

STOCKDIFF 00000000000014009770460347UA 0000003666.000

STOCKDIFF 00000000000014009761020347CSS0000000001.000

STOCKDIFF 00000000000014009763460347CSS0000000005.000

STOCKDIFF 00000000000014009861880347TA 0000000128.000

STOCKDIFF 00000000000014009870210347TA 0000000640.000

FOOTER 005317

HEADER 200704050203328593893099203

STOCKDIFF 00000000000014008770380347UA 0000000864.000

STOCKDIFF 00000000000014009770460347UA 0000003666.000

STOCKDIFF 00000000000014009761020347CSS0000000001.000

STOCKDIFF 00000000000014009763460347CSS0000000005.000

STOCKDIFF 00000000000014009861880347TA 0000000128.000

STOCKDIFF 00000000000014009870210347TA 0000000640.000

FOOTER 005317

FILES -


0....UN

HEADER GROUP -


1..1

RECORD_TYPE

CREATION DATE

CURRENT TIME

GLN_CODE

DETAIL GROUP----


0....UN

RECORD_TYPE

MATERIAL NO

BATCH_CODE

QUALITY

QUANTITY

BATCH_STATUS

FOOTERGROUP----


1....1

RECORD_TYPE

RECORD_COUNT

Regards,

phani

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

Document Name : message type name

docuemntnamespace : give namesapce

Record set name : FILES

Recordset structure : header,1,detail,*,footer,1

header.fieldNames : give the header fields

header.fieldSeparator :,

header.endseparator:'nl'

header.processFieldNames : from Configuration

repeat the above 4 lines for detail,footer .. you just replace header with detail or footer

see also the below link

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

Regards

Chilla

prabhu_s2
Active Contributor
0 Kudos

if he wants in a single line of output i hope <b>header.endseparator:'nl'</b> wont require

prabhu_s2
Active Contributor
0 Kudos

handle this is proxy. the code wud normally look like below, not the exact one

loop at itab into witab.
concatenate STROUT witab into STROUT.
clear witab.
endloop.

but here the potential problem might be the number of characters STROUT could hold. I believe for string declaration it can hold upto 255 characters