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 UPLOAD PROBLEM

Former Member
0 Likes
827

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

7 REPLIES 7
Read only

Former Member
0 Likes
798

I think you forgot to write the batch input portion of your batch input program.

Rob

Read only

0 Likes
798

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

Read only

0 Likes
798

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...

Read only

0 Likes
798

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

Read only

varma_narayana
Active Contributor
0 Likes
798

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>

Read only

Former Member
0 Likes
798

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

Read only

0 Likes
798

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