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: 

Type conflict when calling a function module.

Former Member
0 Kudos

Hi all

am getting type conflict error when i execute my program.

am using GUI_UPLOAD fm.

here is my code please tell me what is wrong in my code.

REPORT zpr_test02 MESSAGE-ID zmtr_bank LINE-SIZE 679 .

tables: zmonthpay.

data : begin of itab occurs 0,

mnth type zmonthpay-mnth,

ecode type zmonthpay-ecode,

accno type zmonthpay-accno,

end of itab.

selection-screen begin of block b1 with frame title text-001.

parameters: path(60) type c.

selection-screen end of block b1.

at selection-screen on value-request for path.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

DEF_FILENAME = 'C:\ORDER'

DEF_PATH = 'E:\'

MASK = ',.,..'

MODE = 'O'

TITLE = 'OPEN'

IMPORTING

FILENAME = path

  • RC =

EXCEPTIONS

INV_WINSYS = 1

NO_BATCH = 2

SELECTION_CANCEL = 3

SELECTION_ERROR = 4

OTHERS = 5

.

*IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*ENDIF.

START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = path

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

tables

data_tab = itab

  • 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.

LOOP AT ITAB.

WRITE:/ ITAB-ECODE, ITAB-MNTH,ITAB-ACCNO.

ENDLOOP.

Regards

Prajwal.k

9 REPLIES 9

former_member404244
Active Contributor
0 Kudos

Hi,

u have to declare like this

parameters : path TYPE rlgrap-filename .

Regards,

Nagaraj

0 Kudos

Hi nagaraj .

i have changed that still am getting same error.

regards

prajwal

0 Kudos

Hi,

Try like this

DATA: lv_file1 TYPE string.

MOVE: path TO lv_file1.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lv_file1

filetype = c_asc

has_field_separator = c_x

TABLES

data_tab = i_temp

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 e138.

ENDIF.

Regards,

nagaraj

0 Kudos

Hi Prajwal,

Try This.

data :lwa_fname TYPE string.

lwa_fname = path.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = lwa_fname

filetype = 'ASC'

TABLES

data_tab =

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.

reward if useful.

regards,

Chitra

JozsefSzikszai
Active Contributor
0 Kudos

hi,

parameters: path(60) type c.

replace with:

parameters: path type string.

otherwise would be good to know, where the dump occurs...

ec

Former Member
0 Kudos

Hi Prajwal,

declare the path as the filename type ( as in the function Module )

Reward if Useful.

Regards,

Chitra

Former Member
0 Kudos

hi,

u have to declare the filename as

path like rlgrap-filename.

In the START-OF-SELECTION event ...............

u have to declare a variable... lv_file type string.

move path to lv_file.. i.e., u are moving the filepath from path to lv_file.

now give lv_file in the filename of gui_upload function module

u cannot pass the field that is declared of type rlgrap-filename directly to gui_upload function module...............

reward if useful

regards

sree

0 Kudos

thanks sree.

its working but am getting different output. it displaying output like

000 ####Gen #######0#######0.00#

how to correct this.

thanks to all

Regards

Prajwal.k

abdulazeez12
Active Contributor
0 Kudos

Hi Prajwal-

data: gv_filepath type string.

Before passing path to 'GUI_UPLOAD' function module, do this:

gv_filepath = path.

pass gv_filepath in the function module 'GUI_UPLOAD'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

<b>filename = gv_filepath</b>

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

Hope this helps..

cheers

Shakir