2007 Sep 24 12:25 PM
Hi Gurus,
I hv done bdc upload program.... see the below code... BUT IT WAS NOT UPDATING IN THE EKKO TABLE....
TABLES : EKKO.
DATA : BEGIN OF ITAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
LIFNR LIKE EKKO-LIFNR,
END OF ITAB.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\EKKO.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '#'
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 = 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-EBELN, ITAB-BUKRS, ITAB-LIFNR.
ENDLOOP.
######THIS ISMY FLAT FILE in notepad .#####
4500000005 4000 0000000005
4500000006 4000 0000000006
4500000010 8000 0000000003
4500000011 4000 0000000002
hi,
your program is report but not bdc
report displays data but bdc uploads data into database as well as you can display data ..
in the GUI_UPLOAD.... give value 'X' for HAS_FIELD_SEPERATOR
and in the flat file seperate the data with flat file....
regards
sree
2007 Sep 24 2:59 PM
I think you forgot to write the batch input portion of your batch input program.
Rob
2007 Sep 24 8:24 PM
Hi Manu..
there was updating or modifyng table section is missing in your program.
please incorporate the logic by refering the below code.
IF NOT ITAB[] IS INITIAL.
LOOP AT ITAB .
MODIFY J_1IRG1 FROM ITAB.
ENDLOOP.
ENDIF.
Regards
sri
2007 Sep 25 5:44 AM
hi sri,
IF NOT ITAB[] IS INITIAL.
LOOP AT ITAB .
MODIFY J_1IRG1 FROM ITAB.
ENDLOOP.
ENDIF.
in ur code watz MODIFY J_1IRG1 FROM ITAB.
here j_1irg1 means...
2007 Sep 25 9:51 PM
Hi Manu..
that code was related to my program.
so according the your requirement . you code may look like below
IF NOT ITAB[] IS INITIAL.
LOOP AT ITAB .
MODIFY EKKO FROM ITAB.
ENDLOOP.
ENDIF.
chk it
regards
sri
2007 Sep 25 5:34 AM
Hi Manu..
The problem is with UPLOADing Data .
In GUI_UPLOAD FM:
if the File is TAB Delimited the set this Parameter:
<b>HAS_FIELD_SEPARATOR = 'X'</b>
or else if the File has no delimiter for the fields then
<b>HAS_FIELD_SEPARATOR = ' '</b>
Then only the data from the file will be Uploaded properly.
After that write ur BDC logic.
<b>reward if Helpful.</b>
2007 Sep 26 6:42 AM
hi,
your program is report but not bdc
report displays data but bdc uploads data into database as well as you can display data ..
in the GUI_UPLOAD.... give value 'X' for HAS_FIELD_SEPERATOR
and in the flat file seperate the data with flat file....
regards
sree
2007 Sep 26 8:47 AM
Hi,
in your program first give the field separator 'X" then in flat file give each field separator as tab then cal function GUI_UPLOAD i think it will be help full for u.
reward is useful.
Patil
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |