‎2008 Jun 02 7:50 AM
Hi Gurus,When I try to execute the following BDC It is throwing an error that "Wrong value of the parameter FILETYPE". I am trying to upload data from presentation system.Here is the code:
report ZSO_BDC1
no standard page heading line-size 255.
include bdcrecx1.
data: begin of record occurs 1,
auart(4) type c,
vkorg(4) type c,
vtweg(2) type c,
spart(2) type c,
kunnr(10) type c,
kunnr3(10) type c,
mabnr(18) type c,
kwmeng(15) type c,
kunnr4(10) type c,
kunnr5(10) type c,
zterm2(4) type c,
inco5(3) type c,
inco6(28) type c,
kwmeng1(15) type c,
vrkme(4) type c,
kschl(4) type c,
kbetr(11) type c,
bedat(8) type c,
kunnr1(10) type c,
kunnr2(10) type c,
zterm1(4) type c,
inco3(3) type c,
inco4(28) type c,
end of record.
start-of-selection.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'D:\open_so.txt'
FILETYPE = 'asc'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = RECORD
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.
perform open_group.
loop at record.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR'
'VBAK-VKGRP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'VBAK-AUART'
'record-auart'.
perform bdc_field using 'VBAK-VKORG'
'record-vkorg'.
perform bdc_field using 'VBAK-VTWEG'
'record-vtweg'.
perform bdc_field using 'VBAK-SPART'
'record-spart'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'09/14'.
perform bdc_field using 'BDC_OKCODE'
'=PICK'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KUAGV-KUNNR'
'record-kunnr'.
perform bdc_field using 'KUWEV-KUNNR'
'record-kunnr3'.
*perform bdc_field using 'RV45A-KETDAT'.
*perform bdc_field using 'RV45A-KPRGBZ'.
*perform bdc_field using 'VBKD-PRSDT'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
'record-mabnr'.
perform bdc_field using 'RV45A-KWMENG(01)'
'record-kwmeng'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=ITEM'.
perform bdc_field using 'KUAGV-KUNNR'
'record-kunnr4'.
perform bdc_field using 'KUWEV-KUNNR'
'record-kunnr5'.
*perform bdc_field using 'RV45A-KETDAT'.
*perform bdc_field using 'RV45A-KPRGBZ'.
*perform bdc_field using 'VBKD-PRSDT'.
perform bdc_field using 'VBKD-ZTERM'
'record-zterm2'.
perform bdc_field using 'VBKD-INCO1'
'record-inco5'.
perform bdc_field using 'VBKD-INCO2'
'record-inco6'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\06'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG'.
perform bdc_field using 'RV45A-KWMENG'
'record-kwmeng1'.
perform bdc_field using 'VBAP-VRKME'
'record-vrkme'.
*perform bdc_field using 'RV45A-ETDAT'
*perform bdc_field using 'RV45A-PRGBZ'
*perform bdc_field using 'VBKD-PRSDT'
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KBETR(07)'.
perform bdc_field using 'KOMV-KSCHL(07)'
'record-kschl'.
perform bdc_field using 'KOMV-KBETR(07)'
'record-kbetr'.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'=T\05'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(08)'.
perform bdc_dynpro using 'SAPLCNMS' '1300'.
perform bdc_field using 'BDC_OKCODE'
'/EESC'.
perform bdc_field using 'BDC_CURSOR'
'MLSTS-AUFNR'.
perform bdc_dynpro using 'SAPLV60F' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'FPLT-AFDAT(01)'.
perform bdc_field using 'FPLA-BEDAT'
'record-bedat'.
*perform bdc_field using 'FPLA-BEDAR'
.
*perform bdc_field using 'FPLT-AFDAT(01)'
perform bdc_dynpro using 'SAPLV60F' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=S\BACK'.
perform bdc_field using 'BDC_CURSOR'
'FPLA-BEDAT'.
*perform bdc_field using 'FPLA-BEDAT'
*perform bdc_field using 'FPLA-BEDAR'
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'KUAGV-KUNNR'
'record-kunnr1'.
perform bdc_field using 'KUWEV-KUNNR'
'record-kunnr2'.
*perform bdc_field using 'RV45A-KETDAT'
*perform bdc_field using 'RV45A-KPRGBZ'
*perform bdc_field using 'VBKD-PRSDT'
perform bdc_field using 'VBKD-ZTERM'
'record-zterm1'.
perform bdc_field using 'VBKD-INCO1'
'record-inco3'.
perform bdc_field using 'VBKD-INCO2'
'record-inco4'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_transaction using 'VA01'.
endloop.
perform close_group.
Thanks and Regards,
VIshwa.
‎2008 Jun 02 7:52 AM
hi,
this has to do with ur GUI_UPLOAD.
give ASC in CAPS.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'D:\open_so.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
‎2008 Jun 02 7:52 AM
hi,
this has to do with ur GUI_UPLOAD.
give ASC in CAPS.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'D:\open_so.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
‎2008 Jun 02 7:53 AM
Hi,
In the function module GUI_UPLOAD the parameter FILETYPE should be in uppercase.
‎2008 Jun 02 7:53 AM
Hi,
Use Upper case 'ASC' for the exporting parameter 'FILETYPE' of the GUI_UPLOAD.
Rgds,
Bujji
‎2008 Jun 02 7:56 AM
Dear Vishwa,
Use All things in Upper case in FM.
But more important thing where you have decleared your filename in DATA statement i cannot see it.
Amit.
‎2008 Jun 02 8:10 AM
hi,
pass the asc in capital letters(uppercase) then your problem may solved.
reward if useful,
thanks and regards.