SAP 中strlen()只能计算字符串的个数,不能计算含有中文字符串的长度。
FIELD-SYMBOLS:<FV> TYPE STRING. DATA:LV_SRT TYPE I. DATA:LV TYPE REF TO DATA. DATA:LV_SSSS TYPE CHAR255 . LV_SSSS = '我'. START-OF-SELECTION. CREATE DATA LV TYPE STRING. ASSIGN LV->* TO <FV>. <FV> = '我'. *LV_SRT = STRLEN( <FV> ). LV_SRT = cl_abap_list_utilities=>dynamic_output_length( <FV> ). WRITE:/ LV_SRT. * CALL SCREEN 9001.