- 浏览: 271960 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
sunlin:
水文 其他erp就没这样的问题? 不能单方面拿sap说 ...
【转】揭秘SAP在华真相:天价收费与用户之灾 -
zjut_xiongfeng:
用当前日期所在月的第一天,比如2010-7-30的当前月第一天 ...
pb函数库之日期、时间函数 -
550627069:
你好!问下 在PB中显示当前日期的前一个月 应该怎么做?求教
pb函数库之日期、时间函数
This Tutorial details about creation of dynamic internal table with different scenarios Internal Tables are local tables within a program containing a series of lines having same data type. ABAPTM Open SQL allows single field, range of fields, entire database table or view into an internal table. In technical terms Internal table is a dynamic sequential dataset in which all records have the same data structure and a key. A static internal table can be declared in an ABAPTM program initially, when the structure of the internal table is fixed and known to the user. Dynamic internal table is an extension to internal table concept, used when the number of fields is not known at the design time or until the compile time. Scenario 1: Display the table of contents in grid format using the dynamic internal table. Creating Dynamic internal table PARAMETERS : p_table(10) TYPE C. DATA: w_tabname TYPE w_tabname, w_dref TYPE REF TO data, w_grid TYPE REF TO cl_gui_alv_grid. FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE. w_tabname = p_table. CREATE DATA w_dref TYPE TABLE OF (w_tabname). ASSIGN w_dref->* TO <t_itab>. Populating Dynamic internal table SELECT * FROM (w_tabname) UP TO 20 ROWS INTO TABLE <t_itab>. Displaying dynamic internal table using Grid. CREATE OBJECT w_grid EXPORTING i_parent = cl_gui_container=>screen0. CALL METHOD w_grid->set_table_for_first_display EXPORTING i_structure_name = w_tabname CHANGING it_outtab = <t_itab>. CALL SCREEN 100. Scenario 2: Create a dynamic internal table with the specified number of columns. Creating Dynamic internal table TYPE-POOLS: slis. FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE, “ Dynamic internal table name <fs_dyntable>, “ Field symbol to create work area <fs_fldval> type any. “ Field symbol to assign values PARAMETERS: p_cols(5) TYPE c. “ Input number of columns DATA: t_newtable TYPE REF TO data, t_newline TYPE REF TO data, t_fldcat TYPE slis_t_fldcat_alv, t_fldcat TYPE lvc_t_fcat, wa_it_fldcat TYPE lvc_s_fcat, wa_colno(2) TYPE n, wa_flname(5) TYPE c. * Create fields . DO p_cols TIMES. CLEAR wa_it_fldcat. move sy-index to wa_colno. concatenate 'COL' wa_colno into wa_flname. wa_it_fldcat-fieldname = wa_flname. wa_it_fldcat-datatype = 'CHAR'. wa_it_fldcat-intlen = 10. APPEND wa_it_fldcat TO t_fldcat. ENDDO. * Create dynamic internal table and assign to FS CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING it_fieldcatalog = t_fldcat IMPORTING ep_table = t_newtable. ASSIGN t_newtable->* TO <t_dyntable>. * Create dynamic work area and assign to FS CREATE DATA t_newline LIKE LINE OF <t_dyntable>. ASSIGN t_newline->* TO <fs_dyntable>. Populating Dynamic internal table DATA: fieldname(20) TYPE c. DATA: fieldvalue(10) TYPE c. DATA: index(3) TYPE c. DO p_cols TIMES. index = sy-index. MOVE sy-index TO wa_colno. CONCATENATE 'COL' wa_colno INTO wa_flname. * Set up fieldvalue CONCATENATE 'VALUE' index INTO fieldvalue. CONDENSE fieldvalue NO-GAPS. ASSIGN COMPONENT wa_flname OF STRUCTURE <fs_dyntable> TO <fs_fldval>. <fs_fldval> = fieldvalue. ENDDO. * Append to the dynamic internal table APPEND <fs_dyntable> TO <t_dyntable>. Displaying dynamic internal table using Grid. DATA: wa_cat LIKE LINE OF fs_fldcat. DO p_cols TIMES. CLEAR wa_cat. MOVE sy-index TO wa_colno. CONCATENATE 'COL' wa_colno INTO wa_flname. wa_cat-fieldname = wa_flname. wa_cat-seltext_s = wa_flname. wa_cat-outputlen = '10'. APPEND wa_cat TO fs_fldcat. ENDDO. * Call ABAP List Viewer (ALV) CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING it_fieldcat = fs_fldcat TABLES t_outtab = <t_dyntable>.
发表评论
-
ranges 语法
2011-06-23 13:17 862RANGES语句:要用与选择表相同的结构创建内表,可使 ... -
开发的误区
2011-06-22 23:28 7771.传输请求号的时候按传输序列号大小 传输绝对没问题,这是一个 ... -
ALV 颜色
2011-06-22 09:06 964关于ALV GRID的颜色 A ... -
数据库左连接与右连接
2011-06-09 11:48 2898左连接与右连接 左 ... -
co02权限增强
2011-06-09 11:12 1190CO02 有无撤销技术实现权限的增强 标 ... -
EXIT 出口查找程序
2011-06-03 11:23 1067SPAN { font-family: "Co ... -
ALE development
2011-05-30 09:41 8861. Introduction to ALE developm ... -
将SmartForms转换为PDF保存到本地
2011-05-25 11:03 2799REPORT ZSMARTFORMS_TO_PDF.* Va ... -
DYNP_VALUES_UPDATE 實時更新 Selection Screen
2011-05-19 15:56 1757DYNP_VALUES_UPDATE 實時更新 Selecti ... -
Smartforms 中更改默认编辑器的两种方法
2011-04-12 19:07 1741Smartforms 中更改默认编辑器的两种方法(Tow Me ... -
Implicit enhancement points
2011-03-22 14:35 1176SAP Implicit enhancement poin ... -
如何将应用程序文档加进SAP R/3并有效利用?
2011-03-21 18:31 854如何将应用程序文档加进SAP R/3并有效利用? sap ... -
sap 长文本
2011-03-21 18:13 1660SAP长文本编辑 在 ... -
获取当前 GRID
2011-03-21 11:36 782SPAN { font-family: "Co ...
相关推荐
主要是关于ABAP动态内表使用详细方法以及示例的详解
在SAP ABAP里动态内表的构建,以及数据的传递,并且还附有说明的例子,简单明了.
field-symbols: <dyn_table> type standard table, ” 内表结构 , ” 表头 <dyn_field>. ” 项 data: dy_table type ref to data, dy_line type ref to data, ” 行 xfc type lvc_s_fcat, ” 列结构 ifc ...
ABAP 动态内表ABAP 动态内表
field-symbols: <dyn_table> type standard table, ” 内表结构 , ” 表头 <dyn_field>. ” 项 data: dy_table type ref to data, dy_line type ref to data, ” 行 xfc type lvc_s_fcat, ” 列结构 ifc ...
动态内表的创建,动态内表的赋值,动态内表的读取显示
详细介绍ABAP里面动态语句的写法 FIELD-SYMBOLS 申明的类型详解
abap tablecontrol 控件动态显示列
特点: 1\30个不同结构的透明表可以通过一程序来维护 2\这个程序是通过动态生成对应的动态内表来实现的 3\字段之间的搜索帮助有互相影响 4\请使用webex录屏软件来播放
本程序自主开发,包括SELECT,UPDATE,DELETE,INSERT操作,SELECT 语句可以根据自定义的内表动态的输出ALV 列表,UPDATE DELETE INSERT 语句可以对数据库表进行操作. 切忌谨慎应用此程序对数据库的操作,以免造成数据...
ABAP动态生成经典应用之Dynamic+SQL+Excute+程序.doc
ABAP351高级编程-动态编程.rar ABAP351 Advanced and Generic Programming in ABAP
ABAP编辑器快速调用函数时自动填充调用参数 和 声明变量
这个是国外人使用ABAP写的一个类似一SQL Server的查询分析器,它能够直接运行ABAP的OPEN SQL,由于SE11或者是SE16都只能对一表进行查询,但很多的时候我们需要对多个表进行联合查询,这时就可以发挥很大作用了,希望...
ABAP开发过程中遇到在程序执行过程中决定依照哪个字段来进行排序,代码实现依照动态字段进行排序的功能
SAP ABAP开发学习——第14课:动态SQL(视频教程) 1.SAP ABAP开发入门学习 2.含视频教程学习、PPT、作业 3.视频非常清晰
ABAP向在线用户发送系统消息(自动刷新ALV)
创建和处理内表 模块化 ABAP/4 程序 使用字段符号 存储数据 读取并处理数据库表 以簇方式存储数据对象 使用文件 Neither this documentation nor any part of it may be copied or reproduced in any form or ...
ALV是ABAP报表开发中经常用到的表单工具,用户经常需要将ALV中的数据进行打印或Excel导出,这样就需要对ALV的工具条进行扩展,添加自定义按钮,本文详细介绍了,如何在AVL中实现自定义按钮的方法,有具体的实例步骤...