使用SAP OLE代码获取内部表并将其粘贴到Excel文件中

请注意,必须对所有要放入一个单元格的文本使用“双引号”,然后将单元格分别与0X09和0X0A连接起来用于下一列和下一行。

检查以下代码,因为它用2行填充了两个单元格:

CONSTANTS:
   nextC TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab,
   nextR TYPE abap_char1 VALUE cl_abap_char_utilities=>newline,
   quot TYPE abap_char1 VALUE '"'.
DATA:
   buffer TYPE string.
CONCATENATE quot 'R1C1L1' nextR 'R1C1L2' quot nextC quot 'R1C2L1' nextR 'R1C2L2' quot INTO buffer.