分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.youkuaiyun.com/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
Unicode
Unicode is the international character encoding standard that allows the systems to handle text data from multiple languages simultaneously and consistently. In fact, more than 5,000 SAP customer installations are already purely Unicode-based, and the relative share of pure Unicode installations is growing rapidly. Many companies are adopting Web services to gain benefits such as greater openness that extends processes to customers and business partners.
Service-oriented architectures (SOAs), including SAP's Enterprise Services Architecture,rely on a set of standards that enable global interoperability across systems, programming languages, and application services.
One of these required standards is Unicode.Much of the enterprise software out there is already completely Unicode-ready.Everything in the Java space and everything based on XML is Unicode by definition.New system installations will have to be Unicode only in future releases and new SAP products will only be offered in Unicode.In fact, SAP NetWeaver Portal and SAP NetWeaver Exchange Infrastructure (XI) are already Unicode-only.Each character has a unique number („Unicode code point") Notation U+nnnn (where nnnn are hexadecimal digits) See http://www.unicode.org for complete code charts
Note:
Unicode flag ( "Unicode checks active") is used as a Program Attribute to control the Unicode enabling procedure
A program without Unicode flag is NOT executable on a Unicode system. Transaction UCCHECK can be used as tool to analyze customer coding for unicode errors.
Common Unicode Errors and Their Corrections:
1. Error regarding OPEN DATASET:
Before Unicode:
OPEN DATASET P_UNIX FOR OUTPUT IN TEXT MODE.
Resolution:
OPEN DATASET P_UNIX FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
OR
OPEN DATASET P_UNIX FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
OR
OPEN DATASET P_UNIX FOR OUTPUT IN LEGACY TEXT MODE.
The choice of resolution depends on the kind of data the file contains. The addition ENCODING defines how the characters are represented in the text file. When writing to a text file, the content of a data object is converted to the representation entered after ENCODING, and transferred to the file. The same rule is followed for reading files using the OPEN DATASET command.
Before Unicode:
OPEN DATASET P_UNIX FOR OUTPUT IN BINARY MODE.
Resolution:
OPEN DATASET P_UNIX FOR OUTPUT IN LEGACY BINARY MODE.
Note: Some time it is possible that mode has not been specified in old system, then by default system will take it as BINARY mode, We should add LEGACY BINARY mode for such syntax.
2. Error regarding WS_UPLOAD/WS_DOWNLOAD.
Before Unicode:
Parameters: filename (128) lower case.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = filename
FILETYPE = 'DAT'
TABLES
DATA_TAB = I_INREC
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
CONVERSION_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7.
Resolution:
Data:w_filename TYPE STRING.
Field-symbols: <fs_filename> type any.
Assign filename to <fs_filename>.
Move <fs_filename> to w_filename.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = w_filename
FILETYPE = 'DAT'
TABLES
DATA_TAB = I_INREC
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.
The Function Modules WS_UPLOAD / WS_DOWNLOAD is obsolete and hence need to be replaced by their new counterparts' viz. GUI_UPLOAD / GUI_DOWNLOAD.
3.Error regarding UPLOAD / DOWNLOAD:
Before Unicode:
DATA: V_FILENAME TYPE STRING value 'c: /test.txt'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
FILENAME = 'c: /test.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = CO_TAB
EXCEPTIONS
INVALID_FILESIZE = 01
INVALID_TABLE_WIDTH = 02
INVALID_TYPE = 03
NO_BATCH = 04
UNKNOWN_ERROR = 05.
Resolution:
data: filename TYPE string.
data: ftab type filetable.
data: wa_ftab TYPE LINE OF filetable.
data: r_code type sy-subrc.
move 'c: /test.txt' to filename .
If filename CA '.'.
Else.
CONCATENATE filename '*' into filename.
endif.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
DEFAULT_FILENAME = filename
CHANGING
FILE_TABLE = ftab
RC = r_code.
IF NOT ftab[] IS INITIAL.
read table ftab into wa_ftab index 1.
move wa_ftab-filename to filename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = filename
FILETYPE = 'ASC'
TABLES
DATA_TAB = CO_TAB
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG&n