DATA: g_dynnr LIKE sy-dynnr.
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
PARAMETERS p_file1 TYPE tabname.
SELECTION-SCREEN END OF SCREEN 400.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS SUBSCREEN.
PARAMETERS p_file2 TYPE tabname.
SELECTION-SCREEN END OF SCREEN 500.
SELECTION-SCREEN BEGIN OF TABBED BLOCK mytab FOR 20 LINES.
SELECTION-SCREEN TAB (10) text1 USER-COMMAND but1.
SELECTION-SCREEN TAB (10) text2 USER-COMMAND but2.
SELECTION-SCREEN END OF BLOCK mytab.
INITIALIZATION .
text1 = '标签1'.
text2 = '标签2'.
mytab-prog = sy-repid.
IF g_dynnr = space.
mytab-dynnr = 400.
mytab-activetab = 'PUSH1'.
ELSE.
mytab-dynnr = g_dynnr.
IF g_dynnr = '400' .
mytab-activetab = 'BUT2'.
ENDIF.
ENDIF.
AT SELECTION-SCREEN.
CASE sy-dynnr.
WHEN 1000.
CASE sy-ucomm.
WHEN 'BUT1'.
mytab-dynnr = 400.
WHEN 'BUT2'.
mytab-dynnr = 500.
WHEN OTHERS.
ENDCASE.
ENDCASE.
START-OF-SELECTION.
CASE mytab-dynnr.
WHEN 400.
MESSAGE '400' TYPE 'I'.
WHEN 500.
MESSAGE '500' TYPE 'I'.
ENDCASE.
SAP ABAP 选择屏幕实现标签页
最新推荐文章于 2024-07-10 19:11:05 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)