zoukankan      html  css  js  c++  java
  • 输入列号得到excel对应的字母列

    zexcel_cell_column 类型是INT4
    FUNCTION ZGET_EXCEL_COL.
    *"----------------------------------------------------------------------
    *"*"本地接口:
    *"  IMPORTING
    *"     REFERENCE(I_COL) TYPE  I
    *"  EXPORTING
    *"     REFERENCE(E_COL) TYPE  C
    *"----------------------------------------------------------------------
    
    
      DATA:       LV_UCCPI                        TYPE I,
                  LV_TEXT                         TYPE SYCHAR02,
                  LV_MODULE                       TYPE INT4,
                  LV_COLUMN                       TYPE ZEXCEL_CELL_COLUMN.
    
      LV_COLUMN = I_COL .
    *--------------------------------------------------------------------*
    * Check whether column is in allowed range for EXCEL to handle ( 1-16384 )
    *--------------------------------------------------------------------*
    *  IF   lv_column > 16384
    *    OR lv_column < 1.
    *    RAISE EXCEPTION TYPE zcx_excel
    *      EXPORTING
    *        error = 'Index out of bounds'.
    *  ENDIF.
    
    *--------------------------------------------------------------------*
    * Build alpha representation of column
    *--------------------------------------------------------------------*
      WHILE LV_COLUMN GT 0.
    
        LV_MODULE = ( LV_COLUMN - 1 ) MOD 26.
        LV_UCCPI  = 65 + LV_MODULE.
    
        LV_COLUMN = ( LV_COLUMN - LV_MODULE ) / 26.
    
        LV_TEXT   = CL_ABAP_CONV_IN_CE=>UCCPI( LV_UCCPI ).
        CONCATENATE LV_TEXT E_COL INTO E_COL.
      ENDWHILE.
    ENDFUNCTION.
  • 相关阅读:
    css3
    ubuntu /mac 终端命令大全
    MarkDown的语法的简要规则
    向github上传一个项目
    datatable 去掉默认功能
    datatable 自定义筛选
    vuex
    es6入门教程
    datatable 指定添加排序,根据列的值来设置颜色
    在ios上块点击出现闪黑底
  • 原文地址:https://www.cnblogs.com/caizjian/p/9486956.html
Copyright © 2011-2022 走看看