Carrier return problem, how to remove CR
Hi, I just created a BSP page that should upload a CSV file in its original state to the application server.
for example, there are 3 columns in my original .CSV file separated with ; ->
12412,22;2342,32;1000,40
1000,32;3444,31;4500,11
right now, it is uploaded in the following format instead of the one above
12412,22;2342,32;1000,40#
1000,32;3444,31;4500,11#
The problem is, that when I use this file from the application server, it gives errors on the last fields, because it thinkgs it should take 1000,40# instead of 1000,40 as an amount.
This problem would be solved, if data was loaded without adding the # after every row.
Data is loaded from my pc to the application server using a BSP with the following code:
write file to server
fname = '/usr/sap/CBD/DVEBMGS03/data/RU_BRA_PRO.CSV'.
OPEN DATASET fname FOR OUTPUT in BINARY MODE.
if sy-subrc gt 0.
WRITE: / 'Error opening file'.
endif.
TRANSFER file TO FNAME.
CLOSE DATASET FNAME.
What do I have to do (sorry, ABAP&BSP newbie) to upload the file in its original state, to avoid the # being added...
thanks
Thanks to Eddy, this issue has been solved. The solution, when writing in TEXT MODE, was to define the input file as type STRING and reading it using get_Cdata instead of get_data.
here is the full code, so that people that are not programming guru's can get something out of this too! Eddy, thanks a 1000 !
data: entity type ref to if_http_entity,
file type string,
content_type type string,
content_length type string,
num_multiparts type i,
i type i value 1,
doEcho type string,
value type string.
find multipart containing file
num_multiparts = request->num_multiparts( ).
while i <= num_multiparts.
entity = request->get_multipart( i ).
value = entity->get_header_field( '~content_filename' ).
if not value is initial.
found a file!
navigation->set_parameter( name = 'content_filename'
value = value ).
content_type = entity->get_header_field( 'Content-Type' ).
navigation->set_parameter( name = 'content_type'
value = content_type ).
get file content
file = entity->get_cdata( ).
get file size
content_length = xstrlen( file ).
navigation->set_parameter( name = 'content_length'
value = content_length ).
data: data_TAB type table of string, LIN TYPE LINE,fname type string.
split file at CL_ABAP_CHAR_UTILITIES=>CR_LF into table data_TAB.
fname = '/usr/sap/CBD/DVEBMGS03/data/FILENAME.CSV'.
OPEN DATASET fname FOR OUTPUT in TEXT MODE encoding default.
if sy-subrc gt 0.
WRITE: / 'Error opening file'.
endif.
LOOP AT data_TAB INTO LIN.
TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
Similar Messages
-
Carrier return problems within calculations
Hi everyone
Carrier return problems.
I work with Numbers with Excel users, so I'm a victim of Excel.
In my calculations I'd like to make carrier returns.
As I understand it:
Numbers understands: CHAR(8232)
Exel understands: CHAR(10)
Does anyone know of a CHAR() which both applications understand?
Or
Does anyone know of a calculation, so I can save it in Excel format troublelfree.
The problem is, if I use the CHAR(8232) in an export of Excel the whole calculation is gone and only the product is left.
Any input would be helpfull.
Thanks.
JakobNumbers' CHAR function accepts numbers 32 and higher, except 127
Excel's accepts the numbers 1-127
The only solution I can think of is an error check. In Numbers, 8232 will be used. In Excel, 13 will be used:
IFERROR(CHAR(8232),CHAR(13))
Note: I used 13 instead of 10 because 10 didn't seem to do anything for me in Excel. -
JLayeredPane problem: How to remove object added at specific depth in
JLayeredPane?
For instance, I have a class called BlobEvolution. In that class, I have an array of JLayeredPanes squrares[row][col][depth]. I add an object Blob, to a new LayeredPane cell, using the statement LayeredPane cell=new LayeredPaine();
cell.add(Blob, new Integer(2));, then I add the cell to a contentPane using contentPane.add(cell). I set squares[row][col][0] to point to cell, and squares[row][col][2] refers to the blob object in the cell.
but now I want to remove a certain layer from the cell and repaint that cell to display only the deeper contents of the cell. Or I want to remove the blob in the cell, which is always at depth 2 in the cell. How would I do that? And how do I repaint only that cell?By the way, both objects that I add to the layeredpanes extend JLayeredPanes.
I actually tried to do this remove call: squares[row][col][0].remove(2);
I was trying to point to the cell layeredpane that contains the two objects, blob, and plankton. blob was placed at depth 2, so I tried to remove the depth 2 component. but I get an ArrayIndexOutofBounds Exception and it says no such child:2. java.awt.Container.getComponent(Container.java:237)
javax.swing.JLayeredPane.remove(JLayeredPane.java:216)
BlobEvolution.removeblob(BlobEvolutioin.java:133)
That's essentially the error message I get in the console. Obviously, it's the remove statement above that's giving me the problem, but I don't know what's wrong with it and how to fix it.
Please, if anyone can help I'd really appreciate it. -
How to remove special characters while typing data in edit cell in datagrid in flex4
Hi Friends,
I am facing this problem "how to remove special characters while typing data in edit cell in datagrid in flex4".If know anyone please help in this
Thanks,
Anderson.Removes any characters from
@myString that do not meet the
provided criteria.
CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
RETURNS varchar(500) AS
BEGIN
While @myString like '%[^' + @validChars + ']%'
Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
Return @myString
END
Go
Declare @testStr varchar(1000),
@i int
Set @i = 1
while @i < 255
Select
@TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
@i = @i + 1
Select @TestStr
Select dbo.GetCharacters(@TestStr,'a-z')
Select dbo.GetCharacters(@TestStr,'0-9')
Select dbo.GetCharacters(@TestStr,'0-9a-z')
Select dbo.GetCharacters(@TestStr,'02468bferlki')
perfect soluction -
How to remove the Sessions used in the application
Hai Techies,,,
i am using many number of sessions in my application, for example i am using 5 sessions in reports module
my application is a web based application
if can't remove the sessions it contains the huge amount of data , my application is going into mess, and the application performance will be decreased..
Can anybody tell the solution for this Problem
How to remove the Sessions used in the application
Hoping a reply
Thanks & Regards
Krishna mangamuriHai Gita,
i am not able to do the session invalidate method bcoz, i am mainatainting the session from login along with the current userid who is login into the system and putting some of the data in session....
thats session is to be valid upto when i click on logoff link
except that i have to remove the sessions in my application
while navigating from one jsp to another i have to remove the sessions, bit somes times that sessions may be used somewhere
Can u Understand My problem
session remove method may also helpful to me but some times it will casue some prob to me
Is there any other Way to remove the sessions in the Application ????
Thanks & Regards
Krishna Mangamuri -
Hello! The question is this. In London, took the Iphone 5 as sim free, flew to Moscow put Simcoe, and he writes me that is locked to the operator O2. Can anyone encountered this problem? What to do? How to remove the Unlock?
<Edited by Host>Look at your receipt. Does it say unlocked? It is possible to purchase both locked "sim free" and unlocked iPhones from Apple.
ONLY the carrier an iPhone is locked to can legitimately unlock it.
IF your receipt says that it was supposed to be unlocked, and it is not, call AppleCare. They should be able to straighten it out. -
A process by the name of avgcmgr is loading the CPUs by up to 100 percent. At least 5 of them have appeared on the activity monitor. I've removed them with forced quit but they return! How do I permanently get rid of them? Three of these processes has now driven the CPUA temp to 194F.
RayHi Ray-
I'm having the exact same problem and have searched the web for hours looking for a solution (multiple spawned avgcmgr processes that consume cpu).
Did you find any solution?
Thanks so much!
Steve -
how to remove a black border box that continously tabs to each field automatically till end of web page; restarts to top of page, cannot stop this box. Scroll bar cannot be controlled with mouse, scroll bar returns automatically to the top of scroll slide every time I move the bar to the bottom of the scale. Also, there's a rectangular text box (with black background and white text) that is always on the desktop that emulates a typed text, HTML, or cmd function.
cjuan1morb4ulv wrote:
how to remove a black border box that continously tabs to each field automatically till end of web page; restarts to top of page, cannot stop this box. Scroll bar cannot be controlled with mouse, scroll bar returns automatically to the top of scroll slide every time I move the bar to the bottom of the scale. Also, there's a rectangular text box (with black background and white text) that is always on the desktop that emulates a typed text, HTML, or cmd function.
The first two problems (box cycling from element to element on page, scroll bar returning to top) can be caused by a stuck (or defective) Tab key on the keyboard. Such damage can be caused by a liquid spill; just one tiny droplet is enough to short a wafer switch under one key.
The last issue (black box, white text - sounds sorta like a debugger window) I haven't seen, but could be caused by something similar.
To check for that, try using a different keyboard. If you're using a wireless keyboard, turn it off and see if the oddities stop. -
What is the command for removing a hard return? I want to know how to remove a hard return in a document or an email (I’ve tried both Word and my email). I'm new to Mac but on my PC I usually just put the cursor to the right of the last letter on the line and hit delete and the line below gets moved up but in the MAC when I do that all it does is delete the letters in the word to the left of the cursor.
Thanks.After playing with this idea it looks like the solution is to put the cursor in front of the first word on the line you want to move to the line above it and then hit delete. Just hitting enter/return adds another hard return.
Thanks! -
How to know they is space or carrier return when java read a text file.
Hi,
Please help.
How to know they is space or carrier return when java read a text file.
The reason is that. I want to use java for loop to read each part of value. for example: first part is the items name. After the space (I need to tell java when this is a space here and its need to skip) , following by the items prices in double value and space again (need to skip also) and etc.
item name1
item name2
item name3
item name4
item name5
<--- here is the space to skip and another loop to read following items prices
item price1
item price2
item price3
item price4
item price5
<--- here is another spcae again. and so on
thank in advance!You can check to see if the sting you read in is just nothing, depending on how you're reading it in:
if((str = inStream.readLine().trim().equals("")))
// skip and get ready for the next section
else
// handle the next item
The trim() method gets rid of all leading and trailing spaces and I'm assuming you're using a stream that can use the readLine() method that returns a String.
I hope this is clear. Let me know if it isn't, I'll try and word it different, or post how you're reading the values in if you need more help. -
how to remove 1797 emails. stuck in inbox. but not showing anymore - and i have the same problem wit the sent. please help
This is a user supported frum, so making threats really doesn't help, besides which it's not like any of us can really make a dent in Toshiba's bottom line despite how many people we think we can influence. Unless those people were standing in line to buy a Toshiba product cash in hand, and you pulled them out, it really doesn't add up for them.
At this point it would probably be better for you to use the 800 number. Have all your e-mails ready to forward, if needed, to whoever you end up talking to. Don;t let them off the hook. An hour on the phone is much better than weeks passing e-mails through a support site. Also contest the charge with your bank or credit card. -
How to know theis a space or carrier return when java read read a text file
Hi,
Please help.
How to know theis a space or carrier return when java read read a text file.
for example a text like this:
5
<---how to let tell java they is a space here
item1
item1
item1
item1
item1
<---how to let tell java they is a space here
item2
item2
item2
item2
item2hi!
The reason is that. I want to use java for loop to read each part of value. for example: first part is the items name. After the space (I need to tell java when this is a space here and its need to skip) , following by the items prices in double value and space again (need to skip also) and etc.
item name1
item name2
item name3
item name4
item name5
<--- here is the space to skip and another loop to read following items prices
item price1
item price2
item price3
item price4
item price5
<--- here is another spcae again. and so on
Thank in advance for your help.
jet -
How to Remove "carrier settings updates"
Hello
do you know how to remove carrier settings updates downloaded from Itunes?
ThanksThe bottom of this document tells you where they are on your computer. I suppose you could delete them. There's nothing about deleting them from the phone.
http://support.apple.com/kb/HT1970 -
Tried the posted solution for the RETR problem and it works once then it returns. Once the email dl'ds the file deleted per the instructions returns. How do you make the change permanent?
Hi DOC808HI
# I don't know what you mean by "posted RETR solution". Could you please post a link to the suggested solution? Perhaps you are referring to this thread: https://support.mozilla.org/en-US/questions/991792 ?
# Anyhow any further troubleshooting information you can provide will be great e.g. Your Operating System Version (XP, 7, Mac OS X Mavericks), your anti-virus if any, your mail provider, your ISP, what you did, what happened with exact error message, what happened
Cheers!
...Roland -
Problem with Vsearch malware. Any updated information on how to remove?
Hello, I have a problem with Vsearch malware. Any updated information on how to remove?
I've tried some of the suggestions but it's still there and very annoying
I have a MacBook Pro OS X Version 10.9.4 and my using Firefox.
Many thanksIdentify and remove adware
http://www.thesafemac.com/arg/
or
use Adware Removal Tool.
http://www.thesafemac.com/art/
Maybe you are looking for
-
Why is connection to iTunes stores so temperamental? For the past 3 days I have been unable to download my newspaper subscription or use my iTunes account as the blue icon pops up and says there is no access and one just has to press OK. I took the i
-
Start BI Services as Windows Service in OBIEE 11g
Hello All, We need to Automate the Start BI Services in OBIEE 11g. The options that were tried from my side to achieve the same are as follows: 1) Creating Command files for Admin_Server and BI_Server 2) Creating Utility files installSvc_Admin.cmd an
-
[JS][CS3] Import ai into another ai
Hi, My goal is to import [rather than place] another ai into the target ai, with all attributes of the objects + layering preserved. There are two shortcut methods available: a) groupItems.createFromFile(srcFile) - but this creates over-complicated l
-
Open website url with buttons in flash
i have a header built in a big flash file that i am using at the top of a website. i would like the buttons i put on the flash document to be able to open different pages of the document, if there is any codes in its simplest form to link a button to
-
New Dell laptop. No DVD/CD drive
How do I load my ulilities to this laptop?