09-18-2007 9:35 AM
i have written a program,
the output is an ALV,now i want the ALV and also an excel file in the same report.
how i can achieve this.
is there any function module which will convert all the ALV data to excel.
09-18-2007 9:37 AM
Follow the path
System --> List --> Save --> Local File --> Spread Sheet
And give the path where you want to save this, and press Transfer
Regards
Gopi
09-18-2007 10:32 AM
i dont want to export.
in the program,i want to code in such a way that i want ALV and excel file as the output simultaneously.
09-18-2007 10:41 AM
09-18-2007 10:44 AM
i want the data in excel and in ALV,not by doing exporting to excel.
i want this to be generated from excel.
09-18-2007 10:45 AM
Use the FM - ALV_XXL_CALL. here is the sample -
REPORT ZSKC_ALV_XXL.
TYPE-POOLS : KKBLO.
DATA : ITAB LIKE T100 OCCURS 0,
T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
START-OF-SELECTION.
* Get data.
SELECT * UP TO 20 ROWS
FROM T100
INTO TABLE ITAB
WHERE SPRSL = SY-LANGU.
CHECK SY-SUBRC EQ 0.
* Create the field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'T100'
CHANGING
CT_FIELDCAT = T_FCAT_LVC[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
* make sure you pass the correct internal table name in the field catalog.
t_fcat_lvC-tabname = 'ITAB'.
MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
* Transfer to KKBLO format.
CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
EXPORTING
IT_FIELDCAT_LVC = T_FCAT_LVC[]
IMPORTING
ET_FIELDCAT_KKBLO = T_FCAT_KKB
EXCEPTIONS
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
OTHERS = 3.
CHECK SY-SUBRC EQ 0.
* Call XXL.
CALL FUNCTION 'ALV_XXL_CALL'
EXPORTING
I_TABNAME = 'ITAB'
IT_FIELDCAT = T_FCAT_KKB
TABLES
IT_OUTTAB = ITAB[]
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ENDIF.
Hope it helps.
09-18-2007 9:38 AM
Hi Prashant ,
In the tool bar provided by ALV there is an optin to down load the ALV which provides this option of downloading the ALV to excel.
Regards
Arun
09-18-2007 9:43 AM
Hi,
yes you can send the alv output to anykind of format as per your requirement.
use this function module
XXL_FULL_API
Regards,
Pritha.
09-18-2007 10:08 AM
hi,
use
<b>LIST_DOWNLOAD</b>
CALL FUNCTION 'LIST_DOWNLOAD'
EXPORTING
LIST_INDEX = sy-lsind
METHOD = 'NOCO'
EXCEPTIONS
LIST_DOWNLOAD_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
RTF - Save in rich text format
DAT - Save as spreadsheet
NOCO - Save without converting
Hope it will helpful to u.
09-18-2007 10:31 AM
01-10-2008 6:33 AM