How to download data into a text file format ?
Hi, all.
My situation now is: I have a report pogram which can retrieve data from database, and I would like to export or download those data to outside as a text file (.txt) in my local computer.
So, does anyone know how to do it? i mean my report coding should add on or enhance with what coding in order to do like that.
Thanks in advance.
Hi,
Use GUI_DOWNLOAD Function module.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'FILEPATH'*
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X' (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 = ' '
IMPORTING
FILELENGTH =
tables
data_tab = t_customer ( give internal tablename )
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
OTHERS = 22 .
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 SY-SUBRC
Similar Messages
-
Hi ABAP Exterts,
Any one help on this , there is a requirement to download the data into XLSX file only.
I am able to to download the data into XLS file using the FM: GUI_DOWNLOAD in SAP ECC 6.0and also opening the file . But when i download the data into XLSX file . I am able to download the data into GUI_DOWNLOAD. But while opening the file i am getting the below mentioned error.
'Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'
Ok buttom is coming not able to open the file.
When i use the FM: SAP_CONVERT_TO_XLS_FORMAT to download the XLS it self it is going abap DUMP that file type error.
Any one help any Function Module or how to download data through abap programing into XLSX file.
Thanks.
Murali.
Message was edited by: Matthew Billingham - adjusted wording...If you want to download your ALV to an .XLXS format file, with all the formatting intact, please try the following code. I have tried to create a custom Function module Z_EXCEL_DOWNLOAD_TEST wherein I pass all the callback variables, the final ALV internal table and all the ALV details like field catalog, sort, layout, event list and so on, along with the concatenated file path and file name in I_FILE. I have used a custom class ZCL_SALVEXPORT_XML which is a copy of the standard class CL_SALV_EXPORT_XML_DIALOG, with few modifications in Method: EXECUTE and Method: DOWNLOAD. The methods where I have modified the code are also shown at the end.
****************Global declarations***********************
TYPE-POOLS: slis,
kkblo.
TYPES: t_fccls(1) TYPE c OCCURS 0.
TYPES: BEGIN OF ty_nosum,
fieldname TYPE kkblo_fieldname, "Field name
tabname TYPE kkblo_tabname, "Table name
fieldname_dep TYPE kkblo_fieldname, "Field name
tabname_dep TYPE kkblo_tabname, "Table name
index TYPE sy-index, "Index
END OF ty_nosum.
TYPES: t_nosum TYPE TABLE OF ty_nosum INITIAL SIZE 0 WITH NON-UNIQUE DEFAULT KEY.
TYPES: BEGIN OF ty_dep_field,
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
t_ref_fieldcat TYPE kkblo_t_fieldcat, "Field cat
END OF ty_dep_field.
TYPES: BEGIN OF ty_ref_field,
s_ref_fieldcat TYPE kkblo_fieldcat, "Field cat
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
END OF ty_ref_field.
TYPES: t_dep_field TYPE ty_dep_field OCCURS 0. "
TYPES: t_ref_field TYPE ty_ref_field OCCURS 0.
TYPES: BEGIN OF ty_memory,
object(20) TYPE c, "Object
memcount(4) TYPE c, "count
END OF ty_memory.
*ALV Customer Wrapper
TYPES: BEGIN OF ty_type_header_info,
tabname TYPE kkblo_tabname, "Table name
fieldname TYPE kkblo_fieldname, "Field name
sequence TYPE i, "Sequence
field TYPE char80, "Field
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_header_info,
t_type_header_info TYPE SORTED TABLE OF ty_type_header_info
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_row_info,
tabname TYPE kkblo_tabname, "Table name
tabindex TYPE syindex, "Index
field TYPE char80, "Field name
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_row_info,
t_type_row_info TYPE SORTED TABLE OF ty_type_row_info
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_header,
tabname TYPE kkblo_tabname, "table name
fieldname TYPE kkblo_fieldname, "field name
END OF ty_type_sel_header,
t_type_sel_header TYPE SORTED TABLE OF ty_type_sel_header
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_sel_row,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
END OF ty_type_sel_row,
t_type_sel_row TYPE SORTED TABLE OF ty_type_sel_row
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_cell,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
fieldname TYPE kkblo_fieldname,
END OF ty_type_sel_cell.
TYPES: BEGIN OF ty_type_selections,
t_row_info TYPE t_type_row_info,
t_header_info TYPE t_type_header_info,
t_selected_headers TYPE t_type_sel_header,
t_selected_rows TYPE t_type_sel_row,
s_current_cell TYPE ty_type_sel_cell,
set_headers TYPE sap_bool,
set_rows TYPE sap_bool,
set_current_cell TYPE sap_bool,
END OF ty_type_selections.
TYPES: BEGIN OF ty_stack3,
r_grid TYPE REF TO cl_gui_alv_grid, "Y6DK050176
r_salv_adapter TYPE REF TO if_salv_adapter,
s_selections TYPE ty_type_selections,
r_print_state TYPE REF TO if_alv_print_parameter_proxy, "Y6DK075821
suppress_empty_data TYPE abap_bool,
END OF ty_stack3.
TYPES: t_stack3 TYPE ty_stack3 OCCURS 0.
TYPES: BEGIN OF ty_stack,
i_callback_program TYPE sy-repid,
i_callback_user_command TYPE kkblo_formname,
i_callback_top_of_page TYPE kkblo_formname,
i_callback_top_of_list TYPE kkblo_formname,
i_callback_end_of_page TYPE kkblo_formname,
i_callback_end_of_list TYPE kkblo_formname,
i_callback_pf_status_set TYPE kkblo_formname,
i_callback_fieldcat_save TYPE kkblo_formname,
i_callback_layout_save TYPE kkblo_formname,
i_tabname TYPE kkblo_tabname,
i_tabname_slave TYPE kkblo_tabname,
is_keyinfo TYPE kkblo_keyinfo,
is_layout TYPE kkblo_layout,
it_fieldcat TYPE kkblo_t_fieldcat,
i_fctype(1) TYPE c,
it_excluding TYPE kkblo_t_extab,
it_special_groups TYPE kkblo_t_sp_group,
it_sort TYPE kkblo_t_sortinfo,
it_except_qinfo TYPE kkblo_t_qinfo,
is_sel_hide TYPE kkblo_sel_hide,
t_columns TYPE kkblo_t_columns,
t_filter TYPE kkblo_t_filter,
s_lprint TYPE kkblo_lprint,
print_line_break TYPE char1,
t_isetab TYPE kkblo_seldis,
t_fccls TYPE t_fccls,
t_sfinfo TYPE kkblo_t_sfinfo,
t_ref_field TYPE t_ref_field,
t_dep_field TYPE t_dep_field,
flg_default_status(1) TYPE c,
flg_selections TYPE char1,
flg_allow_no_selection TYPE char1,
flg_input TYPE char1,
flg_called TYPE char1,
flg_popup TYPE char1,
flg_endlist TYPE char1,
listtype TYPE char1,
actcols TYPE i,
is_list TYPE char1,
END OF ty_stack.
TYPES: t_stack TYPE ty_stack OCCURS 0.
TYPES: BEGIN OF ty_stack2,
button_col1(20) TYPE c,
button_col2(20) TYPE c,
button_col3(20) TYPE c,
button_col4(20) TYPE c,
button_col5(20) TYPE c,
s_header TYPE kkblo_header,
t_sfinfo_slave TYPE kkblo_t_sfinfo,
t_suminfo TYPE kkblo_t_sfinfo,
t_sfsave TYPE kkblo_t_sfinfo,
t_nosum TYPE t_nosum,
window_title TYPE rsmpe-tittext, " Item_selection
flg_scroll_to_line(1) TYPE c, " Item_selection
flg_top_of_page(1) TYPE c,
flg_subtot(1) TYPE c,
flg_output_in_progress(1) TYPE c,
flg_grouplevels(1) TYPE c,
flg_groupedit(1) TYPE c,
flg_calculate_totals(1) TYPE c,
sumlevel TYPE sy-tabix,
memory_stack1 TYPE ty_memory,
memory_stack2 TYPE ty_memory,
memory_outtab TYPE ty_memory,
t_colmark TYPE kkblo_t_colmark,
t_rowmark TYPE kkblo_t_rowmark,
it_event_exit TYPE kkblo_t_event_exit,
t_groups TYPE kkblo_t_grouplevels,
t_filter_groups TYPE kkblo_t_grouplevels,
s_subtot_options TYPE kkblo_subtot_options,
flg_append_mode(1) TYPE c,
is_reprep_id TYPE kkblo_reprep_id,
i_callback_before_line_output TYPE kkblo_formname,
i_callback_after_line_output TYPE kkblo_formname,
i_callback_foreign_top_of_page TYPE kkblo_formname,
i_callback_foreign_end_of_page TYPE kkblo_formname,
i_callback_list_modify TYPE kkblo_formname,
i_callback_top_of_coverpage TYPE kkblo_formname,
i_callback_end_of_coverpage TYPE kkblo_formname,
i_callback_grouplevel_change TYPE kkblo_formname,
i_callback_item_data_expand TYPE kkblo_formname,
i_callback_header_transport TYPE kkblo_formname,
i_callback_reprep_sel_modify TYPE kkblo_formname,
i_callback_subtotal_text TYPE kkblo_formname,
END OF ty_stack2.
TYPES: t_stack2 TYPE TABLE OF ty_stack2 INITIAL SIZE 0.
** *--- iTables
DATA: it_stack TYPE t_stack WITH HEADER LINE.
DATA: it_stack2 TYPE t_stack2 WITH HEADER LINE.
***ALV Customer Wrapper
DATA: it_stack3 TYPE t_stack3 WITH HEADER LINE.
CONSTANTS: BEGIN OF c_con_listtype,
simple(1) TYPE c VALUE 'S',
hier_sequ(1) TYPE c VALUE 'H',
matrix(1) TYPE c VALUE 'M',
END OF c_con_listtype.
DATA: gv_callback_program1 TYPE sy-repid,
gv_callback_user_command1 TYPE kkblo_formname,
gv_callback_top_of_page1 TYPE kkblo_formname,
gv_callback_top_of_list1 TYPE kkblo_formname,
gv_callback_end_of_page1 TYPE kkblo_formname,
gv_callback_end_of_list1 TYPE kkblo_formname,
gv_callback_pf_status_set1 TYPE kkblo_formname,
gv_callback_layout_save1 TYPE kkblo_formname,
gv_callback_fieldcat_save1 TYPE kkblo_formname,
gv_callback_grouplevel_change1 TYPE kkblo_formname,
gv_callback_before_line_otput1 TYPE kkblo_formname,
gv_callback_after_line_otput1 TYPE kkblo_formname,
gv_callback_foreign_top_of_pg1 TYPE kkblo_formname,
gv_callback_foreign_end_of_pg1 TYPE kkblo_formname,
gv_callback_list_modify1 TYPE kkblo_formname,
gv_callback_top_of_coverpge1 TYPE kkblo_formname,
gv_callback_end_of_coverpge1 TYPE kkblo_formname,
gv_callback_item_data_expand1 TYPE kkblo_formname,
gv_callback_header_transport1 TYPE kkblo_formname,
gv_callback_reprep_sel_modify1 TYPE kkblo_formname,
gv_callback_subtotal_text1 TYPE kkblo_formname,
gv_layout1 TYPE kkblo_layout,
gv_fieldcat1 TYPE kkblo_t_fieldcat,
gv_fctype1 TYPE c,
gv_event_exit1 TYPE kkblo_t_event_exit,
gv_excluding1 TYPE kkblo_t_extab,
gv_special_groups1 TYPE kkblo_t_sp_group,
gv_sort1 TYPE kkblo_t_sortinfo,
gv_filter1 TYPE kkblo_t_filter,
gv_except_qinfo1 TYPE slis_t_qinfo_alv,
gv_sel_hide1 TYPE slis_sel_hide_alv,
gv_reprep_id1 TYPE slis_reprep_id,
gv_screen_start_column1 TYPE i,
gv_salv_adapter1 TYPE REF TO if_salv_adapter,
gv_suppress_empty_data1 TYPE sap_bool.
FUNCTION z_excel_download_test.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_BYPASSING_BUFFER) TYPE CHAR01 OPTIONAL
*" REFERENCE(I_BUFFER_ACTIVE) OPTIONAL
*" REFERENCE(I_CALLBACK_PROGRAM) TYPE SY-REPID OPTIONAL
*" REFERENCE(I_CALLBACK_USER_COMMAND) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_PF_STATUS_SET) OPTIONAL
*" REFERENCE(I_CALLBACK_LAYOUT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_FIELDCAT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_GROUPLEVEL_CHANGE) OPTIONAL
*" REFERENCE(I_CALLBACK_BEFORE_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_AFTER_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_LIST_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_ITEM_DATA_EXPAND) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_HEADER_TRANSPORT) OPTIONAL
*" REFERENCE(I_CALLBACK_REPREP_SEL_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_SUBTOTAL_TEXT) OPTIONAL
*" REFERENCE(I_TABNAME) TYPE SLIS_TABNAME OPTIONAL
*" REFERENCE(I_FCTYPE) DEFAULT 'R'
*" REFERENCE(IT_EXCEPT_QINFO) TYPE SLIS_T_QINFO_ALV OPTIONAL
*" REFERENCE(IS_SEL_HIDE) TYPE SLIS_SEL_HIDE_ALV OPTIONAL
*" REFERENCE(IS_REPREP_ID) TYPE SLIS_REPREP_ID OPTIONAL
*" REFERENCE(I_SCREEN_START_COLUMN) DEFAULT 0
*" REFERENCE(I_OO_ALV) OPTIONAL
*" REFERENCE(IR_SALV_ADAPTER) TYPE REF TO IF_SALV_ADAPTER OPTIONAL
*" REFERENCE(I_SUPPRESS_EMPTY_DATA) TYPE SAP_BOOL DEFAULT
*" ABAP_FALSE
*" REFERENCE(I_FILE) TYPE STRING OPTIONAL
*" REFERENCE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL
*" REFERENCE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL
*" REFERENCE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL
*" REFERENCE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL
*" REFERENCE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL
*" REFERENCE(IT_SPECIAL_GROUPS) TYPE SLIS_T_SP_GROUP_ALV OPTIONAL
*" REFERENCE(IS_KEYINFO) TYPE SLIS_KEYINFO_ALV OPTIONAL
*" REFERENCE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL
*" REFERENCE(IS_LIST_SCROLL) TYPE SLIS_LIST_SCROLL OPTIONAL
*" REFERENCE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL
*" REFERENCE(IS_LINEINFO) TYPE SLIS_LINEINFO OPTIONAL
*" REFERENCE(I_REPID) TYPE SYREPID OPTIONAL
*" TABLES
*" T_OUTTAB TYPE STANDARD TABLE OPTIONAL
*********** Local data declarations******************
DATA: gv_list TYPE char1.
DATA: gv_fcat_complete TYPE sap_bool.
DATA: gv_buffer_active TYPE char01,
wa_variant TYPE disvariant.
DATA: gv_controller TYPE REF TO cl_salv_export_c8r.
DATA: gv_xml TYPE xstring.
DATA: gv_s_xml_choice TYPE if_salv_bs_xml=>s_type_xml_choice.
DATA: gv_t_xml_choice TYPE if_salv_bs_xml=>t_type_xml_choice.
DATA: gv_param_lvc TYPE if_salv_export=>s_type_param_lvc.
DATA: gv_data TYPE REF TO data.
DATA: gv_result_data TYPE REF TO cl_salv_ex_result_data_table.
DATA: gv_flavour TYPE string.
DATA: gv_version TYPE string.
DATA: -
How to get data of tabulated text file into internal table
hi all,
i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding how to convert excel file into internal table but i didnt get posts regarding text file.
thanks
SAchintry:
DATA: BEGIN OF tabulator,
x(1) TYPE x VALUE '09',
END OF tabulator.
READ DATASET file INTO wa.
split wa at tabulator into table itab.
A. -
How to download Documentaion of a Text file to a Report
Hi Friends,
Please guide me on this,
I want to download Documentation of a Report into a text file,
Problem is how to get/capture the Documentaion.
Regards,
Sowjanya
Edited by: sowjanya s on Dec 31, 2008 12:35 PMhi,
DOKHL - Documentation: Headers
DOKTL - Documentation - text lines
DOKIL - Index for Documentation Table DOKH
Use the FM:
SRTU1_GET_REPORT_DOCUMENTATION
Pass the language.
And in the tables IT_REPORTS pass the report name. -
How to parse data from a text file with no convenient delimiters?
I need to read data from a text file. This file contains one line of data with the repeating pattern "time 00 ADVar2: ___ Height: ____ time 01 ADVar2: ___ Height: ___ ..." I need LabView to parse out the "time" and "height" values, build an array with the values, and graph the correlation on an X&Y plot. Does Labview have an automated way to read to the input data file and parse out the correct values, even without convenient delimiters? Thank you.
You actually do have a convenient delimiter: "time". Thus, you can make an array using that as the delimiter. Only caveat is that the first array element will be empty. Then you can conveniently use the Scan From String function in a for-loop. Something like this:
Message Edited by smercurio_fc on 11-21-2008 03:13 PM
Attachments:
Example_VI.png 9 KB -
How to download data into two different columns 2003 excel format in ole
Hi ALL
when we download data into excel using ole with delimiter it works fine in 2007 but when we check this with 2003 format
both fields come in only one column .Can any one suggest
CONCATENATE WA_ALL-PERNR LV_ICNUM INTO WA_PERNR SEPARATED BY W_DELI IN CHARACTER MODE.If you're already using OLE, you can fill in value for each cell separately instead of using a delimiter. Something like this fragment:
FORM fill_cell USING p_row p_col p_value.
CALL METHOD OF obj_excel 'CELLS' = obj_cell
EXPORTING
#1 = p_row
#2 = p_col.
SET PROPERTY OF obj_cell 'VALUE' = p_value.
ENDFORM. "fill_cell -
How to import data from a text file into a table
Hello,
I need help with importing data from a .csv file with comma delimiter into a table.
I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
I have not been able to find a simple instruction on how to use the Wizard.
I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
Neither one gave me enough instruction to be able to do the import successfully.
Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
I submitted the job and I got ORA-31619 invalid dump file error.
I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
I tried to use the "imp" utility in command-line window.
After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
C:\>imp
Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Username: user1
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Import file: EXPDAT.DMP > c:\securParms\securParms.csv
Enter insert buffer size (minimum is 8192) 30720> 8192
IMP-00037: Character set marker unknown
IMP-00000: Import terminated unsuccessfully
Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
I appreciate if someone could show me how to the import from a file into a table!
Thanks,
Mitra>
I can say that anybody with
no experience could easily do an export/import in
MSSQLServer 2000.
Anybody with no experience should not mess up my Oracle Databases ! -
How to load data in plain-text file into database by using EJB?
Hi,
We need to develop an on-line application which requires us to load input data
from a selected plain-text file on the Web server (iplanet server) into the backend
oracle database. How could I use EJB to make it happen? it seems like using Entity
EJB is not feasible.
Really appreciate your help!
CoronaHi Corona,
"Corona Fang" <[email protected]> wrote in message
news:3f3b0ea3$[email protected]..
We need to develop an on-line application which requires us to load inputdata
from a selected plain-text file on the Web server (iplanet server) intothe backend
oracle database. How could I use EJB to make it happen? it seems likeusing Entity
EJB is not feasible.If you are talking about loading thousands of records,
the preferable way is using plain JDBC calls utilizing
batch methods.
Regards,
Slava Imeshev -
How to Download data into Chunks?
Hi Guys,
Can anybody tell me How to download the data into chunks for ex consider BSEG table for this table ?how can we download the data into chunks from SAP Database?
Can anybody tell me how to use Open Cursor and what is meant by Open Cursor?
Thanks,
Gopi.Hi Gopi,
The only change that you have to do is vary the PACKAGE SIZE according to your need. Instead of 300,000 which is set right now, give the PACKAGE SIZE as 1,000,000. But that all depends upon your requirement.
Now, I think your limit is 350,000. If that is the case, then give PACKAGE SIZE 350,000 and instead of writing open dataset outside SELECT, put in before ENDSELECT.
i.e.
DATA : it_bseg TYPE TABLE OF bseg,
v_size TYPE i VALUE '350000',
v_filename TYPE string VALUE give application server path + file name.
SELECT *
FROM bseg
INTO TABLE it_bseg PACKAGE SIZE v_size
WHERE condition.
IF it_bseg[] IS NOT INITIAL.
OPEN DATASET v_filename FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
SORT IT_BSEG BY BELNR.
LOOP AT it_bseg INTO x_bseg
TRANSFER x_bseg TO v_filename.
ENDLOOP.
CLOSE DATASET v_filename.
ENDIF.
ENDSELECT.
Reward points if the answer is helpful.
Thankx,
Mukul -
How to download data into one cell of excel in different lines
Hi All,
My Report downloads data from R/3 to excel. Now one particular field contains multiple lines, which i needs to download into different lines into that particular cell(of excel). how can i do this.
I found one method for this and that is cl_abap_char_utilities=>newline.But this is in abap version 6.0.
But i am working in version 4.6c. do we have any method or anything that meets my requirement in 4.6c.
Please let me know.
Thanx in Advance
Subhani.why do you split them to the internal table ,then download it?
Is you special field long text?
If is ,you can use FM READ_TEXT to put it into an internal table ,then download it. -
How to import data from a text file through DTS to Sql Server
Please don't mistake me as i'm a new comer to sql server,please help me.
how to import the data present in a plain text file through DTS into sql server and store the data in a temporary table.
How far the temporary table is stored in the database.
Please reply me as soon as possible.
Thank you viewers.>
I can say that anybody with
no experience could easily do an export/import in
MSSQLServer 2000.
Anybody with no experience should not mess up my Oracle Databases ! -
How to save data into an excel file ?
I am working on using computer to corol HP8510 Network Analyzer System. Firstlly, I save my data into a notepad.Now I want to save them directly into an excel file. Is there anybody can give me any clue?
Thanks
Attachments:
S.vi 165 KBThe attached zip file contains several VI's to read and write directly to Excel using ActiveX. There are several example VI showing how to use everything. This set is saved in LabVIEW 6.0.2.
I suggest you unzip these to your user.lib directory so you'll be able to easily access them from the functions palette.
I have not actually used these, but others that have say they have worked well for them.
Good Luck
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Attachments:
excel_lv6i.zip 898 KB -
How to download data into excel by displaying field names in top 2 rows
Hi experts,
i am trying to download an internal table data into excel(open office) by reserving top 2 rows. In 1st row i want to display tech.name where as in 2nd row i want to display discription of tech name of the fields. Well, i tried with FM gui_upload and used fieldnames parameter and even its working too but i'm unable to work with 2nd col.
Please help me out....
with regards.
Praveen.Try this code:
If IT_FINAL is the internal table containing the data that you want to download :
IF IT_FINAL[] IS INITIAL.
WRITE : 'No Data Fetched'.
ELSE.
Build header table Field catelague
PERFORM UR_FIELDCAT_BUILD USING G_F_REPNM
'IT_FINAL'
CHANGING IT_FCAT_001.
DATA: L_F_LINES TYPE I,
L_F_FROM TYPE I,
L_F_TO TYPE I,
L_F_DIFF TYPE I,
L_TEMP_FINAL LIKE TABLE OF IT_FINAL.
DESCRIBE TABLE IT_FINAL LINES L_F_LINES.
IF L_F_LINES > 16000.
L_F_FROM = 1.
L_F_TO = 16000.
DO.
APPEND LINES OF IT_FINAL FROM L_F_FROM
TO L_F_TO TO L_TEMP_FINAL.
PERFORM DOWNLOAD_DATA_HEADER TABLES L_TEMP_FINAL
IT_FCAT_001
USING GF_FILE1.
IF L_F_TO >= L_F_LINES.
EXIT.
ENDIF.
L_F_FROM = L_F_TO + 1.
L_F_DIFF = L_F_LINES - L_F_TO.
IF L_F_DIFF >= 16000.
L_F_TO = L_F_TO + 16001.
ELSE.
L_F_TO = L_F_LINES.
ENDIF.
REFRESH: L_TEMP_FINAL.
ENDDO.
ELSE.
PERFORM DOWNLOAD_DATA_HEADER TABLES IT_FINAL
IT_FCAT_001
USING GF_FILE1.
ENDIF.
ENDIF.
FORM UR_FIELDCAT_BUILD
USING P_REPID
P_TABNAM
CHANGING C_T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
REFRESH C_T_FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = P_REPID
I_INTERNAL_TABNAME = P_TABNAM
I_STRUCTURE_NAME = 'TY_FLODAT'
I_INCLNAME = P_REPID
I_BYPASSING_BUFFER = 'X'
CHANGING
CT_FIELDCAT = C_T_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
ENDFORM.
FORM DOWNLOAD_DATA_HEADER
TABLES T_OUTTAB
T_FIELDCAT
USING P_FILENAM.
TYPE-POOLS: SLIS.
REPLACE 'YYYYMMDD' WITH SY-DATUM INTO P_FILENAM.
DATA: T_GXXLT_O TYPE TABLE OF GXXLT_O WITH HEADER LINE,
T_GXXLT_H TYPE TABLE OF GXXLT_H WITH HEADER LINE,
T_GXXLT_H_TEMP TYPE TABLE OF GXXLT_H WITH HEADER LINE,
T_GXXLT_P TYPE TABLE OF GXXLT_P WITH HEADER LINE,
T_GXXLT_S TYPE TABLE OF GXXLT_S WITH HEADER LINE,
T_GXXLT_V TYPE TABLE OF GXXLT_V WITH HEADER LINE,
L_S_FIELDCAT TYPE SLIS_FIELDCAT_ALV..
DATA: F_FILE TYPE GXXLT_F-FILE,
F_ATT_COLS TYPE I,
F_HRZ_KEYS TYPE I,
F_VRT_KEYS TYPE I.
TYPES: BEGIN OF TY_FLDNM,
FIELDNAME(30) TYPE C,
END OF TY_FLDNM.
DATA : L_T_FLDNAME TYPE TABLE OF TY_FLDNM,
L_R_FLDNAME TYPE TY_FLDNM.
REFRESH: L_T_FLDNAME.
LOOP AT T_FIELDCAT INTO L_S_FIELDCAT .
CLEAR L_R_FLDNAME.
CONCATENATE L_S_FIELDCAT-SELTEXT_S '_'
L_S_FIELDCAT-FIELDNAME
INTO L_R_FLDNAME-FIELDNAME.
APPEND L_R_FLDNAME TO L_T_FLDNAME.
ENDLOOP.
IF T_OUTTAB[] IS INITIAL.
WRITE : /'No data Fetch !'.
ELSE.
DESCRIBE TABLE T_FIELDCAT LINES F_ATT_COLS.
LOOP AT T_FIELDCAT INTO L_S_FIELDCAT.
T_GXXLT_H-COL_NO = L_S_FIELDCAT-COL_POS.
T_GXXLT_H-ROW_NO = 1.
T_GXXLT_H-COL_NAME = L_S_FIELDCAT-FIELDNAME.
APPEND T_GXXLT_H.
CLEAR T_GXXLT_S.
T_GXXLT_S-COL_NO = L_S_FIELDCAT-COL_POS.
T_GXXLT_S-COL_OPS = 'NOP'.
T_GXXLT_S-COL_SRC = L_S_FIELDCAT-COL_POS.
CASE L_S_FIELDCAT-INTTYPE.
WHEN 'Z' OR 'P' OR 'I' OR 'F'.
T_GXXLT_S-COL_TYP = 'NUM'.
WHEN 'C' OR 'X' OR 'T' OR 'N'.
T_GXXLT_S-COL_TYP = 'STR'.
WHEN 'D'.
T_GXXLT_S-COL_TYP = 'DAT'.
WHEN OTHERS.
T_GXXLT_S-COL_TYP = 'STR'.
ENDCASE.
APPEND T_GXXLT_S.
IF L_S_FIELDCAT-KEY EQ 'X'.
CLEAR T_GXXLT_H.
T_GXXLT_H-COL_NO = L_S_FIELDCAT-COL_POS.
T_GXXLT_H-ROW_NO = 1.
T_GXXLT_H-COL_NAME = L_S_FIELDCAT-FIELDNAME.
APPEND T_GXXLT_H.
ENDIF.
ENDLOOP.
MOVE P_FILENAM TO F_FILE.
LOOP AT T_FIELDCAT INTO L_S_FIELDCAT.
READ TABLE T_GXXLT_H WITH KEY COL_NAME = L_S_FIELDCAT-FIELDNAME.
IF SY-SUBRC EQ 0.
T_GXXLT_H_TEMP-COL_NO = T_GXXLT_H-COL_NO.
T_GXXLT_H_TEMP-ROW_NO = 2.
T_GXXLT_H_TEMP-COL_NAME = L_S_FIELDCAT-SELTEXT_S.
APPEND T_GXXLT_H_TEMP TO T_GXXLT_H.
CLEAR T_GXXLT_H.
ENDIF.
ENDLOOP.
CALL FUNCTION 'XXL_FULL_API'
EXPORTING
FILENAME = F_FILE
NO_START = ''
N_ATT_COLS = F_ATT_COLS
N_HRZ_KEYS = F_HRZ_KEYS
N_VRT_KEYS = F_VRT_KEYS
SEMA_TYPE = ''
SO_TITLE = ''
TABLES
DATA = T_OUTTAB
HKEY = T_GXXLT_H
ONLINE_TEXT = T_GXXLT_O
PRINT_TEXT = T_GXXLT_P
SEMA = T_GXXLT_S
VKEY = T_GXXLT_V
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.
ENDIF.
ENDFORM. -
Download data into a local file from PCUI
Hi,
i need to export items from 'quotation' into a local file (on presentation server) with CRM4.0 and using the fileupload field type. I used the MF 'GUI_DOWNLOAD' but i had an exception error 'CONTROL_FLUSH_ERROR'. Effectively it was expected since PCUI is based on BSP technology and this one requires to use methods from the 'HTTP_REQUEST' object. This last one is not accessible
from pcui methods assigned to fieldgroups... So i try to use methods from the class 'cl_abap_conv_out_ce' as i did for import items with the class 'cl_abap_conv_in_ce' but
there is no input enabling to define the file getting data.
Somebody would have an idea ?
Thank you.Hello KB Ram,
You have a program RSECHK05 using which you can check the data of the idoc segements.
Please make a point of clicking the "Output in Internal Formal" pushbutton.
The output will come in a classical report format with which you can play around.
BR,
Suhas -
How to append datas to a text file?
Hi,
I want to append the data to a already created text file.When i used Write to text file.vi. It overwrites the previous data.
Solved!
Go to Solution.Try using the 'set file position' function (file io palette, advanced functions) before you write the data.
i.e. open the file, set position to end, write the data, close the file.
Ian
Maybe you are looking for
-
2004S MiniSAP ABAP: SAPGUI crashes when creating a Web Service
I have installed the NW2004S ABAP Preview System from SDN on a VMWare Image (Windows XP, 1.7 GB Mem). No problems during the install. Also I was able to run the sample Web Dynpro Quiz Application. However when try to create a Web Service the SAP GUi
-
How to take parts of a web page and feed into a PDF template to create a PDF
Interesting quesiton that I think was what LiveCycle was for: How can someone take parts of a web page or xml document (say by id name or a specialized tag) and feed the chosen items into different regions inside a PDF template? Basically, can you id
-
.PSD files in FCPX?
IN FCP 7 I could edit a logo in a .psd format as layers. Is this yet another feature no longer possible in FCP X?
-
Hi all, I have a JSP page that takes input from user such as, textarea, text, drop down list. I am checking the validity of those values using a Javabean. where connections are made to the database and check for inputs whether is that already in data
-
Gnome 3.4 Missing Desktop Icons
I've got the latest version of gnome 3.4 installed along with gnome-tweak-tool. In gnome-tweak-tool I've got Have the file manager handle the desktop set to on. However, when I log out and log back in again there are no icons until I fire up nautilus