2009 Sep 14 8:53 PM
Hi All,
The file is comma delimited, however the text fields are qualified by quotation marks, such as "NAME", "LAST", "AB,001"
How can SAP programmed so that it recognizes the quotation mark as text qualifier?
I am using a split command, but it fails when we have a comma in the field value...
Thanks,
Tatvagna.
2009 Sep 15 6:44 AM
Hi,
The Following code will help, try and revert back;
DATA : STR(100) TYPE C VALUE '"NAME","LAST","AB,001"'.
DATA : NAME(10),LAST(10), VALUE(10).
DATA : LEN TYPE I.
SPLIT STR AT '","' INTO NAME LAST VALUE.
LEN = STRLEN( NAME ).
NAME = NAME+1(LEN).
LEN = STRLEN( VALUE ) - 1.
VALUE = VALUE+0(LEN).
WRITE : NAME, LAST,VALUE.
Regards
Karthik D
2009 Sep 14 11:09 PM
You can do it line by line, with FIND or SEARCH for phrase ", then split the line based on result and offset. Though, not state of art approach but should work.
Regards
MArcin
2009 Sep 15 6:44 AM
Hi,
The Following code will help, try and revert back;
DATA : STR(100) TYPE C VALUE '"NAME","LAST","AB,001"'.
DATA : NAME(10),LAST(10), VALUE(10).
DATA : LEN TYPE I.
SPLIT STR AT '","' INTO NAME LAST VALUE.
LEN = STRLEN( NAME ).
NAME = NAME+1(LEN).
LEN = STRLEN( VALUE ) - 1.
VALUE = VALUE+0(LEN).
WRITE : NAME, LAST,VALUE.
Regards
Karthik D
2012 Jan 17 9:27 AM
2012 Jan 17 10:10 AM
try this:
DATA: lv_file_rec TYPE string VALUE '"NAME", "LAST", "AB,001"'.
WRITE / LV_FILE_REC.
TRANSLATE lv_file_rec USING '" ' .
WRITE / lv_file_rec.
Output: NAME , LAST , AB,001
2012 Jan 27 11:38 AM
Dude,REGEX can help you in achieving this.You can do a search in SDN using the key word REGEX to get more info.
Thanks,
K.Kiran.