Skip to Content
0
Former Member
Jan 09, 2008 at 06:10 AM

bdc

69 Views

pls check n whats wrong in this . if i press f8 button it is going to shortdump. whats wrong in this code.

DATA : BEGIN OF itab OCCURS 0,

str(255),

END OF itab.

DATA : itab1 LIKE mara OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = ' '

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

tables

data_tab = itab1

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.

if itab-str+0(5) = 'matnr'.

itab1-matnr = itab-str+7.

elseif itab-str+0(5) = 'mbrsh'.

itab1-mbrsh = itab-str+7.

elseif itab-str+0(5) = 'mtart'.

itab1-mtart = itab-str+7.

elseif itab-str+0(5) ='meins'.

itab1-meins = itab-str+7.

elseif itab-str+0(5) = '*****'.

append itab1.

clear itab1.

endif.

endloop.

loop at itab1.

if itab1-matnr <> ''.

insert into mara values itab1.

if sy-subrc = 0.

write :/ itab1-matnr."color 5.

else.

write : / itab1-matnr." color 6.

endif.

else.

write : / itab1-matnr." color 7.

endif.

endloop.

  • 1000 chemical medicines kg

*2000 mechanical spars kg