Chinaunix首页 | 论坛 | 博客
  • 博客访问: 720954
  • 博文数量: 158
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1643
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-11 14:37
个人简介

人法地,地法天,天法道,道法自然

文章分类

全部博文(158)

文章存档

2022年(1)

2020年(3)

2016年(1)

2014年(7)

2013年(4)

2010年(5)

2009年(86)

2008年(25)

2007年(26)

我的朋友

分类:

2008-03-01 16:05:46

 REPORT ZEXCELUP.

TABLES: ALSMEX_TABLINE.

DATA: BEGIN OF IEXCEL OCCURS 0.
      INCLUDE STRUCTURE ALSMEX_TABLINE.
DATA: END OF IEXCEL.

* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
       value_0001(50),
       value_0002(50),
       value_0003(50),
       value_0004(50),
       value_0005(50),
       value_0006(50),
       value_0007(50),
       value_0008(50),
       value_0009(50),
       value_0010(50),
       value_0011(50),
       value_0012(50),
       value_0013(50),
       value_0014(50),
       value_0015(50),
       value_0016(50),
       value_0017(50),
       value_0018(50),
       value_0019(50),
       value_0020(50),
       value_0021(50),
       value_0022(50),
       value_0023(50),
       value_0024(50),
       value_0025(50),
       value_0026(50),
       value_0027(50),
       value_0028(50),
       value_0029(50),
       value_0030(50),
       value_0031(50),
       value_0032(50),
       value_0033(50),
       value_0034(50),
       value_0035(50),
       value_0036(50),
       value_0037(50),
       value_0038(50),
       value_0039(50),
       value_0040(50),
       value_0041(50),
       value_0042(50),
       value_0043(50),
       value_0044(50),
       value_0045(50),
       value_0046(50),
       value_0047(50),
       value_0048(50),
       value_0049(50),
       value_0050(50),
       value_0051(50),
       value_0052(50),
       value_0053(50),
       value_0054(50),
       value_0055(50),
       value_0056(50),
       value_0057(50),
       value_0058(50),
       value_0059(50),
       value_0060(50),
       value_0061(50),
       value_0062(50),
       value_0063(50),
       value_0064(50),
       value_0065(50),
       value_0066(50),
       value_0067(50),
       value_0068(50),
       value_0069(50),
       value_0070(50),
       value_0071(50),
       value_0072(50),
       value_0073(50),
       value_0074(50),
       value_0075(50),
       value_0076(50),
       value_0077(50),
       value_0078(50),
       value_0079(50),
       value_0080(50),
       value_0081(50),
       value_0082(50),
       value_0083(50),
       value_0084(50),
       value_0085(50),
       value_0086(50),
       value_0087(50),
       value_0088(50),
       value_0089(50),
       value_0090(50),
       value_0091(50),
       value_0092(50),
       value_0093(50),
       value_0094(50),
       value_0095(50),
       value_0096(50),
       value_0097(50),
       value_0098(50),
       value_0099(50),
       value_0100(50).
DATA: END OF data_tab.

DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: .

PARAMETERS: FILENM   LIKE rlgrap-filename MEMORY ID M01,
            NOHEADER AS CHECKBOX.

call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  exporting
    filename                      = FILENM
    i_begin_col                   = 1
    i_begin_row                  = 1
    i_end_col                     = 100
    i_end_row                     = 30000
  tables
    intern                        = IEXCEL
  EXCEPTIONS
    INCONSISTENT_PARAMETERS       = 1
    UPLOAD_OLE                    = 2
    OTHERS                        = 3.

if sy-subrc <> 0.
   WRITE: / 'EXCEL UPLOAD FAILED ', FILENM, SY-SUBRC.
ELSE.
  SORT IEXCEL BY row col.
  LOOP AT IEXCEL.
    IF NOHEADER = 'X'
    AND IEXCEL-row = 1.
      CONTINUE.
    ENDIF.
    tind = IEXCEL-col.
    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
    ASSIGN (zwfeld) TO .
    = IEXCEL-value.
    AT END OF row.
      APPEND data_tab.
      WRITE:/ 'data_tab ', data_tab-value_0001, data_tab-value_0002,
                           data_tab-value_0003, data_tab-value_0004.
      CLEAR data_tab.
    ENDAT.
  ENDLOOP.
endif.

阅读(2177) | 评论(0) | 转发(0) |
0

上一篇:ABAP 函数

下一篇:SAP标准OK Code Values 列表

给主人留下些什么吧!~~