12-02-2005 2:50 AM
Hi I just want to request all of you to provide me some insights the PROS and CONS of GUI_UPLOAD and OPEN DATA SET. Another thing why is it that GUI_UPLOAD has more security problems than WS_UPLOAD. Please reply asap. Thanks!
12-02-2005 3:00 AM
gui_upload cannot be run in background ,
we cannot upload in batch using these two
12-02-2005 3:00 AM
gui_upload cannot be run in background ,
we cannot upload in batch using these two
12-02-2005 3:06 AM
Hi I have 2 another question.
1. Why is it that WS_UPLOAD is most prefer than GUI_UPLOAD?
2. Why is it that when im using WS_UPLOAD I experience problems on uploading the file if the date is YYYYMMDD but no problems is being encounter when using MM/DD/YYYY.
Do you have any suggestion on how to upload the file? Thanks!
12-02-2005 3:09 AM
WS_UPLOAD is introduced by SAP from version 3.X but GUI_UPLOAD is introduced in 4.5. In future versions of SAP, WS_UPLOAD is obsolote.
How are you passing Date to the internal table which is used to download data.
12-02-2005 3:15 AM
Also regarding GUI_UPLOAD and OPEN DATASET
GUI_UPLOAD is used to upload file from presentation server and DATASET command is used to upload file from Application server.
12-02-2005 3:17 AM
i think the date format depends on ur system settings (in control panel > regional options>date tab).
by default the date format is set to MM/DD/YYYY , so it will not give error
pls set ur date format to YYYYMMDD and run ur program and check if the same error occurs
12-02-2005 3:21 AM
Get Date in a char field of length 10
Suppose date format used is MM/DD/YYYY.
To get date in program you can use
CONCATENATE ITAB-DATE6(4) ITAB-DATE3(2) ITAB-DATE+0(2)
INTO G_DATE. (This is in yyyymmdd format).
You can transfer this to a date variable.
Check in debug mode for testing.
12-02-2005 3:24 AM
When the file im using has a date of YYYYMMDD. But it promtpted me an error saying "DATA CANNOT BE CONVERTED CORRECTLY" this is because of the format of the date. I really want to know what is the problem and how can i solve this one. Thanks!!
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = fp_file
filetype = DAT
TABLES
data_tab = i_input
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 <> 0.
MESSAGE e001. "File Cannot be Uploaded
ENDIF.
12-02-2005 3:26 AM
Please suggest a code on how can i upload the file when using WS_UPLOAD if im going to use YYYYMMDD file format. Thanks!
12-02-2005 3:29 AM
What is the internal table structure you are using to upload data? Are all fields declared in CHARs?
12-02-2005 3:35 AM
TYPES: BEGIN OF t_input,
molga LIKE t510-molga, "Company Key
pernr LIKE pa0001-pernr, "Personnel Number
begda LIKE p0008-begda, "Start date
trfar LIKE p0008-trfar, "Pay Scale Type
trfgb LIKE p0008-trfgb, "Pay Scale Area
trfgr LIKE p0008-trfgr, "Pay Scale Group
trfst LIKE p0008-trfst, "Pay Scale Level
END OF t_input.
HEre is the format of the internal table structure.
12-02-2005 3:38 AM
Declare DATE in character format instead of date format. Keep a breakpoint after uplaod function and check if data is getting uplaoded correctly. If it is okay then you can format date by seeing solution suggested earlier.
12-02-2005 3:40 AM
WS_UPLOAD is an obsolete function module and SAP will not support it, which also means that if a day comes when all SAP code is using GUI_UPLOAD, SAP can remove it any time. That is what obsolete means.
Any specific reason, you are not using GUI_UPLOAD? In fact it provides authorization checks and that should be a good thing, otherwise anyone can upload any file without proper authorization.
I don't think WS_UPLOAD itself is the reason why you are getting the date error, something else might be the reason. When you are uploading or downloading, it is always advisable that all your fields are character fields that don't have any kind of conversion routines associated with them. Please check your internal table structure.
Srinivas
12-02-2005 3:58 AM
Therefore it is really best to use GUI_UPLOAD than WS_UPLOAD. Now im using GUI_UPLOAD and the program is working fine. But the thing is that the main users have no authority on S_GUI. Have any suggestion on how can I answer to them. thanks!
12-02-2005 4:20 AM
That is something you need to work it out with your administration/basis/security team to see how best you can provide that access. It just needs to be added to the user profile, for all those users who need to upload files into the system.
Unix always had this security control over directories/files etc, but windows was little lenient on that aspect.
SAP moved along with windows as they enhanced the security.
Please reward and close the thread if answered.
Srinivas