Skip to Content
0
Former Member
Jul 11, 2007 at 01:08 PM

PLEASE LET ME KNOW WHERE I HAVE TO CHANGE (URGENT)

23 Views

REPORT ZRATETARIF_CATEGORY.

TABLES: ZHTTARIFCAT.

DATA: BEGIN OF ITAB OCCURS 0,

RATECAT LIKE ZHTTARIFCAT-RATECAT,

TARIFCAT LIKE ZHTTARIFCAT-TARIFCAT,

METERED LIKE ZHTTARIFCAT-METERED,

END OF ITAB.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'D:\ZISU_TARIFTYP_DS.txt'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = '|'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • 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 INTO ZHTTARIFCAT.

INSERT itab.

WRITE:/ ZHTTARIFCAT-RATECAT, ZHTTARIFCAT-TARIFCAT, ZHTTARIFCAT-METERED.

clear ZHTTARIFCAT.

ENDLOOP.

IF sy-subrc = 0.

WRITE:/ 'The records has sucessfully updated into the table'.

ENDIF.

IF sy-subrc <> 0.

WRITE:/ 'There is no data in the file'.

ENDIF.

LOOP AT ZHTTARIFCAT.

WRITE:/ ZHTTARIFCAT-RATECAT, ZHTTARIFCAT-TARIFCAT, ZHTTARIFCAT-METERED.

ENDLOOP.

I AM USING THIS PROGRAM TO UPLOAD DATA FROM FLAT FILE TO A ZTABLE.

THE DATA IN THE FLAT FILE ARE LIKE THIS:: 011H5OTH06 H5 M

BUT WHEN I AM EXECUTING THIS PROGRAM SOME DATA GET TRUNCATED

LIKE::

RATECAT,=H5OTH06

TARIFCAT, H5

METERED.........

THE LAST FIELD IS COMMIING BLANK AND THE IN THE FIRST FEILD IT IS COMMING H5OTH06 AND 011 IS TRUNCATED..

PLEASE LET ME KNOW WHERE I HAVE TO CHANGE THE CODE..