传递CSV文件作为邮件附件

2020-09-02 13:38发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


人们好,

我正在处理Passthrough CSV文件,将其作为邮件附件发送。

选中不使用邮件包和保留附件。

默认情况下,在直通方案中,文件作为附件发送,但与PO 7.5上的最新SP 14表现不同。
XIALL也不会生​​成附件。

我尝试使用其他文件作为附件发送文件,在这种情况下,附件使用ContentID生成-使用 cidpayload-msgid@sap.com
我尝试使用动态配置Bean,自定义setmail附件名称Bean,动态属性更改Bean,带有以下参数的消息转换Bean,但仍然无法使用:
Transform.ContentDescription-文件

Transform.ContentDisposition-附件; filename =" File.csv"

Transform.ContentType-应用程序/文本; charset = utf-8; name =" File.csv"

也尝试使用text/plain; charset = utf-8; name =" File.csv"。

我无法以某种方式影响附件名称。

___________________

所以我提到了许多博客,并使用下面的Java映射,但是它在XML中生成附件,当我使用XML2Plain模块时,它不允许prolog错误中的内容。
我需要一些 帮助Java代码:
将xml转换为csv或按csv的原样复制输入有效负载。

我知道有很多带有邮件包的博客,但是我不想使用邮件包

正在使用的代码是:
public void transform(TransformationInput TransformationInput,TransformationOutput transformOutput){//System.out.println("A"); //访问动态配置InputStream inputstream = TransformationInput.getInputPayload()。getInputStream(); OutputStream outputstream = TransformationOutput.getOutputPayload()。getOutputStream(); 尝试{//写附件字符串有效载荷=""; outputstream.write(payload.getBytes(" UTF-8")); OutputAttachments outputAttachments = TransformationOutput.getOutputAttachments(); byte [] b =新的byte [inputstream.available()]; inputstream.read(b); 附件newAttachment = outputAttachments.create(" File.csv"," text/plain",b); outputAttachments.setAttachment(newAttachment); } catch(Exception e){getTrace()。addDebugMessage(e.getMessage()); }

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


人们好,

我正在处理Passthrough CSV文件,将其作为邮件附件发送。

选中不使用邮件包和保留附件。

默认情况下,在直通方案中,文件作为附件发送,但与PO 7.5上的最新SP 14表现不同。
XIALL也不会生​​成附件。

我尝试使用其他文件作为附件发送文件,在这种情况下,附件使用ContentID生成-使用 cidpayload-msgid@sap.com
我尝试使用动态配置Bean,自定义setmail附件名称Bean,动态属性更改Bean,带有以下参数的消息转换Bean,但仍然无法使用:
Transform.ContentDescription-文件

Transform.ContentDisposition-附件; filename =" File.csv"

Transform.ContentType-应用程序/文本; charset = utf-8; name =" File.csv"

也尝试使用text/plain; charset = utf-8; name =" File.csv"。

我无法以某种方式影响附件名称。

___________________

所以我提到了许多博客,并使用下面的Java映射,但是它在XML中生成附件,当我使用XML2Plain模块时,它不允许prolog错误中的内容。
我需要一些 帮助Java代码:
将xml转换为csv或按csv的原样复制输入有效负载。

我知道有很多带有邮件包的博客,但是我不想使用邮件包

正在使用的代码是:
public void transform(TransformationInput TransformationInput,TransformationOutput transformOutput){//System.out.println("A"); //访问动态配置InputStream inputstream = TransformationInput.getInputPayload()。getInputStream(); OutputStream outputstream = TransformationOutput.getOutputPayload()。getOutputStream(); 尝试{//写附件字符串有效载荷=""; outputstream.write(payload.getBytes(" UTF-8")); OutputAttachments outputAttachments = TransformationOutput.getOutputAttachments(); byte [] b =新的byte [inputstream.available()]; inputstream.read(b); 附件newAttachment = outputAttachments.create(" File.csv"," text/plain",b); outputAttachments.setAttachment(newAttachment); } catch(Exception e){getTrace()。addDebugMessage(e.getMessage()); }

1条回答
葫芦娃快救爷爷
1楼-- · 2020-09-02 14:33

哈里,你好

您是否尝试过在接收器SFTP通信通道中使用" AF_Modules/MessageTransformBean" bean?

您应该能够启用此bean,然后将参数" Transform.ContentType"设置为" text/csv"

总是不带引号。

让我知道这是否有帮助:)

尼克

一周热门 更多>