cancel
Showing results for 
Search instead for 
Did you mean: 

Generate File Text in SFTP Server

former_member509118
Participant
0 Kudos

Hi,

I'm generating a file by adapter SFTP and the generate file is XML.

I'm using Additional Parameters as following:

FileType = Text

But is not working...

Other question; I need to eliminate the first line of my file but is not working too:

FILENAME.addHeaderLine0
FILENAME.keyFieldValue1
FILENAME.keyFieldInStructureignore

Can you help?

tks

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

Hi,

AFAIK, for file content conversion in SFTP  you have to use Message Transform bean. Also refer to the below discussion:

http://scn.sap.com/thread/3263334

former_member509118
Participant
0 Kudos

Hi Adarsh... very tks for help..

I change to Message Transform but now I´m with others problems...

It´s wiht error in MP... display message that it´s missing 'xml.ITEM.fieldFixedLengths' or 'xml. ITEM.fieldSeparator' as image below:

my DataType / MP / Message MP

any idea?

former_member184789
Active Contributor
0 Kudos

Hi,

You need to specify how the fields in the text file will be separated i.e comma separated, semi colon separated etc. or you can specify the fixed lengths of the fields. Please refer to the parameters xml.fieldFixedLengths & xml.fieldSeparator in the document link suggested by . It is also mentioned in the document that if you want a CSV file, use the parameter xml.fieldSeparator

former_member509118
Participant
0 Kudos

Hi Adarsh...

The fields have fixed lengths...how I will separate the fields in text file?

Example:

SAP (Internal Table separate by columns)

0001         000000001             0000000000010

0002         000000002             0000000000020

0003         000000003             0000000000030

File in SFTP (txt)

0001         000000001             0000000000010

0002         000000002             0000000000020

0003         000000003             0000000000030

Separate by ';' the command is 'nl', in this case by tab how is?

tks.

former_member184789
Active Contributor
0 Kudos

Hi,

For tab separated values, the value for parameter xml.fieldSeparator will be  '0x09' ...Also refer to the below links:

http://scn.sap.com/thread/1844616

http://scn.sap.com/people/gabrielsagayaselvam.panneerselvam/blog/2009/08/31/solve-key-field-problem-...

former_member509118
Participant
0 Kudos

Hi Adarsh, very tks by links and too for help...

The error message continues...

I inserted one by one and analyzed the message in RWB but without sucess...

Can you analyze my Module as following image below and help me what I'm doing wrong?

tks

former_member184789
Active Contributor
0 Kudos

Hi,

You need to modify then entries for Key fields. You should also provide the value of the key fields:

In your case, the values of key fields should have been provided as:

xml.HEADER.keyFieldName = IDENT_REG

&

xml.ITEM.keyFieldName = IDENT_REG_I

Also provide two new entries for key field values as:

xml.HEADER.keyFieldValue = XXXX

xml.ITEM.keyFieldValue = XXXX

Here XXXX refers to the value with which you will identify whether the given line is Header or ITEM.

Please refer to the section Complex Conversion of the below link:

http://help.sap.com/saphelp_nw04/helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

Also go through the way in which key field is provided in below link:

http://scn.sap.com/people/gabrielsagayaselvam.panneerselvam/blog/2009/08/31/solve-key-field-problem-...

former_member509118
Participant
0 Kudos

Hi Adarsh... very tks for help!

It's working...

tks.

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Rodrigo,

Are you using the MessageTransformBean in order to transform the XML?

Check the receiver conversion in this link http://help.sap.com/saphelp_nw04/helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

Or you want to create a file with the exact XML that you have in the payload?

Regards.