2008 Feb 27 3:58 AM
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
2008 Feb 27 4:11 AM
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.
2008 Feb 27 4:20 AM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |