Downloading ouput to Excel
Hi,
I have a requirement that when i download the report output to excel sheet the if the field contents has preceding 0's ( Zeros) ex: 012345679, it shud appear same in the excel. But now when i download to excel the preceding 0's are not appearing in the output.(ex:12345679).
Can any one give me a solution for this apart from manul text to excel conversion.
Waiting for ur reply....
Regards
Srinath
Hi,
I don't think you can do this in ABAP.u can do it in excel directly.
But u can define ur field as type of char and than download it.
If anyone can also export the initilal 0's directly post it so that I can also learn it.
Hope it works.
Regards,
Anil.
Similar Messages
-
How to download data from abap-ouput to excel sheet with logo
how to download data from abap-ouput to excel sheet with standard logo
Edited by: Harish Kasyap on Nov 18, 2008 8:19 AM
Edited by: Harish Kasyap on Nov 18, 2008 8:20 AMFor saving the report you can goto System -> List -> Save -> Local File -> Location where you want to save in your presentation server.
You can also give a option in your selection screen to save the file to Presentation server using FM GUI_DOWNLOAD.
Hope it helps.
Thanks,
Jayant. -
Download output to excel in graphical form.
Hi,
I have a requirement in my project that has to download ouput of a report to a Excel sheet with a Graph I found some sample program for that. But right now the program is downloading in a Bar Chart Format . I have to chage this parameter to a Line Chart. In the program I am attaching in line 221 the chart type has been specified as vertical bar chart. I know I need to chage this parameter but I am not able to figure out how to do it or what is the value I need to set it to. Can u help me in this in any way or send me some informative material which would help me in this.
Please create a report and see the output after executing.
The Code is
*& Report ZNEGI9 *
REPORT ZNEGI9 NO STANDARD PAGE HEADING.
INCLUDE ole2incl .
DATA: gs_excel TYPE ole2_object ,
gs_wbooklist TYPE ole2_object ,
gs_application TYPE ole2_object ,
gs_wbook TYPE ole2_object ,
gs_activesheet TYPE ole2_object ,
gs_sheets TYPE ole2_object ,
gs_newsheet TYPE ole2_object ,
gs_cell1 TYPE ole2_object ,
gs_cell2 TYPE ole2_object ,
gs_cells TYPE ole2_object ,
gs_range TYPE ole2_object ,
gs_font TYPE ole2_object ,
gs_interior TYPE ole2_object ,
gs_columns TYPE ole2_object ,
gs_charts TYPE ole2_object ,
gs_chart TYPE ole2_object ,
gs_charttitle TYPE ole2_object ,
gs_charttitlechar TYPE ole2_object ,
gs_chartobjects TYPE ole2_object .
DATA gv_sheet_name(20) TYPE c .
DATA gv_outer_index LIKE sy-index .
DATA gv_intex(2) TYPE c .
DATA gv_line_cntr TYPE i . "line counter
DATA gv_linno TYPE i . "line number
DATA gv_colno TYPE i . "column number
DATA gv_value TYPE i . "data
PARAMETERS: p_sheets TYPE i .
START-OF-SELECTION .
DO p_sheets TIMES .
*--Forming sheet name
gv_intex = sy-index .
gv_outer_index = sy-index .
CONCATENATE 'Excel Sheet #' gv_intex INTO gv_sheet_name .
*--For the first loop, Excel is initiated and one new sheet is added
IF sy-index = 1 .
CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF gs_excel 'Visible' = 1 .
GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooklist .
GET PROPERTY OF gs_wbooklist 'Application' = gs_application .
SET PROPERTY OF gs_application 'SheetsInNewWorkbook' = 1 .
CALL METHOD OF gs_wbooklist 'Add' = gs_wbook .
GET PROPERTY OF gs_application 'ActiveSheet' = gs_activesheet .
SET PROPERTY OF gs_activesheet 'Name' = gv_sheet_name .
*--For the rest of loops, other sheets are added
ELSE .
GET PROPERTY OF gs_wbook 'Sheets' = gs_sheets .
CALL METHOD OF gs_sheets 'Add' = gs_newsheet .
SET PROPERTY OF gs_newsheet 'Name' = gv_sheet_name .
ENDIF .
gv_line_cntr = 1 . "line counter
*--Title
*--Selecting cell area to be merged.
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING
#1 = 1
#2 = 4.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING
#1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
*--Merging
CALL METHOD OF gs_cells 'Merge' .
*--Setting title data
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 1.
SET PROPERTY OF gs_cell1 'Value' = 'KISHAN' .
*--Formatting the title
GET PROPERTY OF gs_cell1 'Font' = gs_font .
SET PROPERTY OF gs_font 'Underline' = 2 .
SET PROPERTY OF gs_font 'Bold' = 1 .
SET PROPERTY OF gs_cell1 'HorizontalAlignment' = -4108 .
GET PROPERTY OF gs_cell1 'Interior' = gs_interior .
SET PROPERTY OF gs_interior 'ColorIndex' = 15 .
SET PROPERTY OF gs_interior 'Pattern' = -4124 .
SET PROPERTY OF gs_interior 'PatternColorIndex' = -4105 .
gv_line_cntr = gv_line_cntr + 1 .
*--Writing some additional data for the title
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 1.
SET PROPERTY OF gs_cell1 'Value' = 'Sheet No' .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 5.
SET PROPERTY OF gs_cell1 'Value' = ':' .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 6.
SET PROPERTY OF gs_cell1 'Value' = gv_intex .
*--Formatting the area of additional data 1
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING
#1 = gv_line_cntr
#2 = 5.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING
#1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF gs_cells 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*--Formatting the area of additional data 2
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = 1
#2 = 5.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING
#1 = gv_line_cntr
#2 = 5.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING
#1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF gs_cells 'Columns' = gs_columns .
CALL METHOD OF gs_columns 'AutoFit' .
*--Bordering title data area
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING
#1 = gv_line_cntr
#2 = 6.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING
#1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
CALL METHOD OF gs_cells 'BorderAround'
EXPORTING
#1 = 1 "continuous line
#2 = 4. "thick
*--Putting axis labels
gv_colno = 2 .
gv_line_cntr = gv_line_cntr + 5 .
gv_linno = gv_line_cntr - 1 .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_linno
#2 = 1.
SET PROPERTY OF gs_cell1 'Value' = 'X' .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 1.
SET PROPERTY OF gs_cell1 'Value' = 'Y' .
*--Generating some data
DO 3 TIMES .
gv_value = gv_outer_index * sy-index * 10 .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_linno
#2 = gv_colno.
SET PROPERTY OF gs_cell1 'Value' = sy-index .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = gv_colno.
SET PROPERTY OF gs_cell1 'Value' = gv_value .
gv_colno = gv_colno + 1 .
ENDDO .
*--Source data area
gv_colno = gv_colno - 1 .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING #1 = gv_linno
#2 = 1.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING #1 = gv_line_cntr
#2 = gv_colno.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING #1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF gs_application 'Charts' = gs_charts .
CALL METHOD OF gs_charts 'Add' = gs_chart .
CALL METHOD OF gs_chart 'Activate' .
SET PROPERTY OF gs_chart 'ChartType' = '51' . "Vertical bar graph
CALL METHOD OF gs_chart 'SetSourceData'
EXPORTING #1 = gs_cells
#2 = 1.
SET PROPERTY OF gs_chart 'HasTitle' = 1 .
GET PROPERTY OF gs_chart 'ChartTitle' = gs_charttitle .
GET PROPERTY OF gs_charttitle 'Characters' = gs_charttitlechar .
SET PROPERTY OF gs_charttitlechar 'Text' = 'Sample Graph' .
*--Locate the chart onto the current worksheet
*--Activate current sheet
CALL METHOD OF gs_excel 'WorkSheets' = gs_activesheet
EXPORTING #1 = gv_sheet_name.
CALL METHOD OF gs_activesheet 'Activate' .
CALL METHOD OF gs_chart 'Location'
EXPORTING #1 = 2
#2 = gv_sheet_name.
*--Reposition the chart on the worksheet (cut&paste)
CALL METHOD OF gs_activesheet 'ChartObjects' = gs_chartobjects .
CALL METHOD OF gs_chartobjects 'Select' .
CALL METHOD OF gs_chartobjects 'Cut' .
*--Select new area
gv_line_cntr = gv_line_cntr + 2 .
CALL METHOD OF gs_excel 'Cells' = gs_cell1
EXPORTING
#1 = gv_line_cntr
#2 = 1.
CALL METHOD OF gs_excel 'Cells' = gs_cell2
EXPORTING
#1 = gv_line_cntr
#2 = 1.
CALL METHOD OF gs_excel 'Range' = gs_cells
EXPORTING
#1 = gs_cell1
#2 = gs_cell2.
CALL METHOD OF gs_cells 'Select' .
CALL METHOD OF gs_activesheet 'Paste' .
enddo.
*--Deallocating memory
FREE: gs_excel, gs_wbooklist, gs_application, gs_wbook,
gs_activesheet,gs_sheets, gs_newsheet, gs_cell1,
gs_cell2, gs_cells, gs_range, gs_font, gs_interior,
gs_columns, gs_charts, gs_chart, gs_charttitle,
gs_charttitlechar, gs_chartobjects .
Thanks
SujanaExample for differt graph formats, try with different options
CALL METHOD OF ACTIVECHART 'APPLYCUSTOMTYPE' = APPLYCUSTOMTYPE
EXPORTING
#1 = '21'
#2 = 'Line - Column on 2 Axes'.
or
CALL METHOD OF ACTIVECHART 'Axes' = AXIS
EXPORTING
#1 = 1. "1='xlCategory'.
or
CALL METHOD OF ACTIVECHART 'Axes' = AXIS
EXPORTING
#1 = 2. "2='xlValue'.
Regds
Manohar -
Hi all,
I am downloading data to excel by using OLE2 type pool in an ABAP program.
My requirement is to make some of the columns of the excel sheet bold.
is it possible? if so please guide me.
LOOP AT IT_FINAL1 INTO WA_FINAL1.
R_IND = 1 + R_IND.
INDEX = 1 + SY-TABIX .
CLEAR IND.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE WA_FINAL1 TO <I_OUTPUT>.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
IND = SY-INDEX.
CALL METHOD OF SHEET 'Cells' = CELLS EXPORTING #1 = INDEX
#2 = IND. "1
SET PROPERTY OF CELLS 'Value' = <I_OUTPUT>.
ENDDO.
CALL METHOD OF APPLICATION 'Cells' = CELL1
EXPORTING #1 = 1
#2 = 7.
CALL METHOD OF APPLICATION 'Cells' = CELL2
EXPORTING
#1 = INDEX "down
#2 = 7. "across
ENDLOOP.
I have used the above code.
here 7th column, 10th column, 13th column has to be made bold and so on.
regards,
samarendra.
Edited by: samarendra penugonda on May 26, 2009 12:57 PMHello,
Check this standard program it is printing some values in bold.
RSDEMO01
Example
SET PROPERTY OF H_F 'Bold' = BOLD . -
Error in XXL_FULL_API function module for download report to excel
Hi all,
I am using XXL_FULL_API function module for download report to excel, In this FM we have to fill a table called sema = t_gxxlt_s. in this table we have a fields called
i_sema-col_no = 19.
i_sema-col_src = 19.
i_sema-col_typ = 'STR'.
i_sema-col_ops = 'DFT'
here in 'col_typ' if we put STR in excel it will come as a text but i wnat the time field what i have to pass ?
and for filed 'col_ops' also ??
Thaks,
SridharHi sridhar joshi,
Please check this program
REPORT Excel.
TABLES:
sflight.
* header data................................
DATA :
header1 LIKE gxxlt_p-text VALUE 'Suresh',
header2 LIKE gxxlt_p-text VALUE 'Excel sheet'.
* Internal table for holding the SFLIGHT data
DATA BEGIN OF t_sflight OCCURS 0.
INCLUDE STRUCTURE sflight.
DATA END OF t_sflight.
* Internal table for holding the horizontal key.
DATA BEGIN OF t_hkey OCCURS 0.
INCLUDE STRUCTURE gxxlt_h.
DATA END OF t_hkey .
* Internal table for holding the vertical key.
DATA BEGIN OF t_vkey OCCURS 0.
INCLUDE STRUCTURE gxxlt_v.
DATA END OF t_vkey .
* Internal table for holding the online text....
DATA BEGIN OF t_online OCCURS 0.
INCLUDE STRUCTURE gxxlt_o.
DATA END OF t_online.
* Internal table to hold print text.............
DATA BEGIN OF t_print OCCURS 0.
INCLUDE STRUCTURE gxxlt_p.
DATA END OF t_print.
* Internal table to hold SEMA data..............
DATA BEGIN OF t_sema OCCURS 0.
INCLUDE STRUCTURE gxxlt_s.
DATA END OF t_sema.
* Retreiving data from sflight.
SELECT * FROM sflight
INTO TABLE t_sflight.
* Text which will be displayed online is declared here....
t_online-line_no = '1'.
t_online-info_name = 'Created by'.
t_online-info_value = 'KODANDARAMI REDDY'.
APPEND t_online.
* Text which will be printed out..........................
t_print-hf = 'H'.
t_print-lcr = 'L'.
t_print-line_no = '1'.
t_print-text = 'This is the header'.
APPEND t_print.
t_print-hf = 'F'.
t_print-lcr = 'C'.
t_print-line_no = '1'.
t_print-text = 'This is the footer'.
APPEND t_print.
* Defining the vertical key columns.......
t_vkey-col_no = '1'.
t_vkey-col_name = 'MANDT'.
APPEND t_vkey.
t_vkey-col_no = '2'.
t_vkey-col_name = 'CARRID'.
APPEND t_vkey.
t_vkey-col_no = '3'.
t_vkey-col_name = 'CONNID'.
APPEND t_vkey.
t_vkey-col_no = '4'.
t_vkey-col_name = 'FLDATE'.
APPEND t_vkey.
* Header text for the data columns................
t_hkey-row_no = '1'.
t_hkey-col_no = 1.
t_hkey-col_name = 'PRICE'.
APPEND t_hkey.
t_hkey-col_no = 2.
t_hkey-col_name = 'CURRENCY'.
APPEND t_hkey.
t_hkey-col_no = 3.
t_hkey-col_name = 'PLANETYPE'.
APPEND t_hkey.
t_hkey-col_no = 4.
t_hkey-col_name = 'SEATSMAX'.
APPEND t_hkey.
t_hkey-col_no = 5.
t_hkey-col_name = 'SEATSOCC'.
APPEND t_hkey.
t_hkey-col_no = 6.
t_hkey-col_name = 'PAYMENTSUM'.
APPEND t_hkey.
* populating the SEMA data..........................
t_sema-col_no = 1.
t_sema-col_typ = 'STR'.
t_sema-col_ops = 'DFT'.
APPEND t_sema.
t_sema-col_no = 2.
APPEND t_sema.
t_sema-col_no = 3.
APPEND t_sema.
t_sema-col_no = 4.
APPEND t_sema.
t_sema-col_no = 5.
APPEND t_sema.
t_sema-col_no = 6.
APPEND t_sema.
t_sema-col_no = 7.
APPEND t_sema.
t_sema-col_no = 8.
APPEND t_sema.
t_sema-col_no = 9.
APPEND t_sema.
t_sema-col_no = 10.
t_sema-col_typ = 'NUM'.
t_sema-col_ops = 'ADD'.
APPEND t_sema.
CALL FUNCTION 'XXL_FULL_API'
EXPORTING
* DATA_ENDING_AT = 54
* DATA_STARTING_AT = 5
filename = 'TESTFILE'
header_1 = header1
header_2 = header2
no_dialog = 'X'
no_start = ' '
n_att_cols = 6
n_hrz_keys = 1
n_vrt_keys = 4
sema_type = 'X'
* SO_TITLE = ' '
TABLES
data = t_sflight
hkey = t_hkey
online_text = t_online
print_text = t_print
sema = t_sema
vkey = t_vkey
EXCEPTIONS
cancelled_by_user = 1
data_too_big = 2
dim_mismatch_data = 3
dim_mismatch_sema = 4
dim_mismatch_vkey = 5
error_in_hkey = 6
error_in_sema = 7
file_open_error = 8
file_write_error = 9
inv_data_range = 10
inv_winsys = 11
inv_xxl = 12
OTHERS = 13
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
please refer this link
http://www.thespot4sap.com/Articles/Download_to_excel.asp
Best regards,
raam -
ALV grid report - Download total to excel
Hi,
In ALV report I am calculating Gross profit%.
*Gross profit% = ( (NetValue- Cost value) * 100 )/ CostValue.*
Report strcture is as below.
Region Article Netvalue CostValue Grossprofit%
A 1 100 80 25
A 2 150 140 7.14
total 250 220 13.64
In total i am calulating Gross profit over Total-Netvalue and Total-Costvalue.
report is working fine but while downloading data in excel or any other format, Gross profit% in Total row comes up as summation of all the rows. for example if i download above records grossprofit% will be 32.14 which is wrong.
Please suggest.it.s normal,
please deactivate option sum on excel file.
regards
r -
Download ALV to EXcel- Urgent pls help me
Please help me in this...
I have an ALV report around 120 column. The report is displayed perfectly on screen. But when I use the Export option to download as an excel file, some data is missing in SAP No field
For example
My report output is like this
sap No Name Jobdes. Dept
00021 AAA clerk1 FI
00022 BBB clerk1 FI
00023 CCC clerk1 FI
00024 DDD clerk1 FI
00025 EEE clerk1 FI
00026 FFF clerk1 FI
Excel output is
sap No Name Jobdes. Dept
00021 AAA clerk1 FI
Blank BBB clerk1 FI
Blank CCC clerk1 FI
Blank DDD clerk1 FI
00025 EEE clerk1 FI
Blank FFF clerk1 FI
Pls help meHi Kumar,
Pls try the below Function Modules to download the data to excel.
ALSM_EXCEL_TO_INTERNAL_TABLE
KCD_EXCEL_OLE_TO_INT_CONVERT Uploads data directly from Excel sheet
RH_START_EXCEL_WITH_DATA Starts Excel with contents of an internal table
or the below links also might help you.
For uploading Excel to Internal Table??????
Data from Excel sheet to my internal table
Check the following link:
http://www.sap-img.com/abap/upload-direct-excel.htm
or even the below code might be helpful.
Multiple excel sheets generation in a workbook
CREATE OBJECT EXCEL 'EXCEL.SHEET'.
GET PROPERTY OF EXCEL 'Application' = APPLICATION.
SET PROPERTY OF APPLICATION 'Visible' = 1.
CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
CALL METHOD OF BOOKS 'Add' = BOOK.
CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
CALL METHOD OF SHEET 'ADD'.
Fill all the sheets with relavant data
PERFORM SHEET1 TABLES ITAB1.
PERFORM SHEET2 TABLES ITAB2.
PERFORM SHEET3 TABLES ITAB3.
PERFORM SHEET4 TABLES ITAB4.
Quit the excel after use
CALL METHOD OF EXCEL 'QUIT'.
FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
CLEAR V_SHEET.
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
EXPORTING #1 = ROW #2 = COL.
SET PROPERTY OF CELL 'value' = VAL.
FREE OBJECT CELL NO FLUSH.
ENDFORM. " FILL_CELL
FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
V_SHEET = Sheet Name.
V_NO = V_NO + 1.
CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
CALL METHOD OF SHEET 'Columns' = COLUMN.
FREE OBJECT SHEET.
CALL METHOD OF COLUMN 'Autofit'.
FREE OBJECT COLUMN.
ENDFORM.
Repeat above procedure for all sheets you want to add
FORM FILL_SHEET1
TABLES ITAB1 STRUCTURE ITAB1
USING V_NO V_SHEET.
ROW = 1.
PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
ROW = ROW + 1.
LOOP AT ITAB1.
PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
ROW = ROW + 1.
ENDLOOP.
ENDFORM.
Repeat above procedure for all sheets you want to add
Try this also
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
Upload Excel file
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file
TABLES
i_tab_converted_data = i_XCEL[]
EXCEPTIONS
conversion_failed = 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.
Pls reward if useful.
THanks,
Sirisha -
Hi all,
i am trying to download ALV to excel file.
but as the alv contains many fields,
the row in the excel is automatically wrapped to the
next row ..
what i want is the row in excel should come as it is
in the ALV (whole thing in one line) and should not wrap to next row
Regards,
TarangHi Shah,
<b>
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'</b>
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = WA_LAYOUT
I_SAVE = 'A'
IT_FIELDCAT = I_FLDCAT_HEAD
IT_SORT = IT_SORT
IT_EVENTS = I_EVENTS
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC = 0.
<b> CALL FUNCTION 'GUI_DOWNLOAD'</b>
EXPORTING
BIN_FILESIZE =
FILENAME = 'C:\Documents and Settings\vikranthk\Desktop\vikranth.xls'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = it_final.
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
Thanks
Vikranth Khimavath
Message was edited by: Khimavath Vikranth -
hi all,
i have a situation, i want to download the data of an alv grid display to a excel sheet, is there any other way of doin it other than choosing from the List menu, coz when i click the excel sheet button on the application tool bar i get a blank excel sheet, do i need to pass any parameters ??? can any one plz gimme the funtionality of this.
thansk
anupamaHi,
I am giving u a sample code to download dat ato excel.
try to use it.
CONSTANTS:c_x(1) TYPE c VALUE'X',
lc_a(1) TYPE c VALUE 'A',
c_p2(2) TYPE c VALUE 'P2',
c_dir TYPE string VALUE 'C:\',
c_ext TYPE string VALUE 'XLS'.
DATA: fullpath TYPE string, "Full path of the file
filename TYPE string, "Name of the excel file
path TYPE string, "Path where the file will be stored
user_action TYPE i , "To catch User Action
l_title TYPE string. "To display title
* encoding TYPE abap_encoding.
l_title = 'Save File'(006).
* Open the save dialog
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = l_title
default_extension = c_ext
initial_directory = c_dir
CHANGING
filename = filename
path = path
fullpath = fullpath
user_action = user_action
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
EXIT.
ENDIF.
** Check which button is pressed
IF user_action <> cl_gui_frontend_services=>action_ok.
MESSAGE i006. "Action Cancelled By User
EXIT.
ENDIF.
* Download error data collected from the internal table
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = fullpath
filetype = 'ASC'
write_field_separator = '#'
CHANGING
data_tab = gi_final "Your InterNal Table Name
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
* If selection is successful
IF sy-subrc EQ 0.
MESSAGE s004 . " File created successfully
ELSE.
MESSAGE i005 . " File is not created successfully
ENDIF. -
Download Data From Excel - VBA Code to SAP Using BDC
Hi ,
I am Sudhir Dure, working with Satyam Computers.
I need help on the below query:
I have an excel file which download data from Excel to SAP using RFC function & with the help of VBA interface.
In this VBA code I have used BDC recording of SAP Transaction KE21N to post data into SAP.
Now I am facing problem to find sub screen (tab page screen ) in SAP from VBA code .
How to pass BDC Subscreen details from VBA code to SAP using below code?
BDCTABLE.Rows.Add
BDCTABLE.Cell(J, "PROGRAM") = PROGRAMNAME
BDCTABLE.Cell(J, "DYNPRO") = "0200"
BDCTABLE.Cell(J, "DYNBEGIN") = "X"
BDCTABLE.Cell(J, "FNAM") = "BDC_OKCODE"
BDCTABLE.Cell(J, "FVAL") = "=NEXT"
Thanks,
Sudhir Dure
9972097464can anyone tell me how to get the PurchaseOrder number and item quantity from the Salesorder...? what are the fields here as given below..??
For Each oItem In oSalesOrder.items
wsTemplate.Range(cols(3) & Indexv).Value = oItem.material.material
'wsTemplate.Range(cols(4) & Indexv).Value = ' I need item quantity here ????
wsTemplate.Range(cols(1) & Indexv).Value = sapSoNumber
wsTemplate.Range(cols(2) & Indexv).Value = ' I need purchase order number here>???
Indexv = (Indexv + 1)
Next
reply fast. please .. thanks -
Download functionality in EXCEL and PDF format to the Webdynpro iView
Hi Expert,
I am using NW 7.0 ehp1 sp3. I developed some Webdynpro RFC model application for the product catalog of the material related data.
Now my requirement is to provide the download functionality in EXCEL and PDF format to all of these Webdynpro (java) iView.
How we can achieve this requirement? In which part of the webdynpro application we have to write the code?
Someone can help me very clearly in steps to achieve this?
Thanks,
KundanHi,
I don't think it is possible to redirect the html stream of the Web Dynpro iView to a PDF / Excel document, since it essentially would mean you have to call the Web Dynpro application again, maintaining the state and context of the iview itself
However, using (for instance) the JExcelApi (Excel) or iText (PDF) you could create documents using the data displayed in your Web Dynpro iView, which has the added benefit you could design and layout your PDF / Excel documents in a more suitable layout for printing (most WD applications look horrible when printed)
Cheers,
Robin -
Downloading data in excel sheet
Hi All,
I want to download data in excel sheet. My requirment is to use the same excle sheet to fill data.
The next data should be entered in the column of the excel sheet. Is there a possible to write data in excel sheet at a particular row/column.
Please let me know if this can be achevied?
For Ex:
Data: 10, 20, 30
Excel sheet:
10
20
30
Data: 40, 50, 60
Excel sheet:
10 40
20 50
30 60
Thanks & Regards,
Rupali RayHi,
This should be possible by OLE concept.
Have a look at report RSDEMO01
Regards -
Ability to download Spool into Excel
Hi,
I have a requirement that the ALV report needs to be run in background with ability to download spool into excel .Can anyone please help in this regard.
Many Thanks,
SharathHi,
First check whether the status of the job is Completed or Cancelled.
WHILE 1 = 1.
* GET THE JOB STEPLIST WHICH HAS THE SPOOL NUMBER
CALL FUNCTION 'BP_JOB_READ'
EXPORTING
job_read_jobcount = w_jobcount
job_read_jobname = w_jobname
job_read_opcode = '35'
* JOB_STEP_NUMBER =
IMPORTING
job_read_jobhead = wa_jobhead
TABLES
job_read_steplist = i_jobsteplist
* CHANGING
* RET =
EXCEPTIONS
invalid_opcode = 1
job_doesnt_exist = 2
job_doesnt_have_steps = 3
OTHERS = 4
IF sy-subrc 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* IF STATUS OF JOB IS COMPLETED(F) OR CANCELLED(A)
* READ THE JOBSTEPLIST & GET THE SPOOL NUMBER
IF wa_jobhead-status = c_a OR wa_jobhead-status = c_f.
READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.
CHECK wa_jobsteplist-listident space.
w_spool_number = wa_jobsteplist-listident.
EXIT.
ENDIF.
ENDWHILE.
Use FM "RSPO_DOWNLOAD_SPOOLJOB".
Best Regards,
Sunil. -
How to Download Data in Excel Formate
Hi Friend,
I have one doubt on webdynpro with java. Req: For download data in Excel formate.
I will follow this http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3596. [original link is broken] [original link is broken] [original link is broken]
i am doing upto 3rd Step here.. Up to Step 3 i am doing after 3rd Step I am not understand. Could u explain 4step.
1. I have to place TableUtilities.java
2. I have Create tableutilities value attribute
3. in Modify view--- This is -SecondView -
This is having Table UI Element.
if(firstTime)
IWDTextView tv = (IWDTextView)view.getElement("total");
wdContext.currentContextElement().setTableutility(new TableUtilities(wdContext.nodeDepartments()));
//Returns attribute info of a dynamically created attribute which can be bound to the UI element neeed.
tv.bindText(wdContext.currentContextElement().getTableutility().CalculateSum("Departments","NoOfPeople"));
4. Creating an Excel File
How to Create Excel File here can u explain
I am not understand this 4th step. Pls give me Breef Explanation. How to write this code...here...
Regards
Vijay Kalluri
Edited by: KalluriVijay on May 4, 2010 8:00 PM
Edited by: KalluriVijay on May 4, 2010 8:02 PMHi Vijay,
Please open Microsoft Excel from your system and then create some entries (ex. having 3 columns and 3 rows). Save this file to some location in your system. Later you will need to give the location path of this saved file when uploading it from your web dynpro application.
Creating of an Excel file (i.e the 4th step) is no where related to Web Dynpro and NWDS.
Hope this helps!
Regards,
Kishan -
How to download data in excel from web report in sap ?
how to download data in excel from web report made in sap abap?
through tcode smw0.for exemple using
MS_EXCEL_OLE_STANDARD_DAT
Maybe you are looking for
-
Creating a Video "Library" in Pr
Hi, Recently I have decided to make the switch from Final Cut Pro X to premiere pro. This switch is mainly due to the cool dynamic link features in premiere. I generally edit video mashups/compilations as backdrop visuals for DJs. Some of my videos i
-
Dear colleagues, I have a dynamic rounding profile in my info record saying that PO quantities shall be rounded up to the whole transport box if the qty exceeds 40% of the box and down to the whole box if the quantity is lower than that. This works f
-
Subtotal in single subject area
HI Experts, i have dim table where i have 5 record like below Dim1 dim2 dim3 dim4 dim5 for subtotal i am going to split as dim1 + dim2 as subtotal 1 then dim3 dim4dim5 as subtoal 2 now i have already used all records,further if i try to split like di
-
Re: accelerated depr for few assets
Hi Gurus, I would like to run the Accelerated Depreciation for few Assets for 4 months, I need to post 3 months in June and 1 month in July base on net book value base on new percentage, and only part of some assets need to be impaired. As the normal
-
Hi I have 7 versions of message mappings in my IR. I want to revert back to 6th version. How to select the 6th version as my current version ?? thanks kumar