Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FM "GUI_UPLOAD" : Error Message

Dear All,

I'm doing one Customer Invoice upload program.

In the selection screen, I have one parameter to get File path from the users.

It executes first time without any error.

I dont change any parameter in the selection screen. I execute this program again. But it shows an information message stating "WRONG PARAMETER: FILE_NAME" and after OK, it shows an error message stating "File is not available". This error is coming from the FM "GUI_UPLOAD".

I set breakpoint after GUI_UPLOAD. SY-SUBRC = 1. It means "file_open_error = 1".

Can anyone tell the reason and solution for this problem?

Points will be rewarded.

Thanks & Regards,

Neeraj

Former Member
replied

Hii..Neeraj..

I got the Error now..

Check the Code correction below..

You must place the statement

<b>move p_file to w_file .</b>

Under the Event Start-of-selection.

But currently it is under AT SELECTION-SCREEN ON VALUE-REQUEST..

that is why it is called only for the first time (When u press F4)...

data : w_file type string. "pass the file path to FM GUI_UPLOAD

parameters : p_file type ibipparms-path obligatory. "rlgrap-filename

*----


at selection-screen on value-request for p_file .

call function 'F4_FILENAME'

exporting

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = 'P_FILE'

importing

file_name = p_file.

*----


start-of-selection.

<b>move p_file to w_file .</b> "Earlier this is under another event

call function 'GUI_UPLOAD'

exporting

filename = w_file

filetype = 'ASC'

has_field_separator = '#'

tables

data_tab = it_upload

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.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

<b>Reward points if Helpful</b>

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question