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: 

Replace Obsolete FM UPLOAD

Former Member
0 Kudos

Hi,

I am in Upgrade Project,

The Obsolete FM is UPLOAD

The exporting parameteras are

CodePage = IBM

FileType = BIn.

Then How to Replace this Obsolete FM.

Any Code would be highly appriciated.

Thanks in Advance

SriRam

7 REPLIES 7

matt
Active Contributor
0 Kudos

Try fm GUI_UPLOAD.

rgds, matt

Former Member
0 Kudos

I Know that I have to Use GUI_UPLOAD..

But what are the main Parameters to be taken care of ??

Thanks in Advance

Sriram

0 Kudos

if u r in ecc versions, its always better to avoid function modules.

u will have to go with oops.

go as follows:

call method cl_gui_frontend_services=>gui_upload

exporting

filename = file_name

filetype = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = SPACE

  • CODEPAGE = SPACE

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • VIRUS_SCAN_PROFILE =

  • IMPORTING

  • FILELENGTH =

  • HEADER =

changing

data_tab = myexcel[]

exceptions

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

not_supported_by_gui = 17

error_no_gui = 18

others = 19.

handle the sy-subrc part as u want.

lemme know u need any more.

reward, if helpful

former_member386202
Active Contributor
0 Kudos

Hi,

Use this

*--Call the function to get the file into an internal table.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lv_file

filetype = 'ASC'

TABLES

data_tab = pr_eord

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

IF sy-subrc <> 0.

  • File not found.

MESSAGE e503.

ELSE.

Reward Points

Regards,

Prashant

0 Kudos

The File Type = BIN in Upload. In GUI_UPLOAD i have to use File Type = 'ASC' ??

Is this Correct ?

0 Kudos

No, that is the default, you may override this by passing 'BIN' to the importing parameter.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi

Check FM GUI_UPLOAD or look this class CL_GUI_FRONTEND_SERVICES

regards

Gregory