首页 > 其他分享 >ALV Header Item 多层显示

ALV Header Item 多层显示

时间:2022-10-14 18:04:31浏览次数:53  
标签:SY LIKE Item Header TABNAME EBELN ALV HEADERTAB EKPO

ALV Header Item 多层显示_其它

代码参考的

*&---------------------------------------------------------------------*
*& Report YLM_0003
*&
*&---------------------------------------------------------------------*
*& created by lium
*& ALV Header Item 多层显示
*&---------------------------------------------------------------------*

REPORT YLM_0003.

TABLES : EKKO, EKPO.

SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN.

TYPE-POOLS: SLIS.

DATA: BEGIN OF HEADERTAB OCCURS 0,
EBELN LIKE EKKO-EBELN,
BSTYP LIKE EKKO-BSTYP,
BSART LIKE EKKO-BSART,
STATU LIKE EKKO-STATU,
END OF HEADERTAB.

DATA: BEGIN OF ITEMTAB OCCURS 0,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
WERKS LIKE EKPO-WERKS,
MENGE LIKE EKPO-MENGE,
NETPR LIKE EKPO-NETPR,
PEINH LIKE EKPO-PEINH,
NETWR LIKE EKPO-NETWR,
END OF ITEMTAB.

DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: V_REPID LIKE SY-REPID.
DATA: G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME,
GS_KEYINFO TYPE SLIS_KEYINFO_ALV.

START-OF-SELECTION.

V_REPID = SY-REPID.

SELECT EBELN BSTYP BSART STATU
INTO TABLE HEADERTAB
FROM EKKO
WHERE EBELN IN S_EBELN.

IF NOT HEADERTAB[] IS INITIAL.
SELECT EBELN EBELP MATNR WERKS MENGE NETPR PEINH NETWR
INTO TABLE ITEMTAB
FROM EKPO
FOR ALL ENTRIES IN HEADERTAB
WHERE EBELN = HEADERTAB-EBELN.
ENDIF.


CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'HEADERTAB'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ' '
CHANGING
CT_FIELDCAT = I_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'ITEMTAB'
I_INCLNAME = V_REPID
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ' '
CHANGING
CT_FIELDCAT = I_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

GS_KEYINFO-HEADER01 = 'EBELN'.
GS_KEYINFO-ITEM01 = 'EBELN'.
G_TABNAME_HEADER = 'HEADERTAB'.
G_TABNAME_ITEM = 'ITEMTAB'.


CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IT_FIELDCAT = I_FIELDCAT
I_SAVE = 'A'
I_TABNAME_HEADER = G_TABNAME_HEADER
I_TABNAME_ITEM = G_TABNAME_ITEM
IS_KEYINFO = GS_KEYINFO
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE = ' '
TABLES
T_OUTTAB_HEADER = HEADERTAB
T_OUTTAB_ITEM = ITEMTAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ALV Header Item 多层显示_其它_02



标签:SY,LIKE,Item,Header,TABNAME,EBELN,ALV,HEADERTAB,EKPO
From: https://blog.51cto.com/u_15680210/5757671

相关文章

  • ALV 导出电子表格的文件格式固定的删除办法
    在ALV显示中,选择菜单“列表-导出-电子表格”后,会出现下面这样的选择窗口:如果选中了“始终使用选定的格式”,则以后都会使用当前选定的格式(经常是第一项MHTML,可实际上用户希......
  • ALV 相关
    目录:1​​ALV双击弹出新ALV,并响应新ALV事件​​2​​DEMO:ALV 行、列、单元格颜色控制​​3​​Demo: DisableDELETEkeyonKeyboard​​4​​ALV输入数据后点回车自......
  • DEMO:REUSE_ALV_GRID_DISPLAY 复选框 刷新 grid_title
    最近写了几个FunctionALV复选框+刷新的报表,为了方便复制粘贴到其他项目修改,做了个demo。效果选中,删除结构和status代码REPORTzalv_demoDATA:lt_alv_showLIKET......
  • IIS 绿盟检测到HOST头攻击漏洞的解决: web应用使用SERVER_NAME而非host header。
    https://blog.csdn.net/fightingintherain/article/details/1256648851、漏洞描述2、修复方案(IIS服务端) 1)下载安装url重写工具(官网URLRewrite:TheOfficialMic......
  • 修复后的CSOItem
    classCSOItem{public:charpad_0000[24];//0x0000DWORDunkClass;DWORDunk_1;DWORDActiveShit;charpad_0001[16];DWORDdwObjID;/......
  • OO ALV 实现下拉框
    ​​http://blog.sina.com.cn/s/blog_c0978c9b0101hesn.html​​至于下拉框,主要的地方如下:*……………………………………………………………………......
  • alv 类cl_gui_alv_grid事件查…
    自己动手,丰衣足食,有些需求可以自己找找标准的是否提供了,下面是一个简单的查找过程alv 类cl_gui_alv_grid   主要看该类的事件​​​​比如双击:​​​​每一个事件所能......
  • OO ALV常用功能完整简例(热键单击…
    OOALV常用功能简介目录OOALV常用功能简介...1一、所用类:...2二、效果图:...2单击...2双击...2F4帮助...3编辑某单元格并校验...3三、实现过程:.........
  • DEMO:下载模板,上载数据,alv展示checkbox热键等_SAP刘梦_新浪博客
    ​​​​​​​​*&---------------------------------------------------------------------**& Report  ZDEMO_UPLOAD*&......
  • ALV相关文章汇总
    行项目描述1​​DEMO:ALV显示明细​​2​​DEMO:REUSE_ALV_GRID_DISPLAY复选框刷新grid_title​​3​​获取表字段结构​​4​​CL_SALV_TABLE实现列编辑​​5​​ALV......