04-18-2008 7:46 AM
Hi,
I want to use the 'tab' for the report layout, as the requirement is, user should be able to save the spool report to the excel sheet.
IF i use, simple stmts to displays values, in the excel sheet it comes in a single column.
If I use tab then it displays '#' between the fields.
like:
PERNR # Error
111 # Text
I want to supress this # symbol.Please help
04-18-2008 8:02 AM
Try to concatenate lt-cust-kunnr, lt_cust-name1, lt_cust-stras, lt_cust-ort01 int lt_tab-field1. Then CL_GUI_DOWNLOAD of lt_tab.
This will separate the fields into corresponding columns.
04-18-2008 8:03 AM
Try to concatenate lt-cust-kunnr, lt_cust-name1, lt_cust-stras, lt_cust-ort01 int lt_tab-field1. Then CL_GUI_DOWNLOAD of lt_tab.
This will separate the fields into its corresponding columns.
04-18-2008 8:20 AM
Hi Heena,
simple way is to download Spool to text file and use Text Import wizard to Import data from text file to Excel. (specify tab as delimiter).
If you want to do it programatically, read the content of spool in internal table and download it in Excel using GUI_DOWNLOAD function module.
Regards,
Mohaiyuddin
04-18-2008 9:22 AM
Hi Heena,
Here is the sample program to read spool based on spool no and download into Excel as it is on the output with top of page .
Check the program and use it in ur program .
I hope that it gives u some inputs.
Regards,
Venkat.O
REPORT zvenkat_notepad.
PARAMETERS: spoolno TYPE tsp01-rqident,
p_file TYPE string DEFAULT 'c:\tmp\test1.xls'.
DATA:i_mem_tab LIKE abaplist OCCURS 10,
i_output(1000) TYPE c OCCURS 10.
START-OF-SELECTION.
SUBMIT rspolist EXPORTING LIST TO MEMORY AND RETURN
WITH rqident = spoolno.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = i_mem_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = i_output
listobject = i_mem_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
TABLES
data_tab = i_output.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
04-18-2008 9:49 AM
Hi,
This u r telling from point of downloading the file pragrammatically.
I m talking abt SAP standard functionalty in from spool to save as "Spreadsheet".
Thanx in advance.