10-12-2007 8:35 AM
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?
10-12-2007 8:39 AM
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
10-12-2007 8:39 AM
<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.
10-12-2007 8:40 AM
Hi,
Yes, p_inputfile like rlgrap-filename incorrect it should be of string type incase of gui_upload.
Thanks,
Muthu.
10-12-2007 8:40 AM
Hi Eliana,
Give the p_inputfile as type <b>string,</b>
Please check.
Award points if found useful
10-12-2007 8:46 AM
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.
10-12-2007 8:53 AM
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
10-12-2007 8:57 AM
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
10-12-2007 9:31 AM
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.
10-12-2007 9:00 AM
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.