Reading out grid to excel
Hello,
As I'm new to scripting in SAP (and programming in general) I'm trying to read out an sap grid to excel.
Below is my code which is (partly) working, however it only fills 96 lines in excel.
I tried 'SapGuiGridScrollToRow' to scroll every 90 lines read because I thought it had to do with some 'preloading' of the grid. However this function always gives me an error, so I put it in comments.
Is there a limit on the number of lines that can be read from a grid?
How can I overcome this?
Are there more efficient ways to do this?
Dim xclRow
Dim sapRow
Dim artNr
'Excel
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = xclapp.Workbooks.Add()
' With xclwbk
' .Title = "ArtSer"
' .SaveAs Filename = "artser.xls"
' End With
Set objSheet = xclwbk.Sheets(1)
xclapp.Visible = true
objSheet.cells(1,1) = "Artikelnummer" 'MATNR
objSheet.cells(1,2) = "Serienummer" 'SERNR
xclRow = 2
'session.findbyId(wnd[0]------).Value = objsheet.cells(1,1).value 'for example Never use the Range Object---
'SAP
sapRow = 0
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "iq09"
session.findById("wnd[0]").sendVKey 0
'Artikelnummer Fabricom
artNr = Inputbox("Geef een artikelnummer:","Artikelnummer")
session.findById("wnd[0]/usr/ctxtMATNR-LOW").text = artNr
session.findById("wnd[0]/usr/ctxtMATNR-LOW").setFocus
'session.findById("wnd[0]/usr/txtMATNR-LOW").caretPosition = 6
session.findById("wnd[0]").sendVKey 8
Set GRID1 = session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell")
'msgbox(GRID1.rowcount)
for sapRow = 0 to GRID1.rowCount - 1
'session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"MATNR")<>""
objSheet.cells(xclRow,1) = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"MATNR")
objSheet.cells(xclRow,2) = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"SERNR")
'sapRow = sapRow+1
xclRow = xclRow+1
'If sapRow Mod 90 Then
' SapGuiGridScrollToRow "wnd[0]/usr/cntlGRID1/shellcont/shell", sapRow
'End If
next
MsgBox("Done")
For reference the complete and working script:
Dim xclRow
Dim sapRow
Dim artNr
'Excel
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = xclapp.Workbooks.Add()
' With xclwbk
' .Title = "ArtSer"
' .SaveAs Filename = "matser.xls"
' End With
Set objSheet = xclwbk.Sheets(1)
xclapp.Visible = true
objSheet.cells(1,1) = "Materialnumber" 'MATNR
objSheet.cells(1,2) = "Serial number" 'SERNR
xclRow = 2
'session.findbyId(wnd[0]------).Value = objsheet.cells(1,1).value 'for example Never use the Range Object---
'SAP
sapRow = 0
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
'session.findById("wnd[0]").maximize
session.findById("wnd[0]").iconify
session.findById("wnd[0]/tbar[0]/okcd").text = "iq09" 'Use transaction IQ09
session.findById("wnd[0]").sendVKey 0
artNr = Inputbox("Enter Material Number (Serial):","Materialnumber")
session.findById("wnd[0]/usr/ctxtMATNR-LOW").text = artNr
session.findById("wnd[0]/usr/ctxtMATNR-LOW").setFocus
session.findById("wnd[0]").sendVKey 8
Set GRID1 = session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell")
'msgbox(GRID1.rowcount)
for sapRow = 0 to GRID1.rowCount - 1
'session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"MATNR")<>""
'objSheet.cells(xclRow,1) = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"MATNR")
objSheet.cells(xclRow,1) = GRID1.GetCellValue(sapRow,"MATNR")
'objSheet.cells(xclRow,2) = session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").GetCellValue(sapRow,"SERNR")
objSheet.cells(xclRow,2) = GRID1.GetCellValue(sapRow,"SERNR")
'sapRow = sapRow+1
xclRow = xclRow+1
'Scroll cells
If sapRow Mod 90 And sapRow<GRID1.rowCount - 1 Then
GRID1.setCurrentCell sapRow+1, "MATNR"
End If
'If sapRow Mod 90 Then
' SapGuiGridScrollToRow "wnd[0]/usr/cntlGRID1/shellcont/shell", sapRow
'End If
next
MsgBox("Done")
Similar Messages
-
Facing a Problem while downloading the data from ALV Grid to Excel Sheet
Hi Friends,
Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
Can any one help me out in this case.hi...
if this problems happens dont display the same internal as u finally got.
just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
for eg.
ur final internal int table for disp,
data : begin of itab occur 0,
matnr like mara-matnr,
end of itab.
create new like this,
data : begin of itab occur 0,
matnr(12) type N,
end of itab. -
Reading long text from excel file to an internal table
Hi
Can any body tell me how to read long text from excel file to an internal table.
When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
may i know which FM or what logic i need to use for this problem.
RegardsHi,
Here is an example program. It will upload an Excel file with two columns. You could also assign the Excel structure dynamically, but I wanted to keep the example simple. The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
Remember, this is just an example to help you figure out how to properly use the technique. It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
*& Report zexcel_upload_test *
REPORT zexcel_upload_test.
TYPE-POOLS: truxs.
TYPES: BEGIN OF ty_excel,
col_a(10) TYPE n,
col_b(35) TYPE c,
END OF ty_excel.
DATA: l_data_tab TYPE TABLE OF string,
l_text_data TYPE truxs_t_text_data,
l_gui_filename TYPE string,
it_excel TYPE TABLE OF ty_excel.
FIELD-SYMBOLS: <wa_excel> TYPE ty_excel.
PARAMETERS: p_file TYPE rlgrap-filename.
* Pass the file name in the correct format
l_gui_filename = p_file.
* Upload data from PC
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_gui_filename
filetype = 'ASC'
has_field_separator = 'X'
CHANGING
data_tab = l_data_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* MESSAGE ...
EXIT.
ENDIF.
* Convert from Excel into the appropriate itab
l_text_data[] = l_data_tab[].
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = l_text_data
i_filename = p_file
TABLES
i_tab_converted_data = it_excel
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ...
EXIT.
ENDIF.
LOOP AT it_excel ASSIGNING <wa_excel>.
* Do something here...
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM filename_get CHANGING p_file.
* FORM filename_get *
FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
DATA: l_in_file TYPE string,
l_filetab TYPE filetable,
wa_filetab TYPE LINE OF filetable,
l_rc TYPE i,
l_action TYPE i,
l_init_dir TYPE string.
* Set the initial directory to whatever you want it to be
l_init_dir = 'C:\'.
* Call the file open dialog without multiselect
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Load file'
default_extension = '.XLS'
default_filename = l_in_file
initial_directory = l_init_dir
multiselection = 'X'
CHANGING
file_table = l_filetab
rc = l_rc
user_action = l_action
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
REFRESH l_filetab.
ENDIF.
* Read the selected filename
READ TABLE l_filetab INTO wa_filetab INDEX 1.
IF sy-subrc = 0.
p_in_file = wa_filetab-filename.
ENDIF.
ENDFORM. " filename_get
Regards,
Jamie -
Total problem in Exporting ALV GRID to Excel
Hi all,
I have manipulated the Total of ALV Grid by using GET_SUBTOTALS and REFRESH method of CL_GUI_ALV_GRID. The ALV Output is also correct. When i export to Excel,only the Original total is displaying not the calculated one. How to download the exact output which is displaying in the ALV Grid to Excel.
Please help me out to solve this.
Thanks,
RameshDEAR,
AS U WANT UPLOAD WITH THE SUB TOTAL YOU TRY THIS.
FIRST to get subtotal in ALV output you select at least one column of total and then press ctrl + F6 . u will see the sub total .
and now how to download it so press ctrl + shift + F9 .
now screen appears and select second option ie spreadsheet and press enter
now a screen appear in wich u have to give file name.
so double click on search button of file name . click on desktop give ur file name as u want suppose zreport u have given.
and save type = excel file.
now save it and then generate it your output bytes will be transmitted .
now u can see in your desktop in your file name . ur output with subtotal.
regards
navin -
ALV grid to excel (.XLS) format issue
im trying to export an ALV grid to excel file using FM 'GUI_DOWNLOAD'.
the output is located at the link below:
http://img393.imageshack.us/my.php?image=excelproblemjt4.jpg
some how the fields arent inside the individual boxes..
can anyone provide me with the solution? thanks
below are the codes of how i implement the 'GUI DOWNLOAD' FM
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file " C:\filename.xls
write_field_separator = 'X'
IMPORTING
filelength = lv_size
TABLES
data_tab = ltt_dataREPORT test0012 .
INCLUDE test_top.
INCLUDE test_f01.
INCLUDE test_alv.
START OF SELECTION
START-OF-SELECTION.
PERFORM get_data.
PERFORM process_data.
END-OF-SELECTION.
IF tt_output IS NOT INITIAL.
PERFORM prepare_excel_data.
Download CSV file to local
IF c_loc = 'X'.
PERFORM convert_to_xls.
PERFORM download_local.
ENDIF.
ELSE.
Show Message when no records selected
MESSAGE I016 WITH TEXT-005.
ENDIF.
PERFORM f_alv_disp.
*& Include test_TOP *
TABLES: vbrk, vbrp, vbak, vbap, kna1.
DATA: total_value TYPE p DECIMALS 2 LENGTH 15.
DATA: total TYPE c LENGTH 5 VALUE 'total'.
TYPE-POOLS
TYPE-POOLS: slis, truxs.
-ALV----
DATA:
wa_alv_layout TYPE slis_layout_alv,
tt_alv_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
tt_alv_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE,
tt_alv_events TYPE slis_t_event WITH HEADER LINE,
wa_sort TYPE slis_sortinfo_alv,
tt_sort TYPE slis_t_sortinfo_alv,
v_pagno TYPE sy-pagno,
s_keyinfo TYPE slis_keyinfo_alv.
TYPES
TYPES: BEGIN OF vbrk,
vbeln TYPE vbrk-vbeln,
fkdat TYPE vbrk-fkdat,
vkorg TYPE vbrk-vkorg,
vtweg TYPE vbrk-vtweg,
spart TYPE vbrk-spart,
kunag TYPE vbrk-kunag,
END OF vbrk,
BEGIN OF vbrp,
vbeln TYPE vbrp-vbeln,
aubel TYPE vbrp-aubel,
vgbel TYPE vbrp-vgbel,
aupos TYPE vbrp-aupos,
END OF vbrp,
BEGIN OF vbak,
vbeln TYPE vbak-vbeln,
auart TYPE vbak-auart,
bstnk TYPE vbak-bstnk,
END OF vbak,
BEGIN OF vbap,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
END OF vbap,
BEGIN OF kna1,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF kna1,
BEGIN OF output,
fkdat TYPE vbrk-fkdat,
vkorg TYPE vbrk-vkorg,
vtweg TYPE vbrk-vtweg,
spart TYPE vbrk-spart,
kunag TYPE vbrk-kunag,
name1 TYPE kna1-name1,
auart TYPE vbak-auart,
bstnk TYPE vbak-bstnk,
aubel TYPE vbrp-aubel,
vgbel TYPE vbrp-vgbel,
total LIKE total_value,
END OF output.
Type for download to excel use.
TYPES: BEGIN OF ty_excel,
col1(20), sp01,
col2(25), sp02,
col3(23), sp03,
col4(14), sp04,
col5(15), sp05,
col6(23), sp06,
col7(13), sp07,
col8(25), sp08,
col9(20), sp09,
col10(30), sp10,
col11(13),
END OF ty_excel.
DATA: wa_vbrk TYPE vbrk,
wa_vbrp TYPE vbrp,
wa_vbak TYPE vbak,
wa_vbap TYPE vbap,
wa_kna1 TYPE kna1,
wa_output TYPE output,
tt_vbrk TYPE STANDARD TABLE OF vbrk,
tt_vbrp TYPE STANDARD TABLE OF vbrp,
tt_vbak TYPE STANDARD TABLE OF vbak,
tt_vbap TYPE STANDARD TABLE OF vbap,
tt_kna1 TYPE STANDARD TABLE OF kna1,
tt_output TYPE STANDARD TABLE OF output.
Table for download to excel use.
DATA: tt_excel TYPE STANDARD TABLE OF ty_excel,
wa_excel LIKE LINE OF tt_excel,
tt_excel_output TYPE truxs_t_text_data.
wa_excel type ty_excel.
Data Declaration for CSV file use
CONSTANTS : c_comma TYPE c VALUE ','.
Selection-Screen
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
SELECT-OPTIONS: s_fkdat FOR vbrk-fkdat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b01.
SELECTION-SCREEN BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.
PARAMETERS: p_vkorg TYPE vbrk-vkorg OBLIGATORY.
SELECT-OPTIONS: s_vtweg FOR vbrk-vtweg,
s_spart FOR vbrk-spart.
SELECTION-SCREEN END OF BLOCK b02.
SELECTION-SCREEN BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
SELECT-OPTIONS: s_kunag FOR vbrk-kunag.
SELECTION-SCREEN END OF BLOCK b03.
SELECTION-SCREEN BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
PARAMETERS: c_loc AS CHECKBOX,
p_file LIKE rlgrap-filename DEFAULT 'C:\filename.txt'.
SELECTION-SCREEN END OF BLOCK b04.
*& Include test_F01 *
FORM get_data
FORM get_data.
DATA: lt_vbrk TYPE STANDARD TABLE OF vbrk,
lt_vbrp TYPE STANDARD TABLE OF vbrp.
SELECT vbeln fkdat vkorg vtweg spart kunag
FROM vbrk
INTO TABLE tt_vbrk
WHERE fkdat IN s_fkdat
AND vkorg = p_vkorg
AND vtweg IN s_vtweg
AND spart IN s_spart
AND kunag IN s_kunag.
lt_vbrk[] = tt_vbrk[].
SORT lt_vbrk BY vbeln.
IF lt_vbrk[] IS NOT INITIAL.
SELECT vbeln aubel vgbel aupos
FROM vbrp
INTO TABLE tt_vbrp
FOR ALL ENTRIES IN lt_vbrk
WHERE vbeln = lt_vbrk-vbeln.
ENDIF.
lt_vbrp[] = tt_vbrp[].
SORT lt_vbrp BY aubel.
IF lt_vbrp[] IS NOT INITIAL.
SELECT vbeln auart bstnk
FROM vbak
INTO TABLE tt_vbak
FOR ALL ENTRIES IN lt_vbrp
WHERE vbeln = lt_vbrp-aubel.
ENDIF.
lt_vbrp[] = tt_vbrp[].
SORT lt_vbrp BY aubel aupos.
IF lt_vbrp[] IS NOT INITIAL.
SELECT vbeln posnr netwr mwsbp
FROM vbap
INTO TABLE tt_vbap
FOR ALL ENTRIES IN lt_vbrp
WHERE vbeln = lt_vbrp-aubel
AND posnr = lt_vbrp-aupos.
ENDIF.
lt_vbrk[] = tt_vbrk[].
SORT lt_vbrk BY kunag.
IF lt_vbrk[] IS NOT INITIAL.
SELECT kunnr name1
FROM kna1
INTO TABLE tt_kna1
FOR ALL ENTRIES IN lt_vbrk
WHERE kunnr = lt_vbrk-kunag.
ENDIF.
ENDFORM. "get_data
*& Form process_data
FORM process_data.
LOOP AT tt_vbrk INTO wa_vbrk.
wa_output-fkdat = wa_vbrk-fkdat.
wa_output-vkorg = wa_vbrk-vkorg.
wa_output-vtweg = wa_vbrk-vtweg.
wa_output-spart = wa_vbrk-spart.
wa_output-kunag = wa_vbrk-kunag.
read table tt_vbrp into wa_vbrp with key vbeln = wa_vbrk-vbeln.
if sy-subrc = 0.
wa_output-aubel = wa_vbrp-aubel.
wa_output-vgbel = wa_vbrp-vgbel.
endif.
READ TABLE tt_kna1 INTO wa_kna1 WITH KEY kunnr = wa_vbrk-kunag BINARY SEARCH.
IF sy-subrc = 0.
wa_output-name1 = wa_kna1-name1.
ENDIF.
LOOP AT tt_vbrp INTO wa_vbrp WHERE vbeln = wa_vbrk-vbeln.
wa_output-aubel = wa_vbrp-aubel.
wa_output-vgbel = wa_vbrp-vgbel.
READ TABLE tt_vbak INTO wa_vbak WITH KEY vbeln = wa_vbrp-aubel BINARY SEARCH.
IF sy-subrc = 0.
wa_output-auart = wa_vbak-auart.
wa_output-bstnk = wa_vbak-bstnk.
ENDIF.
READ TABLE tt_vbap INTO wa_vbap WITH KEY vbeln = wa_vbrp-aubel
posnr = wa_vbrp-aupos BINARY SEARCH.
wa_output-total = wa_vbap-netwr + wa_vbap-mwsbp.
APPEND wa_output TO tt_output.
ENDLOOP. "endloop tt_vbrp
wa_output-total = wa_vbap-netwr + wa_vbap-mwsbp.
append wa_output to tt_output.
CLEAR wa_output.
ENDLOOP. "endloop vbrk
ENDFORM. "process_data
*& Form APPEND_EXCEL
FORM append_excel .
wa_excel-sp01 = wa_excel-sp02 = wa_excel-sp03 =
wa_excel-sp04 = wa_excel-sp05 = wa_excel-sp06 =
wa_excel-sp07 = wa_excel-sp08 = wa_excel-sp09 =
wa_excel-sp10.
APPEND wa_excel TO tt_excel. CLEAR wa_excel.
ENDFORM. " APPEND_EXCEL
*& Form PREPARE_EXCEL_DATA
FORM prepare_excel_data .
List's Header for excel file
WRITE 'Billing Date' TO wa_excel-col1.
WRITE 'Sales Organization' TO wa_excel-col2.
WRITE 'Distribution Channel' TO wa_excel-col3.
WRITE 'Division' TO wa_excel-col4.
WRITE 'Sold-to Party' TO wa_excel-col5.
WRITE 'Name of Sold-to Party' TO wa_excel-col6.
WRITE 'Order Type' TO wa_excel-col7.
WRITE 'Customer PO Number' TO wa_excel-col8.
WRITE 'Sales Order Number' TO wa_excel-col9.
WRITE 'Delivery Order Number' TO wa_excel-col10.
WRITE 'Total Value' TO wa_excel-col11.
PERFORM append_excel.
Item data for excel file.
LOOP AT tt_output INTO wa_output.
WRITE wa_output-fkdat TO wa_excel-col1.
WRITE wa_output-vkorg TO wa_excel-col2.
WRITE wa_output-vtweg TO wa_excel-col3.
WRITE wa_output-spart TO wa_excel-col4.
WRITE wa_output-kunag TO wa_excel-col5.
WRITE wa_output-name1 TO wa_excel-col6.
WRITE wa_output-auart TO wa_excel-col7.
WRITE wa_output-bstnk TO wa_excel-col8.
WRITE wa_output-aubel TO wa_excel-col9.
WRITE wa_output-vgbel TO wa_excel-col10.
WRITE wa_output-total TO wa_excel-col11.
PERFORM append_excel.
ENDLOOP.
List's Header for excel file
CONCATENATE '"' 'Billing Date' '"' INTO WA_EXCEL-COL1.
CONCATENATE '"' 'Sales Organization' '"' INTO WA_EXCEL-COL2.
CONCATENATE '"' 'Distribution Channel' '"' INTO WA_EXCEL-COL3.
CONCATENATE '"' 'Division' '"' INTO WA_EXCEL-COL4.
CONCATENATE '"' 'Sold-to Party' '"' INTO WA_EXCEL-COL5.
CONCATENATE '"' 'Name of Sold-to Party' '"' INTO WA_EXCEL-COL6.
CONCATENATE '"' 'Order Type' '"' INTO WA_EXCEL-COL7.
CONCATENATE '"' 'Customer PO Number' '"' INTO WA_EXCEL-COL8.
CONCATENATE '"' 'Sales Order Number' '"' INTO WA_EXCEL-COL9.
CONCATENATE '"' 'Delivery Order Number' '"' INTO WA_EXCEL-COL10.
CONCATENATE '"' 'Total Value' '"' INTO WA_EXCEL-COL11.
PERFORM APPEND_EXCEL.
Item data for excel file.
LOOP AT TT_output INTO WA_output.
CONCATENATE '"' WA_OUTPUT-FKDAT '"' INTO WA_EXCEL-COL1.
CONCATENATE '"' WA_OUTPUT-VKORG '"' INTO WA_EXCEL-COL2.
CONCATENATE '"' WA_OUTPUT-VTWEG '"' INTO WA_EXCEL-COL3.
CONCATENATE '"' WA_OUTPUT-SPART '"' INTO WA_EXCEL-COL4.
CONCATENATE '"' WA_OUTPUT-KUNAG '"' INTO WA_EXCEL-COL5.
CONCATENATE '"' WA_OUTPUT-NAME1 '"' INTO WA_EXCEL-COL6.
CONCATENATE '"' WA_OUTPUT-AUART '"' INTO WA_EXCEL-COL7.
CONCATENATE '"' WA_OUTPUT-BSTNK '"' INTO WA_EXCEL-COL8.
CONCATENATE '"' WA_OUTPUT-AUBEL '"' INTO WA_EXCEL-COL9.
CONCATENATE '"' WA_OUTPUT-VGBEL '"' INTO WA_EXCEL-COL10.
CONCATENATE '"' total '"' INTO WA_EXCEL-COL11.
PERFORM APPEND_EXCEL.
ENDLOOP.
ENDFORM. " PREPARE_EXCEL_DATA
*& Form Convert_to_xls
*form Convert_to_xls.
LOOP AT TT_EXCEL INTO WA_EXCEL.
MOVE WA_EXCEL TO LTT_DATA-TEXT.
APPEND LTT_DATA. CLEAR LTT_DATA.
ENDLOOP.
LV_FILE = P_FILE.
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ';'
I_LINE_HEADER =
i_filename = lv_file
I_APPL_KEEP = ' '
tables
i_tab_sap_data = LTT_DATA
CHANGING
I_TAB_CONVERTED_DATA = tt_excel_output
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.
*endform.
*& Form DOWNLOAD_LOCAL
FORM download_local .
TYPES:
BEGIN OF lty_data,
text(800),
END OF lty_data.
DATA:
lv_file TYPE string,
lv_size TYPE i,
lv_msg TYPE bapi_msg,
ltt_data TYPE STANDARD TABLE OF lty_data WITH HEADER LINE.
LOOP AT tt_excel INTO wa_excel.
MOVE wa_excel TO ltt_data-text.
APPEND ltt_data. CLEAR ltt_data.
ENDLOOP.
lv_file = p_file.
CONCATENATE LV_FILE 'file.csv' INTO LV_FILE.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_file
write_field_separator = 'X'
FILETYPE = 'ASC'
IMPORTING
filelength = lv_size
TABLES
data_tab = ltt_data
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
"File &1 downloaded successfully - &2 bytes transferred
MESSAGE e419(3e) WITH lv_file lv_size INTO lv_msg. "#EC *
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO lv_msg.
ENDIF.
WRITE LV_MSG.
ENDFORM. " DOWNLOAD_LOCAL
*ENDIF.
*& Include test_ALV *
FORM build_layout .
wa_alv_layout-zebra = 'X'.
wa_alv_layout-colwidth_optimize = 'X'.
wa_alv_layout-window_titlebar = sy-title.
ENDFORM. " build_layout
*& Form f_build_event
text
--> p1 text
<-- p2 text
FORM f_build_event .
REFRESH tt_alv_events.
tt_alv_events-name = slis_ev_top_of_page.
tt_alv_events-form = slis_ev_top_of_page.
APPEND tt_alv_events.
CLEAR tt_alv_events.
tt_alv_events-name = slis_ev_top_of_list.
tt_alv_events-form = slis_ev_top_of_list.
APPEND tt_alv_events.
CLEAR tt_alv_events.
ENDFORM. " f_build_event
*& Form f_alv_disp
text
--> p1 text
<-- p2 text
FORM f_alv_disp.
DATA lv_repid TYPE sy-repid.
REFRESH: tt_alv_fieldcat, tt_alv_events.
PERFORM build_layout.
PERFORM f_build_event.
lv_repid = sy-repid.
PERFORM f_build_fieldcat_summary.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
is_layout = wa_alv_layout
it_fieldcat = tt_alv_fieldcat[]
I_GRID_TITLE = 'Billing Due List Report'
it_sort = tt_sort
i_save = 'A'
it_events = tt_alv_events[]
TABLES
t_outtab = tt_output
EXCEPTIONS
program_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.
ENDFORM. " f_alv_disp
*& Form f_build_fieldcat_SUMMARY
text
--> p1 text
<-- p2 text
FORM f_build_fieldcat_summary .
do_sum no_out outputlen
PERFORM f_fieldcat USING:
'tt_output' 'FKDAT' text-c01 ' ' ' ' '10' ,
'tt_output' 'VKORG' text-c02 ' ' ' ' '10',
'tt_output' 'VTWEG' text-c03 ' ' ' ' '10' ,
'tt_output' 'SPART' text-c04 ' ' ' ' '10' ,
'tt_output' 'KUNAG' text-c05 ' ' ' ' '10' ,
'tt_output' 'NAME1' text-c06 ' ' ' ' '10' ,
'tt_output' 'AUART' text-c07 ' ' ' ' '10' ,
'tt_output' 'BSTNK' text-c08 ' ' ' ' '10' ,
'tt_output' 'AUBEL' text-c09 ' ' ' ' '10' ,
'tt_output' 'VGBEL' text-c10 ' ' ' ' '10' ,
'tt_output' 'TOTAL' text-c11 ' ' ' ' '15' .
ENDFORM. "
*& Form f_fieldcat
FORM f_fieldcat USING pv_a TYPE any
pv_b TYPE any
pv_c TYPE any
pv_d TYPE any
pv_e TYPE any
pv_f TYPE any.
tt_alv_fieldcat-tabname = pv_a.
tt_alv_fieldcat-fieldname = pv_b.
tt_alv_fieldcat-reptext_ddic = pv_c.
tt_alv_fieldcat-do_sum = pv_d.
tt_alv_fieldcat-no_out = pv_e.
tt_alv_fieldcat-outputlen = pv_f.
APPEND tt_alv_fieldcat.
CLEAR tt_alv_fieldcat.
ENDFORM. " f_fieldcat -
How can I read word docs or excel spread sheets downloaded over wifi on my ipad.
I have a remote server with all my documents and although I can see them I cannot open and read the Word & Excel Docs; PDFs & Jpegs I can open. What do I need to do - what App must I download so I can read Word & Excel Docs on my new iPad Air?
There are several out there.
My choices are Apple's apps: Pages for the .docx files and Numbers for the .xlsx files. -
Hi,
Please help me in this requirement.
Is there any option to get the out put of report 6i out put to excel format file.Its not possible to export data directly from 6i to excel but you can export in text file and then open it in excel it will open very easily but keep it in you mind first eliminate all report groups.
and
There is a trick to capture Oracle Reports output (text output) into a excel sheet.
Basic Steps :
1) Set the output format for the report to XML
2) Run the report to generate output.
3) Save the output file locally as a XML file.
4) Open the file using MS Excel.
5) To make it more beautiful, you may use a MS Excel Template
and read below may be this will be helpful to u
http://kr.forums.oracle.com/forums/thread.jspa?threadID=853876
Reports 6i Matrix Output in Excel Format -
What is the best way to lay out color-coded Excel data in InDesign?
I’ve been away from layout for some time. I now need to lay out color-coded Excel data (3 columns, 200 rows) in InDesign 5.5. The data will need to be in alpha order and each row will be color coded, with a color key at the top of the page. What is the best way to lay this out? Should I use the table tool and create a new style for each color that I need to use?
Thanks for your help.I think this will work in CS3.
Start off by inserting Styles of WEEK, Mon to Friday (as per left)
Set the Week No. to Bullets and Numbering and insert as per screen shot
Do the same for Days Monday through to Sunday
Also set up Monday style NEXT STYLE to be Tuesday
When you get to Sunday - loop the Styles back to WEEK style.
Then as per first screen shot you just have to insert RETURNS all the way down to initiate the style. -
Form field tool tips & Read Out Loud
I know that having tool tips for form fields in a PDF is a requirement for accessibility. When I use View > Read This Page in Acrobat, the reader does not read the tool tips for the form fields, even though I've turned on Read form fields in Preferences > Reading. I have a both check boxes and text fields on the form.
What do I need to do to have the Read This Page feature read the form field tool tips?
And, if the Read This Page features does actually read the form field tool tips, wouldn't it be rather redundant that it reads the tool tip and then it also reads the text label printed on the form?
Are certain types of form fields considered 'not accessible?'
Thanks for any help you can provide.What do I need to do to have the Read This Page feature read the form field tool tips?
Sorry, to the best of my knowledge the Acrobat Read Out Loud feature cannot be coaxed into reading form field tips. But you have other options like the PAC 1.3 preview feature and the Callas pdfGoHTML plug in - that let you see the form fields and tips in the context that an assistive technology user would hear them. Or you could use the excellent free screen reader NVDA. Or pay for JAWS.
And, if the Read This Page features does actually read the form field tool tips, wouldn't it be rather redundant that it reads the tool tip and then it also reads the text label printed on the form?
Yes, form field tips can be repetitive. Accessibility rules can be dogmatic. If a form field is labeled and tagged properly and it would be annoyingly repetitive to include a tip, and if you are not constrained by a must-pass-the-dogmatic-accessibility-checker rule, feel free to use your good judgment regarding when it makes sense to leave out the tip.
Are certain types of form fields considered 'not accessible?'
My understanding is that XFA-based PDF forms are problematic from an accessibility standpoint. Standard PDF forms should always be made accessible.
Hope this helps.
a 'C' student -
Reading the context of Excel File
Dear Experts
I want to read the content of excel file that is avaliable in my desktop, I want to use file upload UI Element to pick the file. Please help me with sutiable code
Regards
Noelhi
check this out
Re: Read data from Excel file and diaplay in Webdynpro
Re: How to read an Excel file from Java webdynpro application
Re: Read Excel file and populate in a Table
Re: data upload from excel file to web dynpro table UI -
Getting info out of an excel file like a database
Hi,
The problem i have is that i have to get info out of an excel file like a database. So i have to be able to perform a kind of query, but to an excel file. Is this possible?
lay-out excel file:
number | request | chemical composition
| | C | Mn | Si | ....
125654 | |0.20%|0.10%|0.05%|.....
i should have to be able to search on the number and read the differend % (C, Mn, Si). This % are used in a formula to calculate a value that is used for DAQ
I can do this action with an acces DB, but not with excel. The problem is that they used excel for some years now (where i work) and changing the excel file to a DB would be a very long w
ork.
If someone could help i'd appreciate it
thxI tried it like you said, but i get the error: -2147217865
exception occured.
[Microsoft][ODBC Excel Driver] The microsoft jet database engine could not find the object 'Sheet1'. Make sure the object exists...
So he doesn't seem to recognize a datasheet as a table (if i may compare it like this) when i choose the microsoft Excel driver with the workbook as described in your answer.
Any ideas?
i putted some attachements, maybe they make it easier to understand
Attachments:
test_excel_query.vi 37 KB
test_query_excel.xls 90 KB -
my daughter is 12 and i need books that highlight and read out loud, how do i know whick books do that
Regarding the cursor moving on its own, see:
My mouse keeps moving around on its own, as if someone is remotely controlling my Mac!
This is not known behavior of Flashback. To make sure you're not infected, just install any updates that are available in Software Update. For more info on this, see About the Flashback malware.
That e-mail just sounds like a phishing attempt, and trying to open and view the attached zip file is a major error! It probably contains malware. Fortunately for you, it's almost certainly Windows malware, as I've never yet heard of a case of Mac malware being sent via e-mail in this way. But it could happen, so you should never, ever open attachments from people you don't know, especially in such suspicious circumstances!
Finally, I, like etresoft, have never heard of Avira. There's a lot of bad AV software out there, so without knowing more about it, I would agree that it should be removed, using whatever uninstaller is provided by Avira. If you want to use AV software, use either Sophos Anti-Virus for Mac Home Edition or ClamXav. Both are free and excellent.
(Note that my pages contain links to other pages that promote my services, and this should not be taken as an endorsement of my services by Apple.) -
I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.
Hello. Most of the engineers in developer exchange are more familiar
with NI products. Contacting ICS for technical support is a better
course of action. -
How to read the data in excel sheet
Dear sir,
How to read the data in excel sheet when i recieve a data serial communication... ie i have store a data in excel such that
Cell A Cell B
A Apple
B Ball
C Cat
D Doll
when i recieve A from serial communication i have to display Apple, and when i recieve B i have to display Ball and so on..Hi,
I would recommend you to have a look at the VI attached. It makes use of a VI named 'Read from Spreadsheet' to read the row and column data from the tab delimited excel file. The read data is then searched for the Alphabet specified and finally returns you the corresponding string. The test file used to validate the operation of the VI is also attached.
Trust this would help you solve the issue.
Regards,
Sagar G Yadav | Application Engineer | National Instruments
Attachments:
read_from_excel.vi 10 KB
Book1.txt 1 KB -
How to read out and modify text parts in a pdf-document?
Hello,
My problem is the following: I want to read out text passages of an existing pdf-file, compare them with files in an odbc-database and write down the results of that comparison in the same pdf-file. The term is: Read out a number in the file, search the database for the matching user-name, generate a field in the pdf and write down the search results in that.
i have read that this could be possible with acrobat...my version is an acrobat 9 pro extended...
could someone please tell me how to do that?
big thanksAs the definition of “color” vs. “black and white” differ by context – there aren’t any that I am aware of.
You can, however, use the Preflight feature built into Acrobat to identify whatever you wish…
Maybe you are looking for
-
Hi Gurus, I have a summary report and detailed report and a currency prompt in my dashboard. The summary report has to be displayed only if one currency is selected by the user. For this, I am using a condition in section and in the report I am using
-
How can I get a Printed list of 'all' of my playlists and the songs that are in each list
I want to get a printout of 'ALL' of my playlists and the songs that are in each one. All at once.
-
private void EditGuestForm_KeyPress(object sender, KeyPressEventArgs e) string j=e.KeyChar.ToString(); if (e.KeyChar ==(char)Keys.F1) ViewGuestForm v = new ViewGuestForm(); if (v.ShowDialog() ==
-
Any special way of building reports
Hello friends, (We are having Divisions from A to N in BW system) One of the users has access to A, B and C divisions according to the roles assigned to him. Most of the BW reports are based on Division Authorization object. So, when user is executin
-
HT201493 Is there a "Find My Friends" version for Mac Airbook?
Is there a "Find My Friends" version for Mac Airbook?