on 04-11-2006 7:43 PM
hi folks,
I am reading the data from the flat file(.CSV) into a single line and then splitting the data at the ',' and reading them into the fields of internal table like:
DATA: tb_line(125) type c.
data: begin of rec occurs 1,
businessunit(3) type c,
tablename(30) type c,
oldlegcode(30) type c,
description(30) type c,
newlawsoncode(30) type c,
records(8) type c,
message(50) type c,
end of rec.
READ DATASET filein INTO tb_line.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
split tb_line at ',' into REC-businessunit
REC-tablename REC-oldlegcode REC-description
REC-newlawsoncode.
the data read into the tb_line is
tb_line = BPF,PAYCODES,OVERTIME,Overtime,OTP#
and therefore the final field takes the value 'OTP#'
To get rid of this '#' I have read the final field value into a variable and then remove the ''#" using shift.
<b>My question is can we avoid the appearence of '#' while reading the data into the tb_line.</b>
Because on three separate occasions I have encountered this scenario and everytime I will have to declare the varuable for the last field and remove the '#" sign with some additional code.
Is there a better way to solve this?
Thanks
Vinu.
If you are shifting it one place to the right and then back to remove it, I believe that this is the best way to handle it. This is the line return in the file. You don't really have any control of the file so this is the best way, to handle yourself.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I meant selecting some other button against the post where you clicked 'Problem Solved'. I cannot do that. You have to do that. This is what you need to do. I think you will see a button that says 'The problem is not solved yet' or something like that. By doing that it will open the post again. You can then assign the 'Problem Solved' to Rich. You can simply remove all the points assigned to me that were not meant to be.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.