• BW转换例程中去掉非法字符


    * result value of the routine
       RESULT = COMM_STRUCTURE-txtmd.
      CALL FUNCTION 'Z_ZH_REMOVE_INVLID_CHARARCTER'
        CHANGING
          c_string = RESULT.
    * if abort is not equal zero, the update process will be canceled


    .....
    FUNCTION z_zh_remove_invlid_chararcter.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *"  CHANGING
    *"     REFERENCE(C_STRING) TYPE  ANY
    *"----------------------------------------------------------------------

      DATA: l_count TYPE i,
           l_oldpos TYPE i,
           l_str(40) TYPE c,
           l_strlen TYPE i,
           l_maxcount TYPE i.

      FIELD-SYMBOLS: <fs> TYPE x.

      l_count = 0.
      l_str = c_string.
      l_strlen = STRLEN( l_str ).
      l_maxcount = l_strlen - 1.

      DO.
        IF ( l_count > l_maxcount ).
          EXIT.
        ENDIF.

        ASSIGN l_str+l_count(1) TO <fs> CASTING TYPE x.
        IF <fs> <= 127.
          l_count = l_count + 1.  "go to the next
        ELSE.                     "Chinese character
          l_count = l_count + 1.
          IF l_count > l_maxcount.
            "Wrong
            l_oldpos = l_count - 1.
            l_str+l_oldpos(1) = space.
          ELSE.
            ASSIGN l_str+l_count(1) TO <fs> CASTING TYPE x.
            IF <fs> <= 127.
              "  Wrong.
              l_oldpos = l_count - 1.
              l_str+l_oldpos(1) = space.
            ELSE.                      "Correct
              l_count = l_count + 1.   "go to the next
            ENDIF.
          ENDIF.
        ENDIF.
      ENDDO.

      c_string = l_str.
    *  BREAK-POINT.


    ENDFUNCTION.


    以下为网上的例程。

      l_strlen = STRLEN( c_text ).

      DO l_strlen TIMES.
        IF c_text+l_offset(1) < ' '.
          c_text+l_offset(1) = ' '.
        ENDIF.

        ADD 1 TO l_offset.
      ENDDO.

  • 相关阅读:
    [转]tensorflow提示:No module named ''tensorflow.python.eager"
    mac使用pip3安装tensorflow(不用conda)
    不限速、没广告的迅雷(旧版迅雷)
    python从国内镜像安装第三方库
    Jupyter 安装并配置工作路径[转]
    VS2013只显示会附加到进程,无法启动调试
    电脑磁盘空间占用高于文件夹大小
    Latex基础
    C#/.Net 部分缩写
    texstudio设置外部浏览器及右侧预览不能使用问题
  • 原文地址:https://www.cnblogs.com/Beewolf/p/1436194.html
Copyright © 2020-2023  润新知