Transferring Data from ABAP Internal Table to Excel Sheet
If you wish to transfer data from ABAP internal table to EXCEL you can use the following function module.
MS_EXCEL_OLE_STANDARD_DAT
This function module populates an existing excel sheet with the data from the ABAP internal table. Please find below code which shows hwo to declare and populate the import and important parameters. In the next section we will see in depth how this function module operates.
REPORT ZEX_DATATOEXCEL .
Parameters: P_file like RLGRAP-FILENAME.
data : begin of int_head occurs 0, Filed1(20) type c, " Header Data end of int_head.
data : begin of int_data occurs 0, Field1(20) type c, " Data Field2(20) type c, Field3(20) type c, Field4(20) type c, end of int_data.
OLE AUTOMATION PART 3DownLoad PDF In this post we will see the Color code for Excel Cells by using SAP OLE. Color code for ABAP is shown below, please use the numeric value as given in the figure below. For example if you want the interior color of the Excel cell to be of the color Cyan then use the code 8.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.