Application Development 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: 

PROS and CONS of GUI_UPLOAD and OPEN DATA SET

Former Member
0 Kudos

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!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

gui_upload cannot be run in background ,

we cannot upload in batch using these two

14 REPLIES 14

Former Member
0 Kudos

gui_upload cannot be run in background ,

we cannot upload in batch using these two

0 Kudos

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!

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

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.

0 Kudos

Please suggest a code on how can i upload the file when using WS_UPLOAD if im going to use YYYYMMDD file format. Thanks!

0 Kudos

What is the internal table structure you are using to upload data? Are all fields declared in CHARs?

0 Kudos

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.

0 Kudos

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.

0 Kudos

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

0 Kudos

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!

0 Kudos

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