栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

ZALSM

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ZALSM

下午有一个场景,一鸣有11万条模拟数据要往SAP测试系统导入,ABAP程序中用到了函数:

ZALSM_EXCEL_TO_INTERNAL_TABLE

看网上介绍,这个函数是把数据放剪贴板中来实现导入,所以如果excel的数据量很大,需要的剪贴板内存也很大,WIN操作系统时常就会出现错误,导致数据无法导入。

我们有11万条数据,可以让这个函数工作三次,依次取数据来导入:

第一次取 1~50000条。

第二次取 50001~100000条。

第三次取 1000001~150000条。

     DATA:gt_in1 TYPE STANDARD TABLE OF styp_in WITH HEADER LINE.
     DATA:gt_in2 TYPE STANDARD TABLE OF styp_in WITH HEADER LINE.
     DATA:gt_in3 TYPE STANDARD TABLE OF styp_in WITH HEADER LINE.


      CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_path
          i_begin_col             = 1
          i_begin_row             = 3
          i_end_col               = 30
          i_end_row               = 50000
*         SHEET_NAME              =
        TABLES
          intern                  = gt_in1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.

        append lines of gt_in1    to gt_in.


         CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_path
          i_begin_col             = 1
          i_begin_row             = 50001
          i_end_col               = 30
          i_end_row               = 100000
*         SHEET_NAME              =
        TABLES
          intern                  = gt_in2
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.

        append lines of gt_in2    to gt_in.

        CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_path
          i_begin_col             = 1
          i_begin_row             = 100001
          i_end_col               = 30
          i_end_row               = 150000
*         SHEET_NAME              =
        TABLES
          intern                  = gt_in3
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.

          append lines of gt_in3    to gt_in.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/987807.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号