cancel
Showing results for 
Search instead for 
Did you mean: 

Input file through webservice - binary content

solene_roques
Participant
0 Kudos
560

Hello everyone,

I created a webservice for the standard BO CompanyPaymentFileRegister in order to generate Inbound bankstatement file through PDI. I manage to generate the txt file. The binary content is generated with the function Binary.ParseFromString.

The inbound file and text file are correctly created :

(so far so good)

However when I tried to Start File Upload, the following error message pops up:

It can be any error in the content. But strange thing : if I download the txt file generated above, copy paste it into a new txt file without making any change, and upload it manually and click on "Start file upload" everything works fine.

It make me thinks that the the issue in not due to the "visible content" but to a file characteristic (mimeCode....) or maybe to the carriage return. I use \n is it the correct one for conversion into binary and upload in SAP ByD ?

Thanks for any lead,

Best regards,

Edit : additional information, some SAP blogs indicate that Binary file content are Base64 encoded string so I tried the following absl code :

body is a basic string.

Base64 string is not valid for BinaryObject.content field.

I also stried to assign binary value to BinaryObject.content.

var binary = Library::Binary.ParseFromString(body);
doc.FileContent.BinaryObject.content = binary;

In studio : no error. In the debugger, we can see the values :

Is binary supposed to look like this ?

With this code I end up in the situation described above : inbound file created, error message if I release it but if I copy paste it into a new txt file without change, it gets proceeded.

Accepted Solutions (1)

Accepted Solutions (1)

solene_roques
Participant
0 Kudos

Hi,

In case someone else need it : carriage return AND line feed are needed (I had only one of them). This means, you need to add " \r\n " at the end of each item of the file.

Answers (0)