cancel
Showing results for 
Search instead for 
Did you mean: 

Create File

Former Member
0 Kudos

Hi guys,

I have a proxy to file scenario.

First what do I need to change to get a TXT file like this:

EmpNo = 11

EmpName = Toto

Because at the moment it's creating an XML file with tags like that

<?xml version="1.0" encoding="utf-8"?>

<EmpNo >11</EmpNo>

<EmpName >Toto</EmpName>

Thanks,

Regards,

Murai

Accepted Solutions (1)

Accepted Solutions (1)

former_member192892
Active Contributor
0 Kudos

One method would be to use two tags in ur data type and do a custom mapping.

I mean for 1st tag, value = "EmpNo = " + (input from source message type tag value)

And finally, You need to use file content conversion

Thanks

Varun

Former Member
0 Kudos

What do I need to do in conversion to get this in my file

80101

Toto

Netweaver

instead of this

- <EmpProfile_Msg>

<Empno>80101</Empno>

<EmpName>Toto</EmpName>

<DepartmentName>NetWeaver</DepartmentName>

</EmpProfile_Msg>

I 've tried to fill the "box" in "Content conversion parameters" but wihout success.

Does anybody know?

Thanks in advance,

Regards,

Murai

agasthuri_doss
Active Contributor
0 Kudos

Hi,

You can avoid by using file content conversion

Regards

Agasthuri Doss

justin_santhanam
Active Contributor
0 Kudos

Recordset Structure : EmpProfile_Msg

EmpProfile_Msg.fieldSeparator : 'nl'

EmpProfile_Msg.endSeparator : 'nl'

Hope this helps.

Best regards,

raj.

0 Kudos

It should work as Raj said... additionally you can add as fisrt line...

EmpProfile_Msg.addHeaderLine : 0

Even i have the same scenario as yours it worked for me..

Former Member
0 Kudos

Hi guys,

My file is empty. Did u choose file type text and transfer mode text?

what about the file encoding?

Thanks

Kind Regards,

Murai

Former Member
0 Kudos

Hi Murai,

Leave all the parameters as default.

Check message mapping in payload if the data is getting mapped properly.

Regards,

Sumit

Former Member
0 Kudos

It's not a question of mapping because I have none. It's a problem of conversion in the adapter.

Do I need to do something extra? I just put the fieldseparator and endseparator but my file always contains only 3 rectangle symbols. Any ideas guys?

Kind regards ,

Murai

Former Member
0 Kudos

did u do mapping.

Former Member
0 Kudos

Hey

change the file type to Binary.

look like you are getting some special characters and text/html is not able to handle that

thanx

Ahmad

Former Member
0 Kudos

Hi,

There is no mapping. (same structure).

But if I dont do the conversion the output file is tagged but the data are correct.

Regards,

muraii

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Murai,

Have you configured the file adapter like this ..

Chek once...

1) Message Protocol as FCC

2)give <b>FileName Scheme</b> as .txt extension

3)<b>File Type</b> as Text

4) Record Set structure--> EmpProfile_Msg

5) And give the fieldseperator,endseperator as 'nl'

Regards,

sridhar

Former Member
0 Kudos

I did all of that still have an empty file.

Regards,

Murai.

ps: communication channel monitor : successfull.

Former Member
0 Kudos

Hey

did you change the File type to Binary as i said?

thanx

Ahmad

justin_santhanam
Active Contributor
0 Kudos

Murai,

As per your given XML structure, the conversion parameters which I specified in my earlier replies will work perfectly.

See the below URL for references.

<b>Structure</b>

http://www.flickr.com/photo_zoom.gne?id=640561850&size=o

<b>Receiver comm-channel(1)</b>

http://www.flickr.com/photo_zoom.gne?id=640561854&size=o

<b>Receiver comm-channel(2)</b>

http://www.flickr.com/photo_zoom.gne?id=640561858&size=o

<b>Results</b>

http://www.flickr.com/photo_zoom.gne?id=639719931&size=o

If still you have doubts, do reply back.

Best regards,

raj.

Former Member
0 Kudos

Excellent Raj thank you very much, it's ok now.

I have just a last question. Imagine I have the following structure :

<?xml version="1.0" encoding="utf-8" ?>

- <nr1:EmpProfile_Msg xmlns:nr1="urn:Test:createflatfile">

- <EmpProfile_detail>

<Filename>Toto.txt</Filename>

<i_strCFNumber>i_strCFNumber=011666</i_strCFNumber>

</EmpProfile_detail>

</nr1:EmpProfile_Msg>

How can I use the File name scheme? I mean how can I create the file name with the value of "filename"(the tag)?

Thanks again Raj,

Kind regards,

Murai.

Former Member
0 Kudos

I did this :

filename scheme : %var1%.txt

and %var1% :payload:EmpProfile_Msg,0,EmpProfile_detail,Filename

Is it correct?

justin_santhanam
Active Contributor
0 Kudos

Murai,

Sorry for the late reply. Ok, u want the payload Filename to be ur receiver comm.channel File name scheme right?

Do u have any mapping program?If yes then please see the below logic to achieve the same.

Create simple UDF with single input parameter.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key,<b>yourinputparameter</b>);

return "";

The mapping logic is

According to your XML structure given above.

Filename[Source]---->UDF--


> Root Node[Target]

Click the checkbox of Adapter Specific Message Attributes- Filename in both Sender/Receiver comm.channel.

If you don't want the above UDF and if you want only variable substitution , then do reply back.

Best regards,

raj.

Answers (2)

Answers (2)

Former Member
0 Kudos

Any idea?

justin_santhanam
Active Contributor
0 Kudos

Murai,

Create Data type,Message Type, Inbound Asynch Message Interface

<Details> 0..Unbounded

<Empno/> 0..1

<Empname/> 0..1

</Details>

Best regards,

raj.

Former Member
0 Kudos

It's already done. What I would like is a flat file and not a tagged xml file.

With no tags in the file. (It's proxy to File) I would like to create a simple file with no tags.

Regards,

Muraii.

justin_santhanam
Active Contributor
0 Kudos

Murai,

While writing to file use content conversion , so that it won't contain tags in it.

Best regards,

raj.