Skip to Content
0
Oct 01, 2007 at 07:57 AM

Rgarding the insert statement

15 Views

Hi

Can any one help me in doing this,

types : BEGIN OF ty_INTABLE ,

ZWERKS_FR type ZITWOTRPLOC-ZWERKS_FR,

ZWERKS_TO type ZITWOTRPLOC-ZWERKS_TO,

ZTRDAYS TYPE ZITWOTRPLOC-ZTRDAYS,

ZTRCOST TYPE ZITWOTRPLOC-ZTRCOST,

ZINDICATOR type ZITWOTRPLOC-ZINDICATOR,

END OF ty_INTABLE.

data : it_intable type table of TY_INTABLE,

wa_intable LIKE LINE OF IT_INTABLE.

data : file_name type string,

w_sucess type i,

w_error type i.

PARAMETERS:

P_PCFN LIKE RLGRAP-FILENAME DEFAULT 'C:\'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCFN.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

FILE_NAME = P_PCFN

.

start-of-selection.

file_name = P_PCFN.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = file_name

FILETYPE = 'DAT'

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 = it_intable

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 it_intable into wa_intable.

if sy-subrc eq 0.

insert ZITWOTRPLOC FROM WA_INTABLE.

if sy-subrc eq 0.

w_sucess = w_sucess + 1.

endif.

it is saying that the type of the database table and work area wa_intable are not unicode-convertible,

thanks and regards,

Rajesh