将线轴转换为文本格式

时间:2019-03-13 13:15:25

标签: abap

我想通过电子邮件以TXT格式发送由智能表格生成的假脱机邮件作为附件。

问题是要以TXT格式获得线轴,而无需任何技术资料,而只是表格中的字符。

我已经使用功能模块RSPO_RETURN_SPOOLJOB来获取它,但是它返回的技术格式如下:

//XHPLJIIID    0700 00000+00000+
IN01ES_CA930_DEMO_3  FIRST
OPINCH12  P 144  240 1728020160000010000100001
IN02MAIN
MT0100808400
CP11000000E
FCCOURIER 120  00144 SF001SF001110000144E
UL +0000000000000
ST0201614Dear Customer,
MT0214209000
ST0864060We would like to take this opportunity to confirm the flight
MT0100809360
ST0763253reservations listed below. Thank you for your custom.
...

我想要以下内容,但不包含技术性内容:

     Dear Customer,

          We would like to take this opportunity to confirm the flight
     reservations listed below. Thank you for your custom.
     ...

这是我使用的代码:

PARAMETERS spoolnum type TSP01-RQIDENT.
DATA spool_contents type soli_tab.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
  exporting
    rqident = spoolnum
  tables
    buffer  = spool_contents
  exceptions
    others  = 1.

1 个答案:

答案 0 :(得分:0)

如果未传递参数DESIRED_TYPE或值为'OTF',且阀芯的类型为SAPscript / Smart Form,则功能模块将返回您遇到的技术格式。

相反,应该使用参数DESIRED_TYPE = 'RAW',以便解释所有技术资料,并将表单作为文本返回,这是您要求的方式,如下所示:

CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
  exporting
    rqident      = spoolnum
    desired_type = 'RAW'
  tables
    buffer       = spool_contents
  exceptions
    others       = 1.