Downloading pipe delimited text file on to desktop with data in internal
hi all,
how to download pipe delimited text file on to desktop with data in internal
table with an example plz.
hi,
u can use the FM GUI_DOWNLOAD.
here is the sample code.
*Internal table to hold the employee details
DATA: it_details TYPE STANDARD TABLE OF x_details,
wa_details TYPE x_details.
*Internal table for file
DATA: BEGIN OF it_details_txt OCCURS 0,
line(700),
END OF it_details_txt.
*Employee details for the file
CLEAR wa_details.
LOOP AT it_details INTO wa_details.
CLEAR it_details_txt.
CONCATENATE
wa_details-var1
wa_details-var2
wa_details-var3
wa_details-var4
INTO it_details_txt-line SEPARATED BY '|'.
APPEND it_details_txt.
CLEAR wa_details.
ENDLOOP.
*Download file in .TXT format to local desktop
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'data.txt'
filetype = 'ASC'
TABLES
data_tab = it_details_txt
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF sy-subrc = 0.
MESSAGE 'Data downloaded successfully' TYPE 'S'.
ENDIF.
Similar Messages
-
XML Column from table extract to Pipe Delimited Text File
Hi,
I have an XML column with large data in a Table ( Source SQL server Database).
I was asked to extract XML column to .txt file using SSIS.
Is it possible to extract xml column with huge data to text file ?
when I tried, select XML column from Table in source , I noticed that Property of column is taken as [DT_NTEXT] . I Converted it to DT_TEXT as Ansi donot support DT_NTEXT.
Execution method was success but it failed due to trucation. so wondering is there a way to get XML column extracted to Pipe delimited text file?
Is it advisable to do this ? or IS It Valid to export XML in Pipe Delimited File ?
Please Kindly advice
thanks
kodiAre you looking at shredding data within XML nodes and then importing it to text file or are you looking at exporting XML value as is? Also is SSIS a necessity?
If not, You can simply use T-SQL for this along with bcp for this. just use a query like
EXEC xp_cmdshell 'bcp "SELECT CAST(XMLColumn AS varchar(max)) AS Column FROM table" queryout <full file path> -c -S <ServerName> -T -t |'
provided you use trusted connection (windows authentication)
see
http://visakhm.blogspot.in/2013/10/bcp-out-custom-format-data-to-flat-file.html
If you want to shred the data use Xpath functions in the query as below
http://visakhm.blogspot.in/2012/10/shred-data-as-well-as-metadata-from-xml.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
If you have answer, please provide specific and detailed steps.
Situation 1:
Start:
150+ files in .xls OR .xlsx format
data contains many characters EXCEPT "Tab"
Process:
Use Automator to:
Select Files from Finder window
Convert selected files from xls/xlsx to TAB-DELIMITED file format
End:
150+ files in .txt format
files have identical names to those from "Start:"
data is TAB-DELIMITED
Situation 2:
Start:
150+ files in .xls OR .xlsx format
data contains many characters EXCEPT | (pipe, vertical bar)
Process:
Use Automator to:
Select Files from Finder window
Convert selected files from xls/xlsx to |-delimited file format
End:
150+ files in .txt format
files have identical names to those from "Start:"
data is "|"-delimitedIf your post is addressed to my response then the answer is you have to write your own or search on-line to see if something exists to do what you want.
As you note there is no pre-built script for this.
regards
Message was edited by: Frank Caggiano - Are you certain there isn;t something in Excel to export as a tab delimited file?
This link Convert An Excel Spreadsheet To A Tab Delimited Text File seems to indicate that the function is in Excel already. -
Application Server Download - Tab Delimited Text File
Hi,
I am trying to create a tab delimited text file in application server. Is there any option should i use with the Open Dataset / Transfer statements? My requirement is to download the file (Text - Tab Delimited) into Excel for further analysis. Can you please suggest me a suitable solution for this?
Thanks,
Kannan.Hi,
You can use transactions CG3Y and CG3Z. Its very simple.
Refer sample code:
constants: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_path TYPE VALUE char100 '/local/data/interface/A28/DM/OUT'.
*& Form f1001_browse_appl_file
Pick up the file path for the file in the application server
FORM f1001_browse_appl_file .
DATA: lcl_directory TYPE char128.
lcl_directory = p_direct.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = lcl_directory
filemask = c_mask
IMPORTING
serverfile = p_f2
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE s000 WITH text-039.
EXIT.
ENDIF.
ENDFORM. " f1001_browse_appl_file
*& Form f1004_app_file
upload the file from the application server
FORM f1004_app_file .
REFRESH: i_input.
OPEN DATASET p_f2 IN TEXT MODE ENCODING DEFAULT FOR INPUT.
IF sy-subrc EQ 0.
DO.
READ DATASET p_f2 INTO wa_input_rec.
IF sy-subrc 0.
MESSAGE s000 WITH text-030.
EXIT.
ENDIF.
o
+ Split The CSV record into Work Area
PERFORM f0025_record_split.
o
+ Populate internal table.
APPEND wa_input TO i_input.
CLEAR wa_input.
ENDDO.
ENDIF.
ENDFORM. " f1004_app_file
*& Form f0025_record_split
Move the assembly layer file into the work area
FORM f0025_record_split .
CLEAR wa_input.
SPLIT wa_input_rec AT c_split INTO
wa_input-legacykey
wa_input-profile_role
wa_input-read_date.
ENDFORM. " f0025_record_split
DO your manipulation with the data records here.
Popualte data into final internal table and write it back to application server at the desired path.
*& Form f0020_write_application
Write error log to application Server
FORM f0020_write_application .
IF p_f1 IS NOT INITIAL.
CONCATENATE p_direct p_obj sy-datum text-037 INTO p_f2.
ELSEIF p_f2 IS NOT INITIAL.
REPLACE text-036 IN p_f2 WITH text-037.
ENDIF.
OPEN DATASET p_f2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc 0.
EXIT.
ENDIF.
LOOP AT i_error INTO wa_error.
TRANSFER wa_error TO p_f2.
IF sy-subrc 0.
EXIT.
ENDIF.
CLEAR wa_error.
ENDLOOP.
CLOSE DATASET p_f2.
ENDFORM. " f0020_write_application
HTH,
Regards,
Dhruv Shah -
Fastest way to export to a pipe-delimited text file
I'm using Oracle 9i and need to export a table that has 150 million rows into a text file (or multiple text files based on a query that divides the table). I'd like it to be pipe-delimited and without quotes around strings.
How can this be done so that it runs fast? Keep in mind, I'm kind of a newbie.I don't know what the fastest method would be but I would put quite a bit of money on it not being the Oracle SQL Developer tool, which is the subject of this forum.
-
Text File is not picking with data
Hi Experts,
I am doing file to file scenario without IR as file will be generated by the ECC system and places in SAP FTP App Server.
My job is to pick up the file and send it to the Third Party Application Server.
But when i am picking up the Text file the data in the file is converting into special characters like below format.
ÅÁÄÅÙ@ððððððâÖÕÄÅçöôðð@@@@@@òððùð÷ñ÷ðñ%@@@@@@@@@@@@@@òððùð÷ñ÷%ÄÅãÁÉÓ@ðððð
I have tested with other Application server with same file its working fine, but when i send the file from SAP FTP Appl server the data is converting in the above format.
Right now when i open file zilla it is opening with 3 FTP Appl Server in that suppose lets say the FTP are APP1, APP2, APP3.
1.When i send the file from APP1 through Transport Protocol NFS System the file is picking up and placing successfully in the Third Party APP3 App Server fiolder but the data in the file is converting into special charaters.
2.when i send the same file from APP2 through Transport Protocal FTP the file is picking up and placing successfully in the third party APP3 App server and here the same data is coming in the text file, there is no data conversion.
I am not getting here, when i send the file from APP1 the data is converting but when i send the same file from APP2 App srever the data is posting correctly.
And also i can give you one more info.. if i try with puting the Transport Protocal as FTP in APP1 then i am getting error in sender comm channel as 'log on attempt by User JOHN rejected' : contact your FTP server vendor.
But i think for sending the file from SAP Appl Server we can use TP as NFS rather than FTP.
And also i can give one more info: The Version is the ECC system is using the 4.6c for which there is no compatability for unicodes.
Can anyone please advise what would be the wrong.
Appreciate your inputs
Thanks,
BhaskarHi,
Reason because file is not picked up.
>'log on attempt by User JOHN rejected' : contact your FTP server vendor.
clearly user/password for this FTP server or system is not correct. Get correct userid/password for your Application server where you are trying to poll.
>The Version is the ECC system is using the 4.6c for which there is no compatability for unicodes
File transfer is nothing to unicode here.
Regards,
Gourav -
I want to take the .DAQ file from the MAX program and convert it to a text file. From my understanding this file contains all the information for the channels and hardware that is currently set up on the system. I want to use this data as a file so that others can set up the experiment again in the future and this data would be helpful. Thanks in advance for any help in regard to this matter.
HAL;
I'm attaching a Labview example to this answer which does that with the properties of your virtual channels configuration in MAX. Other than that, there isn't any way, at this time, to convert the .daq file to a text file.
Hope this helps.
Filipe
Attachments:
vrtchstf.zip 19 KB -
Hi friends,
My requirement is i need to download a tab delimited text file.
i am using the below coding but i am able to download a file but it is not coming with delimited.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = file_str
write_field_separator = 'X'
TABLES
data_tab = outab
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.
pls give solution for thishi ,
Plz chek the below code...
v_name1 is the destination where u want to store
c_asc is the constant '.ASC'
C_X MEANS 'X'.
Down load the contract error files to presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_name1
filetype = c_asc
write_field_separator = c_x
TABLES
data_tab = i_error
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 e140.
ENDIF.
Regards,
Nagaraj -
OPEN DATASET output to Tab delimited text file???
Can anyone suggest the best way for downloading a TAB DELIMITED text file to the application server using open dataset.
I'm currently downloading the file, but I find that it puts "#"'s in place of empty numeric fields.
any help appreciated,
LeeHi Lee,
System identifies Tab delimited as #.
But its not a problem.
If you wang to download the data into intenal table,
you need to do declare delimiter.
Refer code:
CONSTANTS: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_hash TYPE c VALUE '#'.
data:wa_input_rec TYPE char2000.
OPEN DATASET p_appl IN TEXT MODE ENCODING DEFAULT FOR INPUT.
IF sy-subrc = 0.
DO.
READ DATASET p_appl INTO wa_input_rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
*-- Split the Tab # into corresponding Columns fields.
PERFORM f0056_split_records.
APPEND wa_input_file TO i_input_file.
CLEAR: wa_input_rec, wa_input_file.
ENDIF.
ENDDO.
FORM f0056_split_records .
CLEAR wa_input_file.
SPLIT wa_input_rec AT c_split INTO
wa_input_file-column0
wa_input_file-column1
wa_input_file-column2
wa_input_file-column3
wa_input_file-column4 IN CHARACTER MODE.
ENDFORM. " f0056_split_records
Reward points if this helps.
Manish
Message was edited by: Manish Kumar
Message was edited by: Manish Kumar -
How to get summary columns in delimited text file
How to get summary columns in delimited text file
I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.Sorry there were a typos :
When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ? -
What is the best and most efficient way to read a .xls File and create a pipe-delimited .csv File?
Thanks in advance for your review and am hopeful for a reply.
ITBobbyP85You should have no trouble doing this in SSIS. Simply add a data flow with connection managers to an existing .xls file (excel connection manager) and a new .csv file (flat file). Add a source to the xls and destination to the csv, and set the destination
csv parameter "delay validation" to true. Use an expression to define the name of the new .csv file.
In the flat file connection manager, set the column delimiter to the pipe character. -
Receiver File Adapter - Tab delimited Text file
I am using receiver file adapter to convert message created by ABAP PROXY to convert tab delimited text file format.
XML message is in following format.
- <DT_R3_ROLES_OUTBOUND_REC>
<LIST_CATEGORY>SAP_HR</LIST_CATEGORY>
<USRID>MRUDULAP</USRID>
<EMAIL>[email protected]</EMAIL>
<NAME>MRUDULA PATEL</NAME>
</DT_R3_ROLES_OUTBOUND_REC>
- <DT_R3_ROLES_OUTBOUND_REC>
<LIST_CATEGORY>SAP_HR</LIST_CATEGORY>
<USRID>HCHD</USRID>
<EMAIL>[email protected]</EMAIL>
<NAME>H CHD</NAME>
</DT_R3_ROLES_OUTBOUND_REC>
I have used file content conversion in the adapter configuration.
Recordset structure = DT_LISTSERV_INBOUND_REC
DT_LISTSERV_INBOUND_REC.addHeaderLine = 0
DT_LISTSERV_INBOUND_REC.fieldSeparator = ','
How to use Tab as the delimiter in the fieldSeparator field?
Now the output in the file is as follows :
[email protected]'MRUDULA PATEL
[email protected]'H CHD
What I need to do to make the file as the tab delimited file?
Thanks in advance!
Mrudula PatelHi Mruddula,
Use fieldSeparator: '0x09' for horizontal tab
<b>DT_LISTSERV_INBOUND_REC.fieldSeparator: '0x09'</b>
Naveen -
How do I save a Number file to an delimited text file
I was trying to import all my conatct that I created from Number to iList, I kept on failing, after I did some reaserch, and found out I need to save to an delimited text file. Can anybody help me? Or if anyone can direct me from import an Number file into iList, it would be wonderful, please help.
Thank againYou have a couple of options to convert the data to a tab-delimited file. The easist may be to copy the table from Numbers & paste it into a Pages word processing document. From there you can export it as a plain text file which you can then import.
Jerry,
IList Data is a database app that may be a solution for those moving from AppleWorks. It's more than Bento & less than FileMaker. -
How to get tab delimited text file when Stored Procedure executes ?
Hello Everyone,
I have a stored procedure which returns 1 result set as an output.
I want the output as a Tab Delimited Text file.
I know that I can use SSIS and get the same output but I am not allowed to use SSIS in this case.
Is there any other ways ?
I will be really appreciate If someone can answer with, How many different ways I can get Tab delimited text file ?
Thanks in advance
Henaryyou can do that by using SQLCMD
http://blog.sqlauthority.com/2013/03/05/sql-server-exporting-query-results-to-csv-using-sqlcmd/
you can also use BCP
EXEC master..xp_cmdshell 'bcp "select * from tempdb.dbo.orders" queryout "c:\output.txt" -c -T'
EXEC master..xp_cmdshell 'bcp "exec usertest.dbo.proctest" queryout "c:\output.txt" -c -T'
--Prashanth -
EXcel to tab delimited text file
I am saving an excel file into a tab delimited text file so that i can use it for uploading data.
The excel file contains a text field in which there is a comma ',' .
for all the fields which has a comma in the excel file
the text file is adding double qoutes " in the beginning and end of the filed.
for example
contents of filed in excel file is : GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE
and in the text file it is coming as "GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE"
i dont want the " in the beginning and end
can anybody help.
points will be rewarded.
I am just saving the excel file as tab delimited text file and i am getting the quotes added in the begining and end.
Thanks.Thats to preserer the comma in between otherwise when you upload the same the data will split at comma.
Regards,
Amit
Reward all helpful replies.
Maybe you are looking for
-
Photos erased in catalog = loss of hundreds of treatments with no reason
Hi, In the last three days, I lost hundreds of treatments. The photos from my folder disapeared with no reason. I have to import them again (they are on the hard drive) and work again on treatments !!!! I just lost a lot of time for nothing. I am usi
-
Hi Can any one explain the difference between Reset (FBRA) and Reversal (FB08) process. And is there any process like Mass reset , like Mass reversal (F.80)?If yes, what is the T-Code for it, please explain the process. Thanks in advance.
-
Fireworks CS6 Stuck at 45% Install
Using the Adobe Creative Cloud to download and install Fireworks CS6, it gets stuck at 45% each time. Fireworks was originally installed then I uninstalled it and failing to reinstall (4 times). Is there a way to manually uninstall Fireworks CS6 comp
-
Hello, When I paste the following URL within an iframe, I do not see filters, however, when I try this in a browser, everything renders fine: http://<server>/oraclebam/ReportServer/default.aspx?Event=ViewReport&ReportDef=25&ReportParameters=(User%20A
-
Workflow to pull down bwf audio?
Hi. Film student in Austin here. I'll be cutting a 23.98HD project--originally shot on 16mm--but telecined to 23.98HD for eventual 23.98 HD output. The audio was recorded as 48k bwf files. So, the 24p film, having been transferred to 23.98HD, has bee