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: 

gui upload runtime error

Former Member
0 Kudos

hi,

i got type conflict when calling a fm.

a FM was called incorrectly

the fm interface allows you to specify only fields of a particular type under 'filename'. the file "p_inputfile" specified has a different field type.

originally i use ws_upload. no issue to this FM. i use the same parameter and apply on gui_upload, i got short dump.

basically i pass in filename, type 'DAT' and internal table. i even try ASC but still the same.

may i know why? p_inputfile like rlgrap-filename incorrect?

9 REPLIES 9

former_member404244
Active Contributor
0 Kudos

Hi,

The filename should be of type string...chek this

data : i_filename type string.

now call fm' GUI_UPLOAD'.

FILENAME = I_FILENAME

FILETYPE = 'DAT'.

try and check.

reward if helpful.

Regards,

Nagaraj

Former Member
0 Kudos
<b>data: gv_file type string,</b>

start-of-selection.

call function 'GUI_UPLOAD'
exporting
filename = gv_file
filetype = 'ASC'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
tables
data_tab = it_datatab
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.

Former Member
0 Kudos

Hi,

Yes, p_inputfile like rlgrap-filename incorrect it should be of string type incase of gui_upload.

Thanks,

Muthu.

Former Member
0 Kudos

Hi Eliana,

Give the p_inputfile as type <b>string,</b>

Please check.

Award points if found useful

0 Kudos

hi,

thanks but........... if i define like this also not allowed. why parameter and string cannot be together?

it says "nested data type "string" is not allowed".

thanks

parameter: p_inputfile type string.

0 Kudos

what ever ur parameter type . sppose p_inputfile is ur parameter.

just declare one variable

data: p_path type string.

p_path = p_inputfile

now call fm.with value p_path

0 Kudos

Hi,

try like this

parameters : p_file type rlgrap-filename.

data : p_file1 type string

p_file1 = p_file.

Now pass p_file1 to GUI_UPLOAD function module..

Regards,

Nagaraj

0 Kudos

Hi ..

Parameters cannot be declared using Type String . bcoz its length is dynamic.

This is the way..

PARAMETERS : P_FILE(30) .

DATA : V_FILE TYPE STRING.

START-OF-SELECTION.

MOVE P_FILE TO V_FILE.

CALL FUNCTION GUI_DOWNLOAD'

EXPORTING

FILENAME = V_FILE

reward if Helpful.

Former Member
0 Kudos

HI,

check this code.

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.

PARAMETERS: p_file LIKE IBIPPARMS-PATH OBLIGATORY.

SELECTION-SCREEN END OF BLOCK blk1.

DATA : T_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE.

DATA : S_FILE TYPE STRING.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • To select the File in the system.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = p_file.

AT SELECTION-SCREEN.

s_file = p_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = S_FILE

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = t_vbap.

rgds,

bharat.