Application Development and Automation 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: 
Read only

bdc

Former Member
0 Likes
631

Hi all,

i developed a bdc program, its giving error wen the program is executed.saying that a function module gui_upload was called incorrectly.p_infile field type sprecified does not match.

can any body help me in this.

regards

siva

6 REPLIES 6
Read only

Former Member
0 Likes
607

Prasad,

p_infile should be of type string.

try to pass the string type variable , it will work.

Best Regards

Vijay

Read only

Former Member
0 Likes
607

hi siva,

try to give the same file type as GUI_UPLOAD.

Read only

Former Member
0 Likes
607

Hi..,

define the P_INFILE as..

<b>

data p_infile type string.</b>

and pass this to the FM..

it will work ..

<b>For function modules and Subroutines while passing values the data type and length must always be same !! ( must be compatible )</b>

regards,

sai ramesh

Read only

Former Member
0 Likes
607

Just declare this in ur program...

p_filename type string.

p_filename = p_infile.

and in ur FM gui_upload pass p_filename asur file name instead of p_infile.

Regards

Read only

shishupalreddy
Active Contributor
0 Likes
607

Hello ,

I think u r using FM to read the file name and then u may pass the same to GUI_UPLOAD ...

Here while passing the filename parameter to the FM gui_upload the field must be of STRING type .

check it

regards

Read only

Former Member
0 Likes
607

HI,

TYPES : BEGIN OF STRUCT ,

auart type VBAK-AUART,

kunnr type KUAGV-KUNNR,

bstkd type VBKD-BSTKD,

posnr type VBAP-POSNR,

mabnr type RV45A-MABNR,

kwmeng(15) type c,

END OF STRUCT.

DATA :W_GRPID TYPE APQI-GROUPID . " Session variable

DATA :IT_struct TYPE TABLE OF STRUCT,

IT_BDCDATA TYPE TABLE OF BDCDATA with header line.

data : wa_struct type struct.

DATA: LV_FILE TYPE IBIPPARMS-PATH,

LV_FILE1 TYPE STRING.

PARAMETERS : PR_FILE TYPE IBIPPARMS-PATH.

initialization.

W_GRPID = 'SESSION-SALES'. " Assigning value to session variable.

<b><i>AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_FILE.</i></b>

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'PR_FILE'

IMPORTING

FILE_NAME = PR_FILE.

LV_FILE1 = PR_FILE.

<b><i>START-OF-SELECTION.</i></b>

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = LV_FILE1

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = '#'

tables

data_tab = it_struct

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.

Regards

Purshoth