SAP ABAP上传Excel数据 报CONVT_NO_NUMBER千分位问题的处理

复制代码
ASSIGN COMPONENT ls_excel_tab-col OF STRUCTURE <fs_excel_s> TO <fs_value>.
    IF sy-subrc EQ 0.
      CONDENSE ls_excel_tab-value.

      cl_descr ?= cl_abap_typedescr=>describe_by_data( <fs_excel_s> ).
      ASSIGN cl_descr->components[ ls_excel_tab-col ] TO <fs_comp>.
      IF <fs_comp>-type_kind = 'P'.
        lvfldvalue = ls_excel_tab-value.
        PERFORM RV_MARK_OF_thousandth(zabap_common_program) USING  lvfldvalue CHANGING lvfldvalue.
        ls_excel_tab-value  = lvfldvalue.
      ENDIF.
      MOVE ls_excel_tab-value TO <fs_value>.
    ENDIF.

    AT END OF row.
      APPEND <fs_excel_s> TO <fs_excel_t>.
      lv_row = ls_excel_tab-row + 1.
    ENDAT.

*解决千分位问题  eg.123,123.00 → 123123.00 add by gavin
FORM RV_MARK_OF_thousandth USING iv_feild TYPE char50 CHANGING ev_feild TYPE char50.
  CHECK iv_feild IS NOT INITIAL.
  DATA: lv_str   TYPE string,
        lv_strt  TYPE string,
        lv_char1 TYPE char1,
        lv_idx   TYPE int4,
        lv_idxt  TYPE int4.

  lv_str = iv_feild.

  lv_idxt = strlen( lv_str ).
  lv_idx = 0.

  DO lv_idxt TIMES.

    lv_char1 = lv_str+lv_idx(1).
    CASE lv_char1.
      WHEN '0' OR '1' OR '2' OR '3' OR '4' OR '5' OR '6' OR '7' OR '8' OR '9' OR '.'.
        lv_strt = lv_strt && lv_char1.
      WHEN OTHERS.
    ENDCASE.
    lv_idx = lv_idx + 1.
  ENDDO.

  CONDENSE lv_strt.
  IF lv_strt+0(1) NE '.'.
    ev_feild = lv_strt.
  ENDIF.
ENDFORM.
相关推荐
wtsolutions6 小时前
JSON to Excel Add-in - Seamless Integration Within Excel
json·excel
wtsolutions6 小时前
Getting Started with JSON to Excel Web App - Convert in Seconds
json·excel·web app
wtsolutions10 小时前
Using the JSON to Excel API - Programmatic Access for Developers
json·excel
qq_4351395710 小时前
EasyExcel(FastExcel)Excel导出功能 技术文档
excel
wtsolutions13 小时前
Understanding JSON Formats - What JSON to Excel Supports
json·excel
wtsolutions13 小时前
Advanced Features - Unlocking the Power of JSON to Excel Pro
linux·json·excel
fs哆哆15 小时前
VB.NET和VBA教程-如何查找Excel数据区域边界
excel
小矮强15 小时前
Excel中根据年月日提取月日,并按月日进行排序
excel
开开心心_Every15 小时前
图片批量压缩工具:支持有损无损两种模式
python·游戏·微信·django·pdf·excel·语音识别
wtsolutions16 小时前
Real-World Use Cases - How Organizations Use JSON to Excel
json·excel