Using SAP OLE code to take an internal table and paste it into an excel file

SAP

Note that you have to use “double quotation” for all the text you have to put into one cell and then connect cell with 0X09 and 0X0A for next column and next row respectively.

Check the below code as it fills two cells with 2 lines:

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.
raja
Ali
Published on 20-Dec-2017 07:21:10
Advertisements