‎2009 Jan 16 9:07 AM
Hi all,
When i see the file in application server.data is like this
#################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
###################}###}#############A#############???#00\);_(*#################;_(@_) ########???# ########???# ########???###
#######???#########}###}#############)##############}##00\);_(*#################;_(@_) ############ ############ ##############
###################}#A#}#############:##############}##00\);_(#################;_(@_) }###}##############################00\);_(*##########
#######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_) #####
###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_) #####
Because the csv which is uploaded has dropdowns and some formattings.
when download from tcode cg3y i am getting correct file
When try to use open(binary mode) and read dataset i getting data as it is (junk).
i need to process in background.
Any help.
Rhea.
‎2009 Jan 16 10:59 AM
Hi, y u want to uplad the excel file.
convert the same .csy file into .txt format with tab sepatator.
then upload the file to application sever.
then u can get the data wasily.
if you upload from ecel file u will get junk data only.
Thanks,
‎2009 Jan 16 12:03 PM
I have uploaded in csv format only. Even though the data is like in above mail(it is b'coz that file has drop downs n colors etc.
Rhea.
‎2009 Jan 16 12:28 PM
Hi,
Dont upload the file in .csv format.
upload file in .txt format with the tab separator.
Thanks,
‎2009 Jan 16 12:35 PM
Still same junk data if I upload in .txt format. Because the excel cells are formatted to dropdowns(sel values) and has colors.
Any help.
Rhea.
‎2009 Jan 16 12:51 PM
upload file to string format
begin of ty_tab,
string type char200,
end of ty_tab.
loop at ty_tab into string
use statement replace string into tab deliminated fromat(particular occurance in string)
now call class to break string at tab into fields
endloop.
DATA : BEGIN OF i_data OCCURS 0,
data(200) TYPE c, "To hold Upload file data
END OF i_data.
OPEN DATASET v_str FOR INPUT
IN TEXT MODE
ENCODING DEFAULT IGNORING CONVERSION ERRORS.
IF sy-subrc EQ 0.
DO.
*Read a line from input file
READ DATASET v_str INTO i_data-data.
IF sy-subrc NE 0.
EXIT.
ENDIF.
*Append record to an internal table
APPEND i_data.
CLEAR: i_data.
ENDDO.
*Close the file
CLOSE DATASET v_str.
*---Start of inserti
LOOP AT i_data.
REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
INTO i_doc-pvaudt
i_doc-pvpate
i_doc-vecatc
i_doc-vhvend
i_doc-vhidt8
i_doc-vhinvn
i_doc-vhhexp
i_doc-vhiref.
‎2009 Jan 16 2:01 PM
‎2009 Feb 24 9:13 AM