首页 > 其他分享 >Demo:选择屏幕写页签

Demo:选择屏幕写页签

时间:2022-10-14 20:01:25浏览次数:52  
标签:dynnr SELECTION mytab Demo SCREEN subscreen 屏幕 写页 0300

效果图:

Demo:选择屏幕写页签_微信

Demo:选择屏幕写页签_赋值_02


demo代码

需要特别注意的是abap memory的应用

Demo:选择屏幕写页签_赋值_03

Demo:选择屏幕写页签_微信_04

Demo:选择屏幕写页签_微信_05


文本版:

*&---------------------------------------------------------------------*
*& Report ZLM_SCREEN3
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zlm_screen3.

TABLES:mara.

SELECTION-SCREEN BEGIN OF SCREEN 0100 AS SUBSCREEN .
PARAMETERS:
p_dwms TYPE char1 AS LISTBOX VISIBLE LENGTH 30,
p_dwm TYPE string NO-DISPLAY.
SELECT-OPTIONS:
s_matnr FOR mara-matnr .

SELECTION-SCREEN END OF SCREEN 0100.

SELECTION-SCREEN BEGIN OF SCREEN 0300 AS SUBSCREEN.
PARAMETERS: rb_down RADIOBUTTON GROUP rad1, "下载模版
rb_up RADIOBUTTON GROUP rad1, "导入数据
p_file LIKE rlgrap-filename. "文件路径

SELECTION-SCREEN END OF SCREEN 0300.


SELECTION-SCREEN BEGIN OF TABBED BLOCK mytab FOR 4 LINES."子屏幕的行数
SELECTION-SCREEN TAB (6) text1 USER-COMMAND but1.
SELECTION-SCREEN TAB (10) text2 USER-COMMAND but2.
SELECTION-SCREEN END OF BLOCK mytab.

*----------------------------------------------------------------------*
* INITIALIZATION
*----------------------------------------------------------------------*

INITIALIZATION . "给标签赋值
PERFORM frm_init.

*----------------------------------------------------------------------*
* AT SELECTION-SCREEN.
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
CASE sy-dynnr.
WHEN 1000.
CASE sy-ucomm.
WHEN 'BUT1'. " 'BUT1'
mytab-dynnr = 0100.
WHEN 'BUT2'. " 'BUT2'
mytab-dynnr = 0300.
WHEN OTHERS.
ENDCASE.
ENDCASE.

*----------------------------------------------------------------------*
* 事件处理
*----------------------------------------------------------------------*

START-OF-SELECTION.
CASE mytab-dynnr.
WHEN 0100.
MESSAGE '1' TYPE 'I'.
WHEN 0300. "300屏幕的操作
DATA: lv_subscreen TYPE string .
"ABAP memory是为了能控制返回时返回到哪个页签
lv_subscreen = '0300'.
EXPORT lv_subscreen TO MEMORY ID 'M1'.
MESSAGE '2' TYPE 'I'.
ENDCASE.


FORM frm_init .
DATA: lv_subscreen TYPE string .

text1 = '页签一'.
text2 = '页签二'.

IMPORT lv_subscreen FROM MEMORY ID 'M1' . "读取内存,获取当前处理页签

DATA(v_dynnr) = lv_subscreen.

mytab-prog = sy-repid.

IF v_dynnr = space.
mytab-dynnr = 0100.
mytab-activetab = 'BUT1'. " 'BUT1'
ELSE.
mytab-dynnr = v_dynnr.

IF v_dynnr = 0300 .
mytab-activetab = 'BUT2'. "'BUT2'
ENDIF.
ENDIF.
ENDFORM. " FRM_INIT

Demo:选择屏幕写页签_模版_06



标签:dynnr,SELECTION,mytab,Demo,SCREEN,subscreen,屏幕,写页,0300
From: https://blog.51cto.com/u_15680210/5757870

相关文章

  • 选择屏幕动态显示BLOCK title
    SELECTION-SCREENBEGINOFBLOCKb1WITHFRAMETITLEtext-001.PARAMETERSp_rRADIOBUTTONGROUPg1USER-COMMANDselectDEFAULT'X'."日模式PARAMETERSp_yRADIOB......
  • DEMO:冲销交货单过账凭证WS_REVERSE_GOODS_ISSUE
    reportzdemo_vl09.parametersp_vbelntypevbeln_vl.data:lt_likptypetableoflikp.data:ls_likplikelineoflt_likp.data:lt_mesg......
  • DEMO:MB1B 311 移库 BAPI_GOODSMVT_CREATE
    *&---------------------------------------------------------------------**&ReportZDEMO_MB1B*&*&---------------------------------------------------------------......
  • WDA DEMO 11 根据BAPI/Function创建WDA
    货铺QQ群号:834508274进群统一修改群名片,例如BJ_ABAP_森林木。群内禁止发广告及其他一切无关链接,小程序等,进群看公告,谢谢配合不修改昵称会被不定期踢除,谢谢配合事先声明下,本......
  • Demo:下载模板 02 使用SAP_CONVERT_TO_XLS_FORMAT
    货铺QQ群号:834508274进群统一修改群名片,例如BJ_ABAP_森林木。群内禁止发广告及其他一切无关链接,小程序等,进群看公告,谢谢配合不修改昵称会被不定期踢除,谢谢配合有批导需求的......
  • Demo:下载模板01 SMW0
    货铺QQ群号:834508274进群统一修改群名片,例如BJ_ABAP_森林木。群内禁止发广告及其他一切无关链接,小程序等,进群看公告,谢谢配合不修改昵称会被不定期踢除,谢谢配合有批导需求的......
  • WDA DEMO 03: 根据选择条件查询并显示
    下面开始干货:事先声明下,本人没参加过培训,也没看过完整的标准教程,所以一直都是野路子,土八路。所以文章中不足以及不正确的地方请大家帮忙指正。SE80新建。然后新建一个Attri......
  • 增强Demo 03 销售订单屏幕增强后BAPI增强
    干货:前面两篇文章分别介绍了销售订单抬头和行项目上屏幕增强的案例。屏幕上增加了俩字段,那BAPI创建修改的时候怎么处理?怎么把增强字段值写进去?使用BAPI的EXTENSIONIN参数可......
  • 增强Demo 02 销售订单屏幕增强-item 增强
    干货:首先append一个字段然后激活。之前写Header屏幕增强的时候,其实已经提到过增强的方法了。Header使用的BADI,当然还可以使用对应的itemBADI来实现这个需求。这里介绍下......
  • DEMO: 获取交货单未开票数量
    VL03N查看交货单交货数量为5,单位是CAR查看已经开票凭证流:直接看表VBFA开票84单位EA冲销76单位EA已开84-76=8EA而咱们看交货单的时候,交货单单位CAR.单位转换:交货......