‎2005 Nov 17 2:38 AM
I try to upload data directly from Xlfile to Internal table.I have used the foll function module
ALSM_EXCEL_TO_INTERNAL_TABLE
and it's working nicely when i run the program from R/3.
My Question is ,if i access the same program from ITS ,no record is uploaded .
Any help will be much appreciated .
Rgds,
J.
‎2005 Nov 17 3:11 AM
‎2005 Nov 17 3:11 AM
‎2005 Nov 17 3:17 AM
Thks .
I tried to use
WS_UPLOAD
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = file_path
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = data_tab .
************************************************
but in the output table am getting '######' for the field values .
cud u help me ?
Rgds,
J
Message was edited by: Jothivenkatachalam.P
‎2005 Nov 17 3:34 AM
Jothi,
Can you please close this thread if you think you got satisfactory answer to the earlier question.
Regarding the current question ,
What is the Sy-sbrc after the function module.
It should be either zero or one of the following.
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6.
Cheers
Raghava
‎2005 Nov 17 3:57 AM
Hi raghava,
I hav changed the fn module to Remote Enabled . Still it doesn't work . I hope it's the prob of OLE as suggested by the other user .
That Expections i hav included already . Still the problem persists .
Rgds,
J
‎2005 Nov 17 4:31 AM
Hi,
try with this sample code.
**************
----
at selection-screen on value-request for p_file.
----
call function 'F4_FILENAME'
exporting
field_name = 'p_file'
importing
file_name = p_file.
----
start-of-selection.
----
clear itab.
call function 'WS_UPLOAD'
exporting
codepage = ' '
filename = p_file
filetype = 'DAT'
tables
data_tab = itab
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
others = 10.
if sy-subrc ne 0.
message e000 with text-e01.
stop.
endif.
I hope it will work for you.
Thanks.
‎2005 Nov 17 5:13 AM
hi deepak,
Tried with the code given by u.
now am getting the values "########" for the fields uploaded .
Rgds,
j
Message was edited by: Jothivenkatachalam.P
‎2005 Nov 17 6:03 AM
Hi,
Try to save your file as TEXT(TAB DELIMITED)(*.TXT).
try this and see.
Your ITAb FIELDS must be same as of fields you are uploading.
Check that also.
Data: begin of itab occurs 0,
matnr like mara-matnr,
....
....
end of itab.
Thanks.
‎2005 Nov 17 6:22 AM
Hi deepak ,
My prob is not with R/3 . Evn "ALSM_EXCEL_TO_INTERNAL_TABLE' works fine .
But if i access the same program thru ITS it's throwing error ,
TSV_NEW_PAGE_ALLOC_FAILED
( Since the system requires more memory to format the error log .the system deletes the table prior to outputting the log. So the value '0' was mistakenly entered always . )
Rgds,
J
Message was edited by: Jothivenkatachalam.P
‎2005 Nov 17 7:00 AM
you should use gui_upload
This function will check whether the system is running in ITS more or normal GUI mode and based on that different set of codes will get executed.
By using gui_upload you can without additional coding, you can be sure that it will work both in ITS and normal SAP gui modes.
Note: for FMs to work within ITS environment they dont have to be RFC enabled.
Regards
Raja
‎2005 Nov 17 8:12 AM
hi , if i use Gui_upload ,
from R/3 it's uploading from Excel file . But if i access the same from ITS it's throwing error / the table doesn't contain any data .
( it's due to TSV_TNEW_PAGE_ALLOC_FAILED as mentioned already)
Shd i extend the memory of ITS ?
Rgds,
J
Message was edited by: Jothivenkatachalam.P
‎2005 Nov 17 8:23 AM
Actually it brings the meta dat of excel as well when you try to upload with
Either GUI_UPLOAD or WS_UPLOAD
‎2005 Nov 17 3:14 AM
Jothi,
This function module does not seem to be remote-enabled. Try to create a wrapper remote-enabled (ZALSM_EXCEL_TO_INTERNAL_TABLE) function module & use ALSM_EXCEL_TO_INTERNAL_TABLE function module in that. That might solve your problem.
Cheers
Raghava
‎2005 Nov 17 8:23 AM
Hi,
The most common cause you will get for "getting the values "########" for the fields uploaded" will be either coming from the situation below:
1) the variables length you declare in your itab is not long enough to cater for the text values.
2) if you are using excel to view the text file that you downloaded, most properly you need to double click on the tab to enlarge the tab length to display the full length of each fields.
PS: Most important at all, please check on your itab to determine whether got any values inside before you upload it to a text file.
Thanks.
‎2005 Nov 17 8:25 AM
Hi,
Additional point.
Use ' FILETYPE = 'ASC'
instead of using DAT.