‎2007 Apr 18 9:02 AM
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
‎2007 Apr 18 9:05 AM
Prasad,
p_infile should be of type string.
try to pass the string type variable , it will work.
Best Regards
Vijay
‎2007 Apr 18 9:07 AM
‎2007 Apr 18 9:08 AM
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
‎2007 Apr 18 9:09 AM
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
‎2007 Apr 18 9:10 AM
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
‎2007 Apr 18 9:28 AM
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