Read UTF-8 input file correctly (#576)

This commit is contained in:
Gregor Wolf 2019-01-09 15:29:41 +01:00 committed by Ivan
parent 4ca4991167
commit 095f3d135b

View File

@ -4,9 +4,9 @@
*&---------------------------------------------------------------------*
*& This report creates a monthly calendar in the specified date range.
*& Each month is put on a seperate worksheet. The pictures for each
*& month can be specified in a tab delimited file called "Calendar.txt"
*& which is saved in the Export Directory. By default this is the SAP
*& Workdir. The file contains 3 fields:
*& month can be specified in a tab delimited UTF-8 encoded file called
*& "Calendar.txt" which is saved in the Export Directory.
*& By default this is the SAP Workdir. The file contains 3 fields:
*&
*& Month (with leading 0)
*& Image Filename
@ -29,8 +29,8 @@ INCLUDE zdemo_calendar_classes.
DATA: lv_workdir TYPE string.
PARAMETERS: p_from TYPE dfrom DEFAULT '20130101',
p_to TYPE dto DEFAULT '20131231'.
PARAMETERS: p_from TYPE dfrom DEFAULT '20190101',
p_to TYPE dto DEFAULT '20191231'.
SELECTION-SCREEN BEGIN OF BLOCK orientation WITH FRAME TITLE orient.
PARAMETERS: p_portr TYPE flag RADIOBUTTON GROUP orie,
@ -117,6 +117,7 @@ START-OF-SELECTION.
filetype = 'ASC' " File Type (ASCII, Binary)
has_field_separator = 'X'
read_by_line = 'X' " File Written Line-By-Line to the Internal Table
codepage = '4110'
CHANGING
data_tab = image_descriptions " Transfer table for file contents
EXCEPTIONS
@ -344,7 +345,7 @@ START-OF-SELECTION.
* last_day_of_month = date_to.
date_to = date_from.
date_to+6(2) = '01'. " First of month
add 31 to date_to. " Somewhere in following month
ADD 31 TO date_to. " Somewhere in following month
date_to = date_to - date_to+6(2). " Last of month
IF p_portr = abap_true.
zcl_helper=>add_calendar(