Dbf or csv file
hi oracle gurus..
i've been asked to load a dbf a file inot oracle database. how shall i do it? or if its easier if i would let them convert it first to csv format how shall i do it?
many thanks to all!
its easier if i would let them convert it first to csv format how shall i do it?Yes, it's easier. You can use Sql*Loader with that (best way), or, since we are on Forms forum, you could also use TEXT_IO from Forms (not very efficient).
Similar Messages
-
Batch /exe file to convert dbf to csv for sqlldr loading..!
Hi all,
I am having a tough problem as below.
I need to load a .dbf file into a oracle table by sql loader.
Can to tell me the best way to convert .dbf file to .csv so that I can load it via sql loader.
I need some batch file or exe file code to convert .dbf to .csv file.
i was doing it manually as in below steps.
1- open .dbf file in excel.
2-save it as .csv option.
3-use sql loaderfor converted .dbf file.
I want to save my manual work of excel.Kindly help
kindly light into it...
rgds,
pcThere are lots of dbf to CSV converter available in net and you can find by Google!. In the Tom's package you can change a little bit to generate a CSV file.
-
Windows batch file issue for Dbf to csv
Hello,
I am in a tough situation.I need to create a batch file in windows to convert .dbf file to .csv.
i am using below code for doing this .
dbf_2_ora.bat.....
f:
cd \Retail_Work\DATA_201\test
copy C_N_DETL.DBF C_N_DETL_TEST.csv
when I am running above bat file "C_N_DETL_TEST.csv" is creating but when I am opening this file data is separated by "tab".
kindly help me to create a csv file from dbf file withput spaces/tab/whitespaces.
hel[p meIMPORT DATA is a server side command (just as the documentation tells you)
The SAP HANA server cannot access your workstation or the folders on it.
This (and a lot more around data import/export) has been discussed a lot here in SCN already.
A little research effort would have clarified this.
- Lars -
Download as a CSV file (excel)
hi all,
I am trying to download it as a CSV file (local and unix files), but when i get the data in excel , the issue occurs is:
F1 F2 F3
OU Code OU Name OU Description
0000010000 0000010000-PG/US/PRIM CARE
0000010001 0000010001-PG/US/APOTH COMMODIT APOTHECON COMMODITY
note: in the first line iam getting as F1,F2 & F3. i dont want these to come, rest all iam getting it perfectly.
For downloading it i used the below code:
*& Form DOWNLOAD_FILE
text
--> p1 text
<-- p2 text
FORM DOWNLOAD_FILE .
**Add column headers
clear x_out_prctr.
x_out_prctr-prctr = 'OU Code'.
x_out_prctr-ktext = 'OU Name'.
x_out_prctr-ltext = 'OU Description'.
x_out_prctr-OUTNAME = 'OU Type Name'.
x_out_prctr-OTNAME = 'Organization Type Name'.
x_out_prctr-POUCODE = 'Parent OU'.
x_out_prctr-STATUS = 'Status'.
x_out_prctr-OUOUNAME = 'OU Owner'.
x_out_prctr-OUAUNAME = 'OU Assistant'.
x_out_prctr-OUCUNAME = 'OU Controller'.
x_out_prctr-OUMRUNAME = 'OU MSP Rep'.
Insert x_out_prctr into it_out index 1.
Insert x_out_prctr into it_out1 index 1.
clear x_out_prctr.
IF p_local = c_x.
perform gui_download.
elseif p_unix = c_x.
open dataset p_file for output in text mode encoding non-unicode
ignoring conversion errors.
if sy-subrc = 0.
*-For Profit Center
loop at it_out into x_out_prctr.
transfer x_out_prctr to p_file.
if sy-subrc ne 0.
write:/ 'Error writing file'(011), p_file.
stop.
endif.
endloop.
endif.
Close dataset
close dataset p_file.
endif.
ENDFORM. " DOWNLOAD_FILE
*& Form GUI_DOWNLOAD
text
--> p1 text
<-- p2 text
FORM GUI_DOWNLOAD .
DATA : lv_fname TYPE string.
CLEAR lv_fname.
lv_fname = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = lv_fname
FILETYPE = 'DBF'
TABLES
DATA_TAB = it_out
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.
ENDFORM. " GUI_DOWNLOAD
could any one solve my issue ASAP?
Regards,
ShaliniHi Karthik,
when i give the file type as ASC it is not working, The column heading are getting messed up when i use this. the column heading is coming in one text line. but when i changed it to other one...everthing is working fine...but....in the downloaded file in the first line iam getting the F1 ,F2, F3 ..which i dont want it. if i delete this line my problem will be solved.
my program code is:
Includes *
*--- BMS standard header and footer routines
INCLUDE zsrepthd.
*--- ALV Routinesg
INCLUDE zvsdi_alv_routines_ver3.
*--- Authorization Check
INCLUDE z_selection_auth_check.
Types Declarations *
**-Profit Center
*-For CEPC table
TYPES: BEGIN OF ty_cepc,
prctr TYPE prctr,
datbi TYPE datbi,
END OF ty_cepc.
*-For CEPCT table
TYPES: BEGIN OF ty_cepct,
prctr TYPE prctr,
datbi TYPE datbi,
ktext TYPE ktext,
ltext TYPE ltext,
END OF ty_cepct.
*-Output field name
TYPES: BEGIN OF ty_output,
prctr(10) TYPE c,
ktext(40) TYPE c,
ltext TYPE ltext,
OUTNAME(13) TYPE c,
OTNAME(30) TYPE c,
POUCODE(13) TYPE c,
STATUS(8) TYPE c,
OUOUNAME(17) TYPE c,
OUAUNAME(30) TYPE c,
OUCUNAME(30) TYPE c,
OUMRUNAME(17) TYPE c,
END OF ty_output.
Internal Table Declarations *
DATA:
*--- Alv parameters
it_out_alvp TYPE typ_alv_form_params, "for alv parameters
**--To store prctr for profit center data
it_profit_prctr type standard table of ty_cepc,
**--To store text for profit center data
it_text_prctr type standard table of ty_cepct.
**--To store output for profit center data
DATA: BEGIN OF it_out occurs 0,
prctr(10) TYPE c,
ktext(40) TYPE c,
ltext TYPE ltext,
OUTNAME(13) TYPE c,
OTNAME(30) TYPE c,
POUCODE(13) TYPE c,
STATUS(8) TYPE c,
OUOUNAME(17) TYPE c,
OUAUNAME(30) TYPE c,
OUCUNAME(30) TYPE c,
OUMRUNAME(17) TYPE c,
END OF it_out.
Work Area Declarations *
DATA: x_profit_prctr type ty_cepc,
x_text_prctr type ty_cepct,
x_out_prctr type ty_output,
Data Declarations *
v_prctr TYPE cepc-prctr,
l_prctr(10) TYPE c,
l_ktext(40) TYPE c.
Constants Declarations *
CONSTANTS: c_0 TYPE char1 VALUE '0',
c_x TYPE char1 VALUE 'X'.
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-fr1.
SELECT-OPTIONS: s_prctr FOR v_prctr.
PARAMETERS: p_date TYPE sy-datum OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-fr2.
PARAMETERS: p_local RADIOBUTTON GROUP rb1 USER-COMMAND cmd DEFAULT 'X',
p_unix RADIOBUTTON GROUP rb1,
p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b2.
Initialization *
INITIALIZATION.
At Selection Screen *
AT SELECTION-SCREEN.
At Selection value request *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
IF p_local = c_x.
*--- Getting F4 help for Costcenter file
PERFORM get_filename CHANGING p_file.
ELSEIF p_unix = c_x.
MESSAGE i999(zi) WITH 'This fucntion is not available'(i01).
ENDIF.
Start-of-Selection *
START-OF-SELECTION.
*--- Check Authorizations for Selection-screen
PERFORM z_selection_auth_check.
**-- Get the profit center data from tables CEPC,CEPCT
PERFORM f_get_profitcenter.
End-of-Selection *
END-OF-SELECTION.
**-- Download data to final internal table.
PERFORM data_output.
IF NOT it_out[] IS INITIAL.
*--- Fill the structure for calling the ALV form
PERFORM initialize_alv_params.
**-- Display ALV Report
PERFORM setup_and_display_alv_ver2
USING
it_out_alvp "Parameter structure
it_out[] "Internal Data table(header table)
it_out[]. "Dummy table for Hierarchical ALV!!(item table)
**-- Down load to excel.
PERFORM download_file .
ENDIF.
*& Form f_top_of_page
*This is to write the top of page
FORM top_of_page.
DATA: lt_list TYPE slis_t_listheader,
lx_list TYPE slis_listheader.
*--- Title name
CLEAR lx_list.
lx_list-typ = 'S'.
lx_list-key = 'Title name'(t13).
lx_list-info = sy-title.
APPEND lx_list TO lt_list.
IF NOT lt_list IS INITIAL.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_list.
ENDIF.
ENDFORM. "top_of_page
*& Form init_page_head
Description : This subroutine initializes the fields in table BHDGD *
for printing the report heading. *
FORM init_page_head.
bhdgd-line1 = 'Profit Center Extraction'(h04).
bhdgd-line2 = sy-title.
bhdgd-lines = sy-linsz.
bhdgd-fcpyrt = sy-uline.
bhdgd-inifl = '0'.
ENDFORM. "init_page_head
*& Form initialize_alv_params
Description : Form to initialize ALV Params
FORM initialize_alv_params.
CONSTANTS: lc_alv_grid TYPE char1 VALUE 'G', "Grid
lc_u TYPE char1 VALUE 'U'.
MOVE 'IT_OUT' TO it_out_alvp-tablname. "final TABLE
MOVE sy-repid TO it_out_alvp-repid.
MOVE lc_alv_grid TO it_out_alvp-alvtype.
MOVE c_x TO it_out_alvp-bringdefaultvar.
MOVE lc_u TO it_out_alvp-variantsavetype.
ENDFORM. " initialize_alv_params
FORM it_out_init_events *
-->this is form is to modify the events
FORM it_out_init_events
CHANGING
alevnts TYPE slis_t_event.
FIELD-SYMBOLS <alevnt> TYPE slis_alv_event.
LOOP AT alevnts ASSIGNING <alevnt>.
CASE <alevnt>-name.
WHEN slis_ev_top_of_page.
MOVE 'TOP_OF_PAGE' TO <alevnt>-form.
ENDCASE.
ENDLOOP.
ENDFORM. "it_out_init_events
*& Form get_filename
Description : This subroutine is used for F4 Prompting
FORM get_filename CHANGING p_path LIKE rlgrap-filename.
DATA : l_file LIKE ibipparms-path, "Local file for upload/download
l_repid LIKE syst-cprog, "ABAP program, caller in external
"procedures
l_dynnr TYPE syst-dynnr. "Current screen No
l_repid = syst-cprog.
l_dynnr = syst-dynnr.
*--- Function module used for F4 help
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = l_repid
dynpro_number = l_dynnr
IMPORTING
file_name = l_file.
MOVE l_file TO p_path.
ENDFORM. " get_filename
*& Form F_GET_PROFITCENTER
*Get the profit center data from CEPC,CEPCT
FORM f_get_profitcenter.
SELECT prctr
datbi
from cepc
into table it_profit_prctr
where prctr in s_prctr
and datbi >= p_date.
IF sy-subrc = c_0.
SORT it_profit_prctr BY prctr datbi.
ENDIF.
If not it_profit_prctr is initial.
SELECT prctr
datbi
ktext
ltext
from cepct
into table it_text_prctr
for all entries in it_profit_prctr
where prctr = it_profit_prctr-prctr
and datbi = it_profit_prctr-datbi.
IF sy-subrc = c_0.
SORT it_text_prctr BY prctr datbi ktext ltext.
ENDIF.
endif.
ENDFORM. " F_GET_PROFITCENTER
*& Form DATA_OUTPUT
text
--> p1 text
<-- p2 text
FORM DATA_OUTPUT .
loop at it_profit_prctr into x_profit_prctr.
read table it_text_prctr into x_text_prctr with key prctr =
x_profit_prctr-prctr
datbi =
x_profit_prctr-datbi.
if sy-subrc = 0.
x_out_prctr-prctr = x_text_prctr-prctr.
concatenate x_text_prctr-prctr x_text_prctr-ktext into l_ktext
separated by '-'.
x_out_prctr-ktext = l_ktext.
x_out_prctr-ltext = x_text_prctr-ltext.
x_out_prctr-outname = 'Profit Center'.
x_out_prctr-status = 'Active'.
endif.
append x_out_prctr to it_out.
endloop.
ENDFORM. " DATA_OUTPUT
*& Form DOWNLOAD_FILE
text
--> p1 text
<-- p2 text
FORM DOWNLOAD_FILE .
**Add column headers
clear x_out_prctr.
x_out_prctr-prctr = 'OU Code'.
x_out_prctr-ktext = 'OU Name'.
x_out_prctr-ltext = 'OU Description'.
x_out_prctr-OUTNAME = 'OU Type Name'.
x_out_prctr-OTNAME = 'Organization Type Name'.
x_out_prctr-POUCODE = 'Parent OU'.
x_out_prctr-STATUS = 'Status'.
x_out_prctr-OUOUNAME = 'OU Owner'.
x_out_prctr-OUAUNAME = 'OU Assistant'.
x_out_prctr-OUCUNAME = 'OU Controller'.
x_out_prctr-OUMRUNAME = 'OU MSP Rep'.
Insert x_out_prctr into it_out index 1.
Insert x_out_prctr into it_out1 index 1.
clear x_out_prctr.
IF p_local = c_x.
perform gui_download.
elseif p_unix = c_x.
open dataset p_file for output in text mode encoding non-unicode
ignoring conversion errors.
if sy-subrc = 0.
*-For Profit Center
loop at it_out into x_out_prctr.
transfer x_out_prctr to p_file.
if sy-subrc ne 0.
write:/ 'Error writing file'(011), p_file.
stop.
endif.
endloop.
endif.
Close dataset
close dataset p_file.
endif.
ENDFORM. " DOWNLOAD_FILE
*& Form GUI_DOWNLOAD
text
--> p1 text
<-- p2 text
FORM GUI_DOWNLOAD .
DATA : lv_fname TYPE string.
CLEAR lv_fname.
lv_fname = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = lv_fname
FILETYPE = 'DBF'
TABLES
DATA_TAB = it_out
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.
ENDFORM. " GUI_DOWNLOAD
FORM it_out_alv_fieldcat_before *
--> PT_FCAT *
--> ALVP *
FORM it_out_alv_fieldcat_before CHANGING
pt_fcat TYPE slis_t_fieldcat_alv
alvp TYPE typ_alv_form_params.
DATA: lx_fcat TYPE slis_fieldcat_alv.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'PRCTR'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Code'(010).
lx_fcat-seltext_m = 'OU Code'(010).
lx_fcat-seltext_s = 'OU Code'(010).
lx_fcat-reptext_ddic = 'OU Code'(010).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'KTEXT'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Name'(030).
lx_fcat-seltext_m = 'OU Name'(030).
lx_fcat-seltext_s = 'OU Name'(030).
lx_fcat-reptext_ddic = 'OU Name'(030).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'LTEXT'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Description'(040).
lx_fcat-seltext_m = 'OU Description'(040).
lx_fcat-seltext_s = 'OU Description'(040).
lx_fcat-reptext_ddic = 'OU Description'(040).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OUTNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Type Name'(013).
lx_fcat-seltext_m = 'OU Type Name'(013).
lx_fcat-seltext_s = 'OU Type Name'(013).
lx_fcat-reptext_ddic = 'OU Type Name'(013).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OTNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'Organization Type Name'(030).
lx_fcat-seltext_m = 'Organization Type Name'(030).
lx_fcat-seltext_s = 'Organization Type Name'(030).
lx_fcat-reptext_ddic = 'Organization Type Name'(030).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'POUCODE'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'Parent OU Code'(013).
lx_fcat-seltext_m = 'Parent OU Code'(013).
lx_fcat-seltext_s = 'Parent OU Code'(013).
lx_fcat-reptext_ddic = 'Parent OU Code'(013).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'STATUS'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'Status'(008).
lx_fcat-seltext_m = 'Status'(008).
lx_fcat-seltext_s = 'Status'(008).
lx_fcat-reptext_ddic = 'Status'(008).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OUOUNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Owner User Name'(017).
lx_fcat-seltext_m = 'OU Owner User Name'(017).
lx_fcat-seltext_s = 'OU Owner User Name'(017).
lx_fcat-reptext_ddic = 'OU Owner User Name'(017).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OUAUNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Assistant User Name'(030).
lx_fcat-seltext_m = 'OU Assistant User Name'(030).
lx_fcat-seltext_s = 'OU Assistant User Name'(030).
lx_fcat-reptext_ddic = 'OU Assistant User Name'(030).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OUCUNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU Controller User Name'(030).
lx_fcat-seltext_m = 'OU Controller User Name'(030).
lx_fcat-seltext_s = 'OU Controller User Name'(030).
lx_fcat-reptext_ddic = 'OU Controller User Name'(030).
APPEND lx_fcat TO pt_fcat.
CLEAR lx_fcat.
lx_fcat-tabname = 'IT_OUT'.
lx_fcat-fieldname = 'OUMRUNAME'.
lx_fcat-col_pos = '1'.
lx_fcat-ddictxt = 'M'.
lx_fcat-seltext_l = 'OU MSP Rep User Name'(017).
lx_fcat-seltext_m = 'OU MSP Rep User Name'(017).
lx_fcat-seltext_s = 'OU MSP Rep User Name'(017).
lx_fcat-reptext_ddic = 'OU MSP Rep User Name'(017).
APPEND lx_fcat TO pt_fcat.
ENDFORM. " it_out_alv_fieldcat_before
Thanks & Regards,
Shalini -
Storing DBF (DBase IV) file to database
hi all,
i need to load a dbf (dbase IV) file from forms9i into the oracle10g database. my problem is they don't want to convert first the dbf file to csv format (which could have made my life easier) manually to prevent accidental alteration of the file's contents. i know there are tools that could handle this but the reason why i need to do it from forms is that i have to do plsql processing right after the loading.
looking forward to your help,
dongcorrection: we are using forms 10g and 9i database
-
How can i update an existing item in sap using CSV file?
Hi,
i am trying to update an existing Item in SAP using a CSV file.
in the message log i get an error message that the item already exists.
what should i do in order to update the existing record?
Thanks, UdiHi..........
I would sugest you to use Tab delimited file and choose proper option in order to update the itsm master in DTW......
Regards,
Rahul -
Loading 361000 records at a time from csv file
Hi,
One of my collegue loaded 361000 records from one file file , how is this possible as excel accepts 65536 records in one file
and even in the infopackage the following are selected what does this mean
Data Separator ;
Escape Sign "
Separator for Thousands .
Character Used for Decimal Point ,
Pls let me knowhi Maya,
it just possible, other than ms-excel, we have editor like Textpad that support more 65k rows (and windows Notepad), the file may be generated by program or edited outside in excel, or newer version of excel is used, ms-excel 2007 support more 1 million rows.
e.g we have csv file
customer;product;quantity;revenue
a;x;"1.250,25";200
b;y;"5.5";300
data separator ;
- char/delimeter used to separate field, e.g
escape sign, e.g
- "1.250,25";200 then quantity = 1.250,25
separator for thousands = .
- 1.250,25 means one thousand two hundred ...
char used for decimal point
- - 1.250<b>,</b>25
check
http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6581e07211d2acb80000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/c2/678e3bee3c9979e10000000a11402f/frameset.htm
hope this helps. -
Error while creating table from csv file
I am getting an error while creating a table using 'Import Data' button for a csv file containing 22 columns and 8 rows. For primary key, I am using an existing column 'Line' and 'Not generated' options.
ORA-20001: Excel load run ddl error: drop table "RESTORE" ORA-00942: table or view does not exist ORA-20001: Excel load run ddl error: create table "RESTORE" ( "LINE" NUMBER, "PHASE" VARCHAR2(30), "RDC_MEDIA_ID" VARCHAR2(30), "CLIENT_MEDIA_LABEL" VARCHAR2(30), "MEDIA_TYPE" VARCHAR2(30), "SIZE_GB" NUMBER, "RDC_IMG_HD_A" NUMBER, "START_TECH" VARCHAR2(30), "CREATE_DATE" VARCHAR2(30), "RDC_MEDIA_DEST" VARCHAR2(30), "POD" NUMBER, "TAPE" NUMBER, "ERRORS_YN" VA
Any idea?I am getting an error while creating a table using 'Import Data' button for a csv file containing 22 columns and 8 rows. For primary key, I am using an existing column 'Line' and 'Not generated' options.
ORA-20001: Excel load run ddl error: drop table "RESTORE" ORA-00942: table or view does not exist ORA-20001: Excel load run ddl error: create table "RESTORE" ( "LINE" NUMBER, "PHASE" VARCHAR2(30), "RDC_MEDIA_ID" VARCHAR2(30), "CLIENT_MEDIA_LABEL" VARCHAR2(30), "MEDIA_TYPE" VARCHAR2(30), "SIZE_GB" NUMBER, "RDC_IMG_HD_A" NUMBER, "START_TECH" VARCHAR2(30), "CREATE_DATE" VARCHAR2(30), "RDC_MEDIA_DEST" VARCHAR2(30), "POD" NUMBER, "TAPE" NUMBER, "ERRORS_YN" VA
Any idea? -
Error while refreshing a report using local csv file
Hi,
I'm using BI 4.1 SP02.
While using Rich client, I've created a report with some merged queries, while one of the queries is a local CSV file - saved on AD in some server, and not on the repository inside BO.
While trying to refresh the report with the Rich client, it all went great.
Now, while using BI Launchpad java based app, I can't refresh the report - I get the following error:
"An Internal error occurred while calling 'processDPCommandsEx' API. (Error: ERR_WIS_30270) (WIS 30270)"
Should I be able to refresh a report without the Rich if it contains a local file (which is possible to EDIT only with rich) ?
If so, then did someone ran into this error?
Thank you,
Or.First of all, thanks for both of the replies.
Second,
my problem is unlikely have to do something with permissions from one reasons -
when the report is using XLS\XLSX on same folder(with same name prefix) - the report is running without any problem.
Only problem is while refreshing without Rich while the source is network CSV file.
Any suggestions?
Thanks. -
Issue in conversion of output file from alv to csv file using GUI_DOWNLOAD
hi,
I am using GUI_DOWNLOAD to convert the internal table that am getting as the output of an alv into a csv(comma separated file) file.I am using the following code but its not generating a csv file instead it is generating a normal space delimited file.
The code is as follows:
data : lv_fname type string.
lv_fname = 'C:\Users\pratyusha_tripathi\Desktop\status8.csv'. " Provide the file path & file name with CSV extention
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_fname " File name including path, give CSV as extention of the file
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = '#' " Provide comma as separator
tables
data_tab = ITAB " Pass the Output internal table
FIELDNAMES =
EXCEPTIONS
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.
Kindly let me know what changes can be made to make my code work.Also can GUI_download be used for batch processing and storing the output in application server?
Thanks ,
PratyushaHi,
the short text description for WRITE_FIELD_SEPARATOR is "Separate Columns by Tabs in Case of ASCII Download", so why do you expect a comma?
Try SAP_CONVERT_TO_CSV_FORMAT and then download.
And no, GUI_DOWNLOAD is only for download via SAP GUI to a users computer.
Best regards,
Oliver -
Creation of CSV file on client machine with data from forms
Hi,
My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form.
Oracle version -
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production.
I have searched the web for last couple of days and got to know that TEXT_IO is to be used to generate files on client machine. However, when I tried TEXT_IO, it was not able to generate the file on client rather it was able to generate on database server. After further browsing on this, there was a link which said that we need to use CLIENT_TEXT_IO to generate file on client side. For this, i was required to subclass the webutil.pll which i did and corrected the code to use CLIENT_TEXT_IO. The form was unable to compile and was not able to find "webutil_core" package.
I am very confused with the disparity in the information available on the web as in what to use to generate a file on client side. If anyone has use it in the past, can he/she please detail what to use to get things sorted.
Thanks,
ROracle version - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production. >
So, what is your FORMS version. This is more important than your database version.
My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form. Depending on your Forms version, you would use TEXT_IO (if Forms 6i running in Client/Server mode) or WebUtil (if Forms 9i or higher).
I'm going to guess that you are at least using Oracle Forms 9i since you stated that your attempt at using TEXT_IO produced a file on the DB server.
There is more to using WebUtil than just attaching the WEBUTIL.PLL. If you had performed a simple search of the Forms Help System would have found numerous WebUtil topics to include: Introduction to WebUtil, Configuring WebUtil, Using WebUtil in Your Applications and the WebUtil User's Guide. If you have Oracle Forms release 10g or higher, WebUtil is included when you installed Forms, however, you do need to configure your installation to use WebUtil and you must download the Java COM Bridge (jacob.jar) from Source Forge. Take a look at the Configuring WebUtil Forms Help topic to find out which version of the Java COM Bridge you will need to download.
After you have successfully configured WebUtil, take a look at the Using WebUtil in Your Applications topic to find out how to implement WebUtil in a form.
Searching the Internet for answers is great, but don't forget the look at the Forms Help System because the majority of your questions can be answered there. :)
Lastly, configuration of WebUtil is primarily done on your Application Server (AS). However, if you plan to perform preliminary runtime testing by running your Form from the Forms Builder, then you will configure your local runtime to support WebUtil as well as configure your AS. The steps are exactly the same. A common mis-step is to skip a step during the configuration because you don't think the step applies. Take a look at the Forms Help Runtime Setup Checklist topic for a list of step you need to complete in order to enable WebUtil.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Sender "Mail" adapter - CSV file attachment
Hi there
I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
Thanks
SalilHi Salil,
If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
As Renjith said you need to convert CSV to XmL.
A short description about the Standard Modules:
MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
I Hope the use of standard modules is understood. -
Read a CSV file and dynamically generate the insert
I have a requirement where there are multiple csv's which needs to be exported to a sql table. So far, I am able to read the csv file and generate the insert statement dynamically for selected columns however, the insert statement when passed as a parameter
to the $cmd.CommandText
does not evaluate the values
How to evaluate the string in powershell
Import-Csv -Path $FileName.FullName | % {
# Insert statement.
$insert = "INSERT INTO $Tablename ($ReqColumns) Values ('"
$valCols='';
$DataCols='';
$lists = $ReqColumns.split(",");
foreach($l in $lists)
$valCols= $valCols + '$($_.'+$l+')'','''
#Generate the values statement
$DataCols=($DataCols+$valCols+')').replace(",')","");
$insertStr =@("INSERT INTO $Tablename ($ReqColumns) Values ('$($DataCols))")
#The above statement generate the following insert statement
#INSERT INTO TMP_APPLE_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )
$cmd.CommandText = $insertStr #does not evaluate the values
#If the same statement is passed as below then it execute successfully
#$cmd.CommandText = "INSERT INTO TMP_APL_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )"
#Execute Query
$cmd.ExecuteNonQuery() | Out-Null
jyeragiHi Jyeragi,
To convert the data to the SQL table format, please try this function out-sql:
out-sql Powershell function - export pipeline contents to a new SQL Server table
If I have any misunderstanding, please let me know.
If you have any feedback on our support, please click here.
Best Regards,
Anna
TechNet Community Support -
Not able to write image in csv file
I have tried to write JPEG file in csv but having a critical probem.
The JPEG in the CSV is coming wrongly. Means whenever I open the created CSV file I can see the image has been moved upside down.
Can any one please help me how to write a proper image using ClientAnchor?
Can anyone please provide any sample code
Edited by: 837718 on Feb 17, 2011 6:25 PMTry this
Workbook workBookObject= new HSSFWorkbook();
Sheet sheet = wb.createSheet();
CreationHelper helper = wb.getCreationHelper();
Drawing drawing = sheet.createDrawingPatriarch();
ByteArrayOutputStream img_bytes = new ByteArrayOutputStream();
int b;
while ((b = fis.read()) != -1)
img_bytes.write(b);
fis.close();
helper = workBookObject.getCreationHelper();
ClientAnchor anchor = helper.createClientAnchor();
int picIndex = workBookObject.addPicture(img_bytes.toByteArray(),Workbook.PICTURE_TYPE_JPEG);
anchor.setCol1(col);
anchor.setRow1(0);
anchor.setAnchorType(ClientAnchor.MOVE_DONT_RESIZE);
pic = drawing.createPicture(anchor, picIndex);
pic.resize(); -
Hello All,
I have a simple scenerio IDOC to File.
We had a requirement of making a XML file of IDOC received in PI , ery simple and straight forward.
Now Target side as a requirement to place a file in CSV format.
I mean the IDOC received in PI should be placed in target directory as CSV file.
I am working on PI7.11 , can anyone help me with some info.
Thanks a lot in advance.
Regards,
VikrantHi Vikrant,
>>Now Target side as a requirement to place a file in CSV format. I mean the IDOC received in PI should be placed in target directory as CSV file.
If you want the XMLized IDoc to be converted to a plain IDoc, either use the approach suggested by Michal in this blog (use tunneling and create a by-pass scenario)
/people/michal.krawczyk2/blog/2005/11/21/xi-idoc-to-idoc-tunneling--how-fast-and-easy-can-you-get
or
download the IDoc as a flat Idoc and use PI to transfer the content from one directory to another.
PS: All this is applicable if you want the Flat version of XMLized Idoc
Regards
Suraj
Maybe you are looking for
-
Use one parameter for multiple markers in PreparedStatement?
I have a prepared statement with a where clause of the following form: where x = ? or y = ? where the ? for x and y is the same literal value. Is there a more elegant way to handle this other than what I'm doing now (which I think is pretty clumsy):
-
Power fit function is not fitting correctly to sub-array controlled by graph cursors?
I am using two cursors on an XY graph to select a subset of the graphed data to fit a power function to. I noticed that the first selection cursor (left-most on the graph) seems to have more control of the amplitude and power of the power fit while t
-
Party (with and with out)
Dear all, I have two quick questions: 1)In few of our scenario's we used party and for some with out party.what is the difference. In both the cases we used both Business System and service what is the difference. for B2b Scenario's we did not use an
-
IMAP users continually prompted for password when switching folders
I've sifted through /var/log/mailaccess.log and I notice the following message is logged when the above behavior occurs: Jan 19 00:59:49 hostname imap[3879]: badlogin: [XXX.XXX.XXX.XXX] GSSAPI [SASL(-13): authentication failure: user username is not
-
I have a ISE 1.1 demo virtual appliance that we are testing. The web admin account has been locked. How can I reset it or add another admin user to login with? I have the CLI admin account but don't see a why to affect the web users.