Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem while uploading file from application server to internal tab in BG

Former Member
0 Likes
957

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.

7 REPLIES 7
Read only

tarangini_katta
Active Contributor
0 Likes
898

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,

Read only

0 Likes
898

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.

Read only

tarangini_katta
Active Contributor
0 Likes
898

Hi,

Dont upload the file in .csv format.

upload file in .txt format with the tab separator.

Thanks,

Read only

0 Likes
898

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.

Read only

Former Member
0 Likes
898

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.

Read only

0 Likes
898

I HAVE IMAGES IN MY INPUT FILE (EXCEL)

rhea.

Read only

Former Member
0 Likes
898

No answers