Skip to Content
0

Unwanted characters in csv file after content conversion SFTP Receiver

Aug 29, 2017 at 02:08 PM

67

avatar image
Former Member

Hello everyone,

i have the following Payload in a SFTP Receiver Communication Channel,

it's an XML to CSV Scenario:

________________________________________________________________

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

-<ns2:MT_StockTransfer xmlns:ns2="http://abcd.com/Z_abcd/StockTransfer">

<ID>732160904732160901732160900</ID>

<filename>shop_732160904_732160901_732160900_20170829131443</filename>
-<StockTransfer>

<SupplierGLN>732160904</SupplierGLN>

<FromLocationGLN>732160901</FromLocationGLN>

<ToLocationGLN>732160900</ToLocationGLN>

<PostingDate>20170829</PostingDate>

<ArticleNo>7325861092944</ArticleNo>

<Quantity>2</Quantity>

</StockTransfer>

</ns2:MT_StockTransfer>

___________________________________________________________________

I used the following Recordset Structure:

ID,filename,StockTransfer

and the following names / values

StockTransfer.addHeaderLine = 0

StockTransfer.endSeparator = 'nl'

StockTransfer.fieldSeparator = ;

filename.absoluteRowWidth = 0

filename.fieldFixedLengths = 0

filename.fixedLengthTooShortHandling = Cut

filename.endSeparator = ‘0‘

ID.fieldFixedLengths = 0

ID.fixedLengthTooShortHandling = Cut

ID.endSeparator = ‘0‘

____________________________________________________________________

The result is:

How can i remove the double '0' at the front of the output?

If i didn´t enter the ID.endSeparator and the filename.endSeparator two line breaks will appear.

Can somebody help ?

Thanks in advance.

Daniel

rptf6.png (3.5 kB)
10 |10000 characters needed characters left characters exceeded
Former Member

How do you want your output to look like?

0
Former Member

Hi Patrick,

like this:

2qvnf.png (7.0 kB)
0
Former Member
Former Member

Thanks for clarifying. Then you'll want to remove the first two elements by following Evgeniy's suggestion or not creating them in your mapping in the first place (in case you even have a mapping in your scenario).

Regards,

Patrick

1
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Evgeniy Kolmakov Aug 30, 2017 at 07:15 AM
0

Hi Daniel!

In this case you could try to remove unwanted elements from message using RemovePayloadValueBean:

https://help.sap.com/saphelp_nw73ehp1/helpdata/en/45/da2239feb22e98e10000000a155369/frameset.htm

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks a lot Evgeniy, this works fine for me.

Regards, Daniel.

0
Evgeniy Kolmakov Aug 29, 2017 at 05:17 PM
1

Hi Daniel!

If I understand your requirement right, you need to output just "StockTransfer" element's contents?

If so, what happens, if you define only that element in Recordset structure?

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

> If I understand your requirement right, you need to output just "StockTransfer" element's contents?

Yes, that's right.

> If so, what happens, if you define only that element in Recordset structure?

I tried, but if they are not part of the Recordset structure two line breaks appear on the top of the output.

rdp3u.png (3.0 kB)
0