注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

XINBO'S SAP BLOG

你所浪费的今天,是昨天死去的人奢望的明天。你所厌恶的现在,是未来的你回不去的曾经

 
 
 

日志

 
 

demo program to create subscreen in your ABAP Program   

2009-05-20 09:50:09|  分类: REPORTING&&OTHER |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

*
* This report will display the user last login date and time.
*
* Subscreen selection 1 : User Name
*                                2 : Last Login Date
*                                3 : Class Belong To
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
*                    http://www.sap-img.com
*

REPORT ZSUBSCREEN.

TABLES: USR02,       "Logon data
        SSCRFIELDS.  "FIELDS ON SELECTION SCREENS
*---------------------------------------------------------------
* SUBSCREEN 1
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
SELECT-OPTIONS: USERNAME FOR USR02-BNAME.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 100.

*---------------------------------------------------------------
* SUBSCREEN 2
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 200.

*---------------------------------------------------------------
* SUBSCREEN 3
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.
SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 300.

* STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,
                  END OF BLOCK SUB.

START-OF-SELECTION.
  SELECT * FROM USR02 WHERE BNAME IN USERNAME
                        AND ERDAT IN LASTLOGI
                        AND CLASS IN CLASSTYP.
    WRITE: / 'User ', USR02-BNAME,
             'Last Login Date ', USR02-TRDAT,
             'Last Login Time ', USR02-LTIME,
             'CLASS ', USR02-CLASS.
  ENDSELECT.

END-OF-SELECTION.

INITIALIZATION.
* SCREEN ICON LEFT AND RIGHT
  SSCRFIELDS-FUNCTXT_01 = '@0D@'.
  SSCRFIELDS-FUNCTXT_02 = '@0E@'.
  SUB-PROG = SY-REPID.
  SUB-DYNNR = 100.

AT SELECTION-SCREEN.
  CASE SY-DYNNR.

    WHEN 100.
      IF SSCRFIELDS-UCOMM = 'FC01'.
        SUB-DYNNR = 300.
      ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
        SUB-DYNNR = 200.
      ENDIF.

    WHEN 200.
      IF SSCRFIELDS-UCOMM = 'FC01'.
        SUB-DYNNR = 100.
      ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
        SUB-DYNNR = 300.
      ENDIF.

    WHEN 300.
      IF SSCRFIELDS-UCOMM = 'FC01'.
        SUB-DYNNR = 200.
      ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
        SUB-DYNNR = 100.
      ENDIF.
  ENDCASE.

  评论这张
 
阅读(558)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017