Upload text file that uses "|" as separator
Hello,
Im trying to upload a text file that uses " | " to separate its columns using fm gui_upload, but it only uploads the first column.
Could anybody tell me what other fm i can use or what i may be doing wrong?
Use this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file
filetype = 'ASC'
<b> has_field_separator = '|'</b>
header_length = 0
read_by_line = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
ignore_cerr = 'X'
replacement = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = data_mat
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
Reward Points if useful.
Thanks
Aneesh.
Similar Messages
-
Uploaded text file has a new line added at the top using BSP MVC applicatio
I have a BSP MVC application that uploads data on to the application server. When I open the uploaded text file, the very first line on the file looks like the line below. ->
htmlb:button:click:nullhtmlb_form_1UploadUpload0htmlbdfsdf
But the rest of the file looks okay. This is causing other than .txt files to get corrupted.
Here is the code from my DO_HANDLE_EVENT.
data: entity type ref to if_http_entity,
name type string,
content type xstring,
content_type type string,
idx type i value 1,
v_root(26) value '
houappl131\SRM_Download\',
v_unxfile(100),
v_transfer type xstring,
v_type(6),
v_len type i,
v_dirfile type zfileinfo,
v_ofile(80),
v_guid type guid_32.
class cl_htmlb_manager definition load.
data: v_asn(10) type n.
data: fu type ref to cl_htmlb_fileupload,
file_id type string value 'batchfile'.
data: o_page_context type ref to if_bsp_page_context.
data: parent type ref to cl_bsp_controller2,
lo_model type ref to cl_sus_m_asn_detail.
o_page_context = me->get_page_context( ).
cl_htmlb_manager=>dispatch_event_ex( request = request
page_context = o_page_context
event_handler = me ).
refresh z_batch->message.
if htmlb_event->server_event = 'Upload'.
fu ?= cl_htmlb_manager=>get_data( request = request id = file_id name
= 'fileUpload' ).
if fu->file_name gt space.
z_batch->parameters-fpath = fu->file_name.
v_len = strlen( z_batch->parameters-fpath ).
if v_len gt 4.
v_len = v_len - 3.
endif.
v_type = z_batch->parameters-fpath+v_len(3).
search z_batch->parameters-fpath for '.'.
if sy-fdpos gt 0 and v_len gt 0.
v_len = v_len - sy-fdpos.
v_type = z_batch->parameters-fpath+sy-fdpos(v_len).
endif.
clear v_asn.
v_asn = z_batch->parameters-asnhdr.
concatenate v_asn
z_batch->parameters-asnitem
z_batch->parameters-batch
v_type
into v_unxfile separated by '.'.
concatenate v_root v_unxfile into v_unxfile.
condense v_unxfile no-gaps.
open dataset v_unxfile for output in binary mode.
while idx <= request->num_multiparts( ).
entity = request->get_multipart( idx ).
name = fu->file_name .
if name is not initial.
content_type = entity->get_header_field( 'Content-Type' ).
clear content.
content = entity->get_data( ).
v_transfer = content.
transfer content to v_unxfile.
append content to z_batch->filetab.
endif.
idx = idx + 1.
endwhile.
close dataset v_unxfile.
endif.
endif.
Here is my fileupload button in the view
<htmlb:page title="File Upload " >
<htmlb:form method = "post"
encodingType = "multipart/form-data" >
<htmlb:label id = "Batchnum"
design = "Label"
for = "Batchnumber"
text = "Batch" />
<htmlb:inputField id = "Batchinput"
value = "//zbatch/parameters.batch" />
<htmlb:fileUpload id="batchfile" />
<htmlb:button id = "Upload"
text = "Upload"
onClick = "Upload" />
<htmlb:button id = "Close"
text = "Close window"
onClick = "Close" />
Any of you gurus know why this is happening?I solved it myself
-
Upload text file to oracle table with checking and aggregation
Hi Friends,
I am new to ODI. I have encountered a problem which is specific to ODI 11G (11.1.1.6.3) to upload text file to oracle table with checking and aggregation. Would you please teach me how to implement the following requirement in ODI 11G?
Input text file a:
staffCode, staffCat, status, data
input text file b:
staffCodeStart, staffCodeEnd, staffCat
temp output oracle table c:
staffCat, data
output oracle table d:
staffCat, data
order:
a.staffCode, a.staffCat, a.status
filter:
a.status = ‘active’
join:
a left outerjoin b on a.staffCode between b.staffCodeStart and b.staffCodeEnd
insert temp table c:
c.staffCat = if b.staffCat is not null then b.staffCat else a.staffCat
c.data = a.data
insert table d:
if c.staffCat between 99 and 1000 then d.staffCat = c.staffCat, d.data = sum(c.data)
else d.staffCat = c.staffCat, d.data = LAST(c.data)
Any help on fixing this is highly appreciated. Thanks!!
Thanks,
ChrisDear Santy,
Many thanks for your prompt reply. May I have more information about the LAST or SUM step?
I was successful to create and run the following interfaces p and q
1. Drag text file a to a newly created interface panel p
2. Filter text file a : a.status = ‘active’
3. Lookup text file a to text file b : a.staffCode between b.staffCodeStart and b.staffCodeEnd
4. Drag oracle temp table c to interface panel p
5. Set c.staffCat : CASE WHEN b.staffCat IS NULL THEN a.staffCat ELSE b.staffCat END
6. Set c.data : a.data
7. Drag oracle temp table c to a newly created interface panel q
8. Drag oracle table d to interface panel q
9. Set UK to d.staffCat
10. Set Distinct Rows to table d
11. Set d.staffCat = c.staffCat
12. Set d.data = SUM(c.data)
However, the interface q should be more than that:
If c.staffCat is between 99 and 1000, then d.data = the last record c.data; else d.data = sum(c.data)
Would you please teach me how to do the LAST or SUM steps? Moreover, can interface p and interface q be combined to one interface and do not use the temp table c? Millions thanks!
Regards,
Chris -
How to upload (.txt) file by using GUI Upload?
I tried to upload .csv file in using GUI upload and it works.
THIS IS MY SAMPLE CODE.
CLEAR w_rawfile.
DESCRIBE TABLE i_rawfile LINES v_read. "Counter for records read
Condense w_rawfile-field.
Separate header record from detail records
LOOP AT i_rawfile INTO w_rawfile.
IF sy-tabix = 1. "header is always the first record
SPLIT w_rawfile-field AT ' ' INTO
w_header_file-name1
w_header_file-name2
w_header_file-name3
w_header_file-cntry
w_header_file-address1
w_header_file-address2.
APPEND w_header_file TO i_header_file.
CLEAR: w_header_file.
ELSE. "succeeding records are detail records
SPLIT w_rawfile-field AT ',' INTO
w_inputfile-nachn
w_inputfile-vorna
w_inputfile-nach2
w_inputfile-land1
w_inputfile-stras
APPEND w_inputfile TO i_inputfile.
ENDIF.
IF i try to replace my file into a .txt format. An error occurs. Please kindly give me the code to do this correctlt. ThanX!Reading Data from Presentation Server (Dialog)
To read data from the presentation server into an internal table with a user dialog, use the function module UPLOAD. The most important parameters are listed below. For more information, refer to the function module documentation in the Function Builder (Transaction SE37).
Important Import Parameters
Parameters
Function
CODEPAGE
Only for upload under DOS: Value IBM
FILENAME
Filename (default value for user dialog)
FILETYPE
File type (default value for user dialog)
ITEM
Title for dialog box
Use the FILETYPE parameter to specify the transfer mode. Possible values:
BIN
Binary files
ASC
ASCII files: Text files with end of line markers.
DAT
Excel files, saved as text files with columns separated by tabs and lines separated by line breaks.
WK1
Excel and Lotus files saved as WK1 spreadsheets.
Important Export Parameters
Parameters
Function
FILESIZE
Number of bytes transferred
ACT_FILENAME
Filename (as entered in the user dialog)
ACT_FILETYPE
File type (as entered in the user dialog)
Tables Parameters
Parameters
Function
DATA_TAB
Internal table (target for the import)
Exceptions Parameters
Parameters
Function
CONVERSION_ERROR
Error converting data
INVALID_TABLE_WIDTH
Invalid table structure
INVALID_TYPE
Incorrect FILETYPE parameter
Suppose the presentation server is running under Windows NT, and contains the following Excel file:
If this table is saved as a text file "D:\temp\mytable.txt" with tabs between the columns, the following program can read the table:
PROGRAM SAPMZTST.
DATA: FNAME(128), FTYPE(3), FSIZE TYPE I.
TYPES: BEGIN OF LINE,
COL1(10) TYPE C,
COL2(10) TYPE C,
COL3(10) TYPE C,
END OF LINE.
TYPES ITAB TYPE LINE OCCURS 10.
DATA: LIN TYPE LINE,
TAB TYPE ITAB.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = 'IBM'
FILENAME = 'd:\temp\mytable.txt'
FILETYPE = 'DAT'
ITEM = 'Read Test for Excel File'
IMPORTING
FILESIZE = FSIZE
ACT_FILENAME = FNAME
ACT_FILETYPE = FTYPE
TABLES
DATA_TAB = TAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3.
WRITE: 'SY-SUBRC:', SY-SUBRC,
/ 'Name :', (60) FNAME,
/ 'Type :', FTYPE,
/ 'Size :', FSIZE.
SKIP.
LOOP AT TAB INTO LIN.
WRITE: / LIN-COL1, LIN-COL2, LIN-COL3.
ENDLOOP.
The program displays the following dialog box:
Here, the user can change the default values. When the user chooses Transfer, the system imports the data from the file D:\temp\mytable.txt into the internal table TAB.
The output appears as follows:
SY-SUBRC: 0
Name : d:\temp\mytable.txt
Type : DAT
Size : 69
Billy the Kid
My Fair Lady
Herman the German
Conan the Barbarian
The contents of the internal table TAB are exactly the same as the contents of the original Excel table. -
Upload text files with non-english characters
I use an Apex page to upload text files. Then i retrieve the contents of files from wwv_flow_files.blob_content and convert them to varchar2 with utl_raw.cast_to_varchar2, but characters like ò, à, ù become garbage.
What could be the problem? Are characters lost when files are stored in wwv_flow_files or when i do the conversion?
Some other info:
* I see wwv_flow_files.DAD_CHARSET is set to "ascii", wwv_flow_files.FILE_CHARSET is null.
* Trying utl_raw.cast_to_varchar2( utl_raw.cast_to_raw('àòèù') ) returns 'àòèù' correctly;
* NLS_CHARACTERSET parameter is AL32UTF8 (not just english ASCII)Hi
Have a look at csv upload -- suggestion needed with non-English character in csv file it might help you.
Thanks,
Manish -
TextEdit - Plain Text Files That Open In Windows?
Hi. Just got an iMac. I've been trying to make plain text files in TextEdit that show up correctly in Windows on a PC. I've tried saving the same document in 4 different formats:
- Plan Text Unicode (UTF-8)
- Plain Text Unicode (UTF-16)
- Plain Text Western (Mac OS Roman)
- Plain Text Western (Windows Latin 1)
But none of these look right on a PC. All of the line breaks I've entered show up replaced by black rectangles. Why is this?
What format should I save as in TextEdit, to create Plain Text files that are compatible with both PC and Macs?First, note that TextEdit does not create plain text files, it creates rich text files (.rtf). If you truly want plain text, try the free TextWrangler:
http://www.barebones.com/
As to the line break problem, Macs use just a carriage return as the end-of-line character, while Windows uses a carriage return followed by a line break character. At least, that's how I understand it. Most likely, whatever app you're using on Windows is dumb enough that it can't figure out what to do with the Mac line endings. TextWrangler will let you change the line breaks, so you could use it to create plain text files with Windows line breaks. Of course, that doesn't help if you didn't really want plain text (ie, absolutely no styling, just raw text). -
hi
i want to create BDC program for the data uploding.. but i dont hv much knwloadge of about it. i need to sample code the data upload program. i hv to upload text file format. im using gui_upload funtion if u hv any sample plz send me it plz... thnx
regad
nawaCheck the following code:
Selection screen :
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-020.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
PARAMETERS: p_locl RADIOBUTTON GROUP g1 " desktop file
DEFAULT 'X' USER-COMMAND fil,
p_phys RADIOBUTTON GROUP g1. " appln server file
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 .
PARAMETERS: p_ifile TYPE dxfile-filename LOWER CASE, " source file
p_afile TYPE dxfile-filename LOWER CASE, " asset class file
p_cfile TYPE dxfile-filename LOWER CASE, " Cost center file
p_dfile TYPE dxfile-filename LOWER CASE, " Depr key file
p_ofile TYPE dxfile-filename LOWER CASE. " Audit file
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-015.
PARAMETERS: p_test RADIOBUTTON GROUP g2 DEFAULT 'X', " test run
p_create RADIOBUTTON GROUP g2. " data migretion
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN END OF BLOCK b4.
Main program :
REPORT zfaac900
LINE-SIZE 132
LINE-COUNT 65
NO STANDARD PAGE HEADING
MESSAGE-ID ZFAA.
* includes
INCLUDE: zfaac900_top,
zfaac900_selection_screen,
zfaac900_subroutine.
* AT SELECTION SCREEN ON VALUE REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ifile.
PERFORM help_input_file USING p_phys p_locl CHANGING p_ifile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_afile.
PERFORM help_asset_file USING p_phys p_locl CHANGING p_afile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cfile.
PERFORM help_cost_file USING p_phys p_locl CHANGING p_cfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dfile.
PERFORM help_depr_file USING p_phys p_locl CHANGING p_dfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ofile.
PERFORM help_audit_file USING p_phys p_locl CHANGING p_ofile.
* AT SELECTION-SCREEN
AT SELECTION-SCREEN.
PERFORM check_screen USING p_ifile p_afile p_cfile p_dfile
p_ofile p_locl p_phys.
* TOP-OF-PAGE
TOP-OF-PAGE.
ULINE.
PERFORM sjm_heading IN PROGRAM zacai0005.
ULINE.
* START_OF_SELECTION
START-OF-SELECTION.
PERFORM get_input USING p_ifile p_afile p_cfile p_dfile
CHANGING i_input i_asset i_cost i_depr.
Subroutines :
*& Form help_input_file
* text
FORM help_input_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_source_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_IFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_source_path.
ENDIF.
ENDFORM. " help_input_file
*& Form help_asset_file
* text
FORM help_asset_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_source_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_AFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_source_path.
ENDIF.
ENDFORM. " help_asset_file
*& Form help_cost_file
* text
FORM help_cost_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_source_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_CFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_source_path.
ENDIF.
ENDFORM. " help_cost_file
*& Form help_depr_file
* text
FORM help_depr_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_source_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_DFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_source_path.
ENDIF.
ENDFORM. " help_depr_file
*& Form help_audit_file
* text
FORM help_audit_file USING p_phys_file TYPE c
p_locl_file TYPE c
CHANGING p_audit_path TYPE any.
IF p_phys_file EQ 'X'.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_OFILE'
dyname = sy-repid
dynumb = sy-dynnr
filetype = 'P'
location = 'A'.
ELSEIF p_locl_file EQ 'X'.
PERFORM help_local_file CHANGING p_audit_path.
ENDIF.
ENDFORM. " help_audit_file
*& Form help_local_file
* Local File Path
FORM help_local_file CHANGING p_path TYPE any .
DATA: lt_file_table TYPE filetable,
la_file_table LIKE LINE OF lt_file_table,
l_rc TYPE i,
l_pcdsn TYPE cffile-filename.
REFRESH lt_file_table.
CLEAR la_file_table.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = lt_file_table
rc = l_rc.
READ TABLE lt_file_table INTO la_file_table INDEX 1.
l_pcdsn = la_file_table-filename.
MOVE l_pcdsn TO p_path.
ENDFORM. " help_local_file
*& Form check_phys_file
* Validation of Physical File
FORM check_phys_file USING p_file TYPE any.
DATA: l_str(300) TYPE c.
CLEAR l_str.
OPEN DATASET p_file IN TEXT MODE FOR INPUT ENCODING DEFAULT.
IF sy-subrc <> 0.
IF g_file_flag = 'I'.
MESSAGE e000 WITH text-021.
ELSEIF g_file_flag = 'A'.
MESSAGE e000 WITH text-095.
ELSEIF g_file_flag = 'C'.
MESSAGE e000 WITH text-096.
ELSEIF g_file_flag = 'D'.
MESSAGE e000 WITH text-097.
ENDIF.
ENDIF.
READ DATASET p_file INTO l_str.
IF sy-subrc <> 0.
IF g_file_flag = 'I'.
MESSAGE e000 WITH text-017.
ELSEIF g_file_flag = 'A'.
MESSAGE e000 WITH text-098.
ELSEIF g_file_flag = 'C'.
MESSAGE e000 WITH text-099.
ELSEIF g_file_flag = 'D'.
MESSAGE e000 WITH text-100.
ENDIF.
ENDIF.
CLEAR: g_file_flag.
CLOSE DATASET p_file.
ENDFORM. " check_phys_file
*& Form check_local_file
* Validation of Local File
FORM check_local_file USING p_file TYPE any.
DATA: l_size TYPE i.
CLEAR: l_size.
CALL FUNCTION 'TMP_GUI_GET_FILE_EXIST'
EXPORTING
fname = p_file
IMPORTING
* exist = l_exist
filesize = l_size
EXCEPTIONS
fileinfo_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
IF g_file_flag = 'I'.
MESSAGE e000 WITH text-016.
ELSEIF g_file_flag = 'A'.
MESSAGE e000 WITH text-101.
ELSEIF g_file_flag = 'C'.
MESSAGE e000 WITH text-102.
ELSEIF g_file_flag = 'D'.
MESSAGE e000 WITH text-103.
ENDIF.
ENDIF.
IF l_size IS INITIAL.
IF g_file_flag = 'I'.
MESSAGE e000 WITH text-024.
ELSEIF g_file_flag = 'A'.
MESSAGE e000 WITH text-107.
ELSEIF g_file_flag = 'C'.
MESSAGE e000 WITH text-108.
ELSEIF g_file_flag = 'D'.
MESSAGE e000 WITH text-109.
ENDIF.
ENDIF.
CLEAR: g_file_flag.
ENDFORM. " check_local_file
*& Form get_input
* To gate input data from local file or from application server
FORM get_input USING p_ifilename TYPE any
p_afilename TYPE any
p_cfilename TYPE any
p_dfilename TYPE any
CHANGING p_input_table TYPE t_input_table
p_asset_table TYPE t_asset_table
p_cost_table TYPE t_cost_table
p_depr_table TYPE t_depr_table.
* to populate the input table
PERFORM upload_file USING p_ifilename CHANGING i_local.
g_file_flag = 'I'.
PERFORM split_localtable CHANGING p_input_table p_asset_table
p_cost_table p_depr_table.
CLEAR g_file_flag.
REFRESH i_local.
* to populate the asset class table
PERFORM upload_file USING p_afilename CHANGING i_local.
g_file_flag = 'A'.
PERFORM split_localtable CHANGING p_input_table p_asset_table
p_cost_table p_depr_table .
CLEAR g_file_flag.
REFRESH i_local.
* to populate the cost center table
PERFORM upload_file USING p_cfilename CHANGING i_local.
g_file_flag = 'C'.
PERFORM split_localtable CHANGING p_input_table p_asset_table
p_cost_table p_depr_table .
CLEAR g_file_flag.
REFRESH i_local.
* to populate the depr key table
PERFORM upload_file USING p_dfilename CHANGING i_local.
g_file_flag = 'D'.
PERFORM split_localtable CHANGING p_input_table p_asset_table
p_cost_table p_depr_table .
CLEAR g_file_flag.
REFRESH i_local.
ENDFORM. " get_input
*& Form upload_file
* text
FORM upload_file USING p_filename TYPE any
CHANGING p_local_table TYPE t_local_table.
* To get the input data from desktop file
IF p_locl = 'X'.
DATA: l_file TYPE string.
CLEAR: l_file,
p_local_table.
l_file = p_filename.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = 'ASC'
TABLES
data_tab = p_local_table
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 e002 WITH l_file.
ENDIF.
ELSE.
* To get the data from application server file
OPEN DATASET p_filename IN TEXT MODE FOR INPUT ENCODING DEFAULT.
IF sy-subrc <> 0.
MESSAGE e001 WITH p_filename.
ENDIF.
CLEAR: wa_local.
DO.
READ DATASET p_filename INTO wa_local.
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND wa_local TO p_local_table.
CLEAR: wa_local.
ENDDO.
CLOSE DATASET p_filename.
ENDIF.
ENDFORM. " upload_file
*& Form split_localtable
* text
FORM split_localtable CHANGING p_input_tab TYPE t_input_table
p_asset_tab TYPE t_asset_table
p_cost_tab TYPE t_cost_table
p_depr_tab TYPE t_depr_table.
DATA: l_cnt TYPE i.
CLEAR: l_cnt, wa_local.
LOOP AT i_local INTO wa_local.
REFRESH i_split[].
SPLIT wa_local AT c_tab INTO TABLE i_split.
CLEAR l_cnt.
ADD 1 TO l_cnt.
CLEAR wa_split.
LOOP AT i_split INTO wa_split.
IF g_file_flag = 'I'.
ASSIGN COMPONENT l_cnt OF STRUCTURE wa_input TO <fs_field>.
ELSEIF g_file_flag = 'A'.
ASSIGN COMPONENT l_cnt OF STRUCTURE wa_asset TO <fs_field>.
ELSEIF g_file_flag = 'C'.
ASSIGN COMPONENT l_cnt OF STRUCTURE wa_cost TO <fs_field>.
ELSEIF g_file_flag = 'D'.
ASSIGN COMPONENT l_cnt OF STRUCTURE wa_depr TO <fs_field>.
ENDIF.
CLEAR <fs_field>.
<fs_field> = wa_split-col.
ADD 1 TO l_cnt.
CLEAR wa_split.
ENDLOOP.
IF g_file_flag = 'I'.
APPEND wa_input TO p_input_tab.
CLEAR: wa_input .
ELSEIF g_file_flag = 'A'.
APPEND wa_asset TO p_asset_tab.
CLEAR: wa_asset .
ELSEIF g_file_flag = 'C'.
APPEND wa_cost TO p_cost_tab.
CLEAR: wa_cost .
ELSEIF g_file_flag = 'D'.
APPEND wa_depr TO p_depr_tab.
CLEAR: wa_depr .
ENDIF.
CLEAR: wa_local .
ENDLOOP.
ENDFORM. " split_localtable -
Recently my adobe is taking much longer to load PDF files that used to open immediately
recently my adobe is taking much longer to load PDF files that used to load almost instantly
Look at this comprehensive trouble shooting document;
https://discussions.apple.com/docs/DOC-3353
I suggest that you start with SMC and PRAM resets.
Then a Safe Boot.
Ciao. -
Administration - Marketing -> Import, you can set a parameter value "Import mode" for what to do in case of duplication as "update existing records", "Import new records". The final report of this import is presented as a text file that can be viewed in Business Administration - Marketing -> Import -> Exceptions. Whatever the exception, including duplication import occurs during import and recorded in a text file. What are the fields that determine the duplicity? How I can I can change those?
You will be returned anything that is in the option's value parameter. What is displayed in the dropdown and what is put in the value attribute do NOT need to be the same, so maybe you should start there.
-
Problem in scheduling data refresh of excel file that uses PowerPivot
I think I have successfully created and enabled the gateway and data sources for refresh - they are both seeming to connect. However, when I try to schedule a data refresh to occur in the PowerBI site for the Excel file I receive an error message
that the connection could not be established and receive error message "Correlation ID: d118ab93-436d-44a9-8c09-564f64fe0c58". Appreciate any assistance in figuring out how to resolve. Thanks a lotlLet's track it here: https://social.technet.microsoft.com/Forums/en-US/42c806dc-2d82-4bcf-ab6e-c279e2692a68/problem-in-scheduling-data-refresh-of-excel-file-that-uses-powerquery-and-powerquery?forum=powerbiforoffice365
Ed Price, Azure & Power BI Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it! -
How to call Fortran .dll file that using other library files?
Hi,
I am trying to do some arkward tasks using LabView, and I am desperately need help....
A little bit background:
1. My co-worker has some code written in Fortran, where he called other libraries (many from CERNLAB or PAW). Those stuffs are pretty powerful in mathmatical calculation and simulations.
2. In some of my LabView code, I need to call his Fortran source code in order to do some complicated calculations. I have no capablility to translate his Fortran code to Labview (or is it even possible??), so we end up with trying to use "Call library function node" where I just provide input/outputs to communicate with his code. The idea sounds simple enough?
3. We complie the Fortran code into .dll, and then specifiy the dll in "Call library function node". The first try with a very simple Fortran code, something like c = a+b*a, was sucessful. The dll file and Call lib function worked good. It's sort of proved the concept.
4. Now I am trying more complicated Fortran code (say Test.dll), which calling other library (.lib files) that using typical "call xxx(a,b,c)" line, and my nightmare started.... It seems nothing was excuted when I call Test.dll in LabView.
Questions:
1. How do LabView know if the Test.dll code needs functions from other .lib files? Do I need to copy all the .lib files to a specific folder?
2. When I create .dll file, for LabView to be able to use it, are there any special requirement on the way the .dll is compiled?
3. Seems there is mismatch btw the data type in Fortran and LabView. For example, LabView's Signed 8-bit Integer seems different with a integer in Fortran. How can i know the correlation btw data type in different langurage, i.e. LabView vs Fortran?
4. Are there any good examples that I can take a look?
I would highly appreicate any suggestions/helps!
Rgds,
HarryYou are aware that Intel Visual Fortran is the successor to Compaq Visual Fortran (I think you made a mistype with the Virtual)? So an upgrade might be at its place.
Anyhow I'm really not familiar with Fortran at all, but lib files are usually compiled into an EXE or DLL and not loaded dynamically. 1)
So there should be no problem with locating those libs. What most likely is a problem are other DLL dependencies such as any Fortran Runtime library or possibly other third party DLLs the more advanced code in your DLL might be using.
Typically most compilers can be configured to link the runtime library code statically into the DLL, as altenbach reports for the Intel compiler, otherwise you must make sure to install the redistributable Fortran Runtime Library for your compiler. Besides that you must make sure to find out what other runtime dependencies your code might have and install them.
1) One exception I know of is LabWindows CVI which allows to also load lib files dynamically. This is supposedly a legacy feature from LabWindows for DOS, which allowed that feature to simulate dynamic module loading in order to swap modules at runtime to work around the 640k memory limitation of DOS.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Files that used to be visible are now hidden in Mavericks 10.9.1. How can I change the setting to view the same files as before? I do not need the hidden files that are typically invisible.
I am having trouble locating such files as PDF's INDD, AI etc. When I view all hidden files and try to open it in the program..it looks like it is really not on the drive. Has anyone come across a solution?You may need to rebuild permissions on your user account. To do this,boot to your Recovery partition (holding down the Command and R keys while booting) and open Terminal from the Utilities menu. In Terminal, type: ‘resetpassword’ (without the ’s), hit return, and select the admin user. You are not going to reset your password. Click on the icon for your Macs hard drive at the top. From the drop down below it select the user account which is having issues. At the bottom of the window, you'll see an area labeled Restore Home Directory Permissions and ACLs. Click the reset button there. The process takes a few minutes. When complete, restart.
Repair User Permissions -
What is the maximum number of 263 byte text files that can fit in a folder?
what is the maximum number of 263 byte text files that can fit in a folder - on a windows 2000 operating system?
I created a java program that creates these text files.
It was set to loop 30,000 times.
It created a total of 21874 html files before throwing a null exception.
I tried to copy and paste 10 more html files manually and it said not enough disk space.
however, I made a New Folder in that same folder and I was able to successfully paste the folders in
there.
That's interesting.
It appears there is a size limit in each folder, BUT I can make another folder within that and successfully paste more html files in there
Does anyone know the rules governing this feature.
StephenWhatever the answer is, it has nothing to do with Java programming. Microsoft might know, though, and that's where you should look.
-
Is there a way to convert .cwk text files I saved from my iMac PPC so I can view them on my new iMac (intel chip)? I get a message when I try to open them now that says PowerPC applications are no longer supported.
1. Read Roger Wilmut's excellent series of articles: Abandoning Appleworks
2. Considering running Appleworks in Snow Leopard (with Rosetta) installed into Parallels for use in Lion or Mt. Lion
[click on image to enlarge] -
Error while uploading text file....
Halo Friends,
I am uploading 4 text files which contain three columns separated by a tab, but when i am trying to upload those files using WS_UPLOAD Function Module i am getting a runtime error saying 'error while uploading/downloading'.
Please solve this problem as soon as possible.
Thanks in Advance,
ramaHalo again,
Now that i am able to upload the files, i need to update the database table the update statement is executing correctly but when i debug i see that the sy-subrc value is 4 but not 0.
and hence the it is not committed.
Any suggestions. i am pasting my code here for your reference:
Tables: qmfe.
data: begin of gt1_qmfe occurs 0,
qmnum like qmfe-qmnum,
fenum like qmfe-fenum,
/itml/usr20 like qmfe-/itml/usr20,
end of gt1_qmfe.
data: begin of gt2_qmfe occurs 0,
qmnum like qmfe-qmnum,
fenum like qmfe-fenum,
/itml/usr21 like qmfe-/itml/usr21,
end of gt2_qmfe.
data: begin of gt3_qmfe occurs 0,
qmnum like qmfe-qmnum,
fenum like qmfe-fenum,
/itml/usr19 like qmfe-/itml/usr19,
end of gt3_qmfe.
data: begin of gt4_qmfe occurs 0,
qmnum like qmfe-qmnum,
fenum like qmfe-fenum,
/itml/usr07 like qmfe-/itml/usr07,
end of gt4_qmfe.
data: gs1_qmfe like line of gt1_qmfe,
gs2_qmfe like line of gt2_qmfe,
gs3_qmfe like line of gt3_qmfe,
gs4_qmfe like line of gt4_qmfe.
data: ls_lines1 type i,
ls_lines2 type i,
ls_lines3 type i,
ls_lines4 type i.
parameters: ip_file1 type RLGRAP-FILENAME default 'C:\Urgent\TextFiles\StoDt.txt' obligatory,
ip_file2 type RLGRAP-FILENAME default 'C:\Urgent\TextFiles\RcDtCust.txt' obligatory,
ip_file3 type RLGRAP-FILENAME default 'C:\Urgent\TextFiles\DockDate.txt' obligatory,
ip_file4 type RLGRAP-FILENAME default 'C:\Urgent\TextFiles\AWB.txt' obligatory.
field-symbols: <fs1> like gs1_qmfe,
<fs2> like gs2_qmfe,
<fs3> like gs3_qmfe,
<fs4> like gs4_qmfe.
perform upload_gt1_qmfe.
perform upload_gt2_qmfe.
perform upload_gt3_qmfe.
perform upload_gt4_qmfe.
perform update_qmfe.
*& Form upload_gt1_qmfe
text
--> p1 text
<-- p2 text
FORM upload_gt1_qmfe .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = ip_file1
FILETYPE = 'DAT'
TABLES
DATA_TAB = gt1_qmfe.
describe table gt1_qmfe lines ls_lines1.
write: / ls_lines1.
ENDFORM. " upload_gt1_qmfe
*& Form upload_gt2_qmfe
text
--> p1 text
<-- p2 text
FORM upload_gt2_qmfe .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = ip_file2
FILETYPE = 'DAT'
TABLES
DATA_TAB = gt2_qmfe.
describe table gt2_qmfe lines ls_lines2.
write: / ls_lines2.
ENDFORM. " upload_gt2_qmfe
*& Form upload_gt3_qmfe
text
--> p1 text
<-- p2 text
FORM upload_gt3_qmfe .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = ip_file3
FILETYPE = 'DAT'
TABLES
DATA_TAB = gt3_qmfe.
describe table gt3_qmfe lines ls_lines3.
write: / ls_lines3.
ENDFORM. " upload_gt3_qmfe
*& Form upload_gt4_qmfe
text
--> p1 text
<-- p2 text
FORM upload_gt4_qmfe .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = ip_file4
FILETYPE = 'DAT'
TABLES
DATA_TAB = gt4_qmfe.
describe table gt4_qmfe lines ls_lines4.
write: / ls_lines4.
ENDFORM. " upload_gt4_qmfe
*& Form update_qmfe
text
--> p1 text
<-- p2 text
FORM update_qmfe .
data ls_cnt type i.
loop at gt1_qmfe assigning <fs1>.
update qmfe set /itml/usr20 = <fs1>-/itml/usr20
where qmnum = <fs1>-qmnum
and fenum = <fs1>-fenum.
if sy-subrc = 0.
commit work.
add 1 to ls_cnt.
endif.
endloop.
write: / ls_cnt.
ENDFORM. " update_qmfe
Maybe you are looking for
-
DspMaxRequestDepth property in bpel 10.1.3.5
Hi Can anyone please let me know how and where do I configure dspMaxRequestDepth property in bpel 10.1.3.5 version. In BPEL 10.1.3.3 this property is set at the domain level - Domain configuration. Thanks Edited by: 869271 on May 10, 2013 12:44 PM
-
Dynamic Safety Stock - Custom logic
Hi, Are there any exits / enhancements where we can build customer specific logic to periodically update Safety Stock values in the Material Master (MRP Area)? Thanks. Raj
-
Where do I complain...
about the fact that iTunes has no Bob Seger?
-
I have an mxml for my project, in which I have a DataGrid with a few fields, just enough to locate a desired record. When I double click on the item in the DataGrid, a modal form pops up, populated with the data in all the fields of the same record.
-
Hi I have updated my iphone 4s, with the new iso7. Now i can't find how to switch on the cellular data, please help!! Can't find the option in Settings