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

USING SAP_CONVERT_TO_XLS_FORMAT

Former Member
0 Likes
877

Hi All,

when i am uploading data into sap using the function module SAP_CONVERT_TO_XLS_FORMAT . But i saw this function module structures, The decelaration of text is 256 chars, but my upload text is more than this , how to solve this pls advise me.

Regards ,

sksk

Hi All,

when i am uploading data into sap using the function module SAP_CONVERT_TO_XLS_FORMAT . But i saw this function module structures, The decelaration of text is 256 chars, but my upload text is more than this , how to solve this pls advise me.

Regards ,

sksk

2 REPLIES 2
Read only

Former Member
0 Likes
575

Hi,

You can use FM 'GUI_UPLOAD' for uploading the data from excel file to SAP. There you can

have any number of fields but which must be of the elementary type only.

Read only

Former Member
0 Likes
575

hi,

This is an example code for GUI_UPLOAD.

data: begin of itab occurs 0,

text(25) type c,

end of itab.

*DATA :dataset TYPE dxfields-longpath VALUE 'E:\usr\sap\put\TEST1.TXT'.

parameter: fname type rlgrap-filename.

parameter: p_lpath type filename-fileintern.

parameter: name(30).

constants: co_var(9) value 'FNAME',

co_ftype(10) value 'ASC',

co_fsep value 'X'.

data : fname1 type string.

data: file type rlgrap-filename.

data: wg_file type filename-fileextern.

at selection-screen on value-request for fname.

        • function call to get f4 search for files

call function 'KD_GET_FILENAME_ON_F4'

exporting

program_name = syst-repid

dynpro_number = syst-dynnr

field_name = co_var

changing

file_name = fname

exceptions

mask_too_long = 1

others = 2.

fname1 = fname.

          • TO MIGRATE THE FILE FROM PRES. SERV. TO INTERNAL TABLE

call function 'GUI_UPLOAD'

exporting

filename = fname1

filetype = 'ASC'

tables

data_tab = itab

exceptions

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4.

start-of-selection.

          • TO GET THE PHYSICAL PATH BY GIVING THE LOGICAL PATH

call function 'FILE_GET_NAME'

exporting

logical_filename = p_lpath

importing

file_name = file

exceptions

file_not_found = 1

others = 2.

hope this helps u,

Regards,

Arunsri