‎2007 Oct 22 10:41 AM
Hi Experts
I am new to BDC, this is my BDC program, it goes for dump and saying the error. Please suggest me on the same.
ShrtText
Exception condition "UNKNOWN_ERROR" raised.
What happened?
The current ABAP/4 program encountered an unexpected
situation.
Information on where terminated
The termination occurred in the ABAP program "SAPLGRAP" in "UPLOAD".
The main program was "ZPAV ".
The termination occurred in line 360 of the source code of the (Include)
program "LGRAPU36"
of the source code of program "LGRAPU36" (when calling the editor 3600).
report ZPAV
no standard page heading line-size 255.
include bdcrecx1.
data : begin of itab occurs 0,
empno like zemp10-empno,
empname like zemp10-empname,
end of itab.
start-of-selection.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = 'D:\TEST.TXT'
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = itab
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
.
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 itab.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_CURSOR'
'RSRD1-TBMA_VAL'.
perform bdc_field using 'BDC_OKCODE'
'=SHOW'.
perform bdc_field using 'RSRD1-TBMA'
'X'.
perform bdc_field using 'RSRD1-TBMA_VAL'
'ZEMP10'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=TDSH'.
perform bdc_field using 'BDC_CURSOR'
'DD03P-FIELDNAME(01)'.
perform bdc_dynpro using '/1BCDWB/DBZEMP10' '1000'.
perform bdc_field using 'BDC_CURSOR'
'I1-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'LIST_BRE'
' 250'.
perform bdc_field using 'MAX_SEL'
' 200'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_CURSOR'
'02/62'.
perform bdc_field using 'BDC_OKCODE'
'=ANL2'.
perform bdc_dynpro using '/1BCDWB/DBZEMP10' '0101'.
perform bdc_field using 'BDC_CURSOR'
'ZEMP10-EMPNAME'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'ZEMP10-EMPNO'
'105'.
itab-empno.
perform bdc_field using 'ZEMP10-EMPNAME'
'KANN'.
itab-empname.
perform bdc_dynpro using '/1BCDWB/DBZEMP10' '0101'.
perform bdc_field using 'BDC_CURSOR'
'ZEMP10-EMPNO'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'ZEMP10-EMPNO'
'105'.
itab-empno.
perform bdc_field using 'ZEMP10-EMPNAME'
'KANN'.
itab-empname.
perform bdc_dynpro using '/1BCDWB/DBZEMP10' '0101'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'ZEMP10-EMPNO'.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'02/62'.
perform bdc_dynpro using '/1BCDWB/DBZEMP10' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'I1-LOW'.
perform bdc_dynpro using 'SAPLSD41' '2200'.
perform bdc_field using 'BDC_OKCODE'
'=WB_BACK'.
perform bdc_field using 'BDC_CURSOR'
'DD03P-FIELDNAME(01)'.
perform bdc_dynpro using 'SAPMSRD0' '0102'.
perform bdc_field using 'BDC_CURSOR'
'RSRD1-TBMA_VAL'.
perform bdc_field using 'BDC_OKCODE'
'=BACK'.
perform bdc_field using 'RSRD1-TBMA'
'X'.
perform bdc_field using 'RSRD1-TBMA_VAL'
'ZEMP10'.
perform bdc_transaction using 'SE11'.
endloop.
perform close_group.
‎2007 Oct 22 10:53 AM
the problem is not the bdc part, but the UPLOAD part. Check your input file, and do not comment out the function modules EXCEPTIONS like you did.
Maybe the SY-MSGTY, MSGID, MSGNO, MSGV1, MSGV2, MSGV3, MSGV2 and
function module MESSAGE_TEXT_BUILD can help to identify the error.
regards,
Hans
‎2007 Oct 22 11:00 AM
I have input file in the specified location as follows
301 Pavan
302 Sunit
303 VInay
304 Raja
305 sudhe
then what could be the problem.
‎2007 Oct 22 11:05 AM
hello rajaram,
see that u have mapped ur itab values with the recording values in perform statements. and see u have closed ur flat file before running and try to debig the code u can find where exactly the error is coming.
regards,
pavan.
‎2007 Oct 22 11:02 AM
i tried out the upload FM it worked fine. please check ur uploading file and the internal table structure