Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 软件时空 > 软件相关 > Displays the menu path for a transaction
【标  题】:Displays the menu path for a transaction
【关键字】:Displays,the,menu,path,for,transaction
【来  源】:http://blog.chinaunix.net/article.php?articleId=52275&blogId=8178

Displays the menu path for a transaction

Your Ad Here
*********************************************************************

* This program displays the menu path for a transaction. If the user

* doubleclicks on the transaction name, it displays the transaction's

* start screen. It is useful when working with the profile generator,

* because it is much faster than extracting a menu branch and finding a

* transaction code in it. To run this program, the user menu has to be

* generated.
*********************************************************************

REPORT ZMENPATH NO STANDARD PAGE HEADING.
TABLES: SMENCUSNEW, SMENCUST, TSTC.

DATA: BEGIN OF ITAB OCCURS 10.
        INCLUDE STRUCTURE SMENCUSNEW.
DATA: END OF ITAB.
DATA: BEGIN OF STACK OCCURS 10,
        ID(5) TYPE N,
END OF STACK.
DATA: I TYPE I.
PARAMETERS: TRANS LIKE TSTC-TCODE.

* Get the id of our transaction
SELECT * FROM SMENCUSNEW WHERE REPORT = TRANS AND CUSTOMIZED = 'S'.
  MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
  APPEND ITAB.
ENDSELECT.

* Our transaction is not in smencusnew
IF SY-SUBRC <> 0.
  WRITE: / TRANS COLOR 5.
  SKIP.
  WRITE: / 'Not in the profile generator''s table'.
  EXIT.
ENDIF.

* Get the parent id that links us to the root with the fewest levels
SORT ITAB BY MENU_LEVEL.
READ TABLE ITAB INDEX 1.
STACK = ITAB-OBJECT_ID. APPEND STACK.
STACK = ITAB-PARENT_ID. APPEND STACK.

* Search for the grandparets ...
DO.
  CLEAR ITAB. REFRESH ITAB.
  SELECT * FROM SMENCUSNEW WHERE OBJECT_ID = STACK-ID AND
                                 CUSTOMIZED = 'S'.
    MOVE-CORRESPONDING SMENCUSNEW TO ITAB.
    APPEND ITAB.
  ENDSELECT.
  SORT ITAB BY MENU_LEVEL.
  READ TABLE ITAB INDEX 1.
  IF ITAB-PARENT_ID = '00001'. EXIT. ENDIF.
  STACK = ITAB-PARENT_ID. APPEND STACK.
ENDDO.

* Display the result
WRITE: / TRANS COLOR 5.HIDE TRANS. CLEAR TRANS.
WRITE: '  <<<< Doubleclick to see the transaction'.
SKIP.
WRITE: /(30) 'Main Menu' COLOR 2.
SORT STACK.
LOOP AT STACK.
  I = I + 3.
  SELECT SINGLE * FROM SMENCUST WHERE SPRAS = 'E' AND OBJECT_ID = STACK.
  WRITE: /I(30) SMENCUST-TEXT COLOR 2.
ENDLOOP.

* Display the transaction when the user doubleclick on trans
AT LINE-SELECTION.
  IF NOT TRANS IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE = TRANS.
    CALL TRANSACTION TRANS.
  ENDIF.
CLEAR TRANS.

发布晚了,Openshell的第一个里程碑:【上一篇】
AcpExercise205-4.mixal:【下一篇】
【相关文章】
  • For语句的使用——编写windows下的批处理文件(1)
  • Looking at real time for Linux,PowerPC, and Cell
  • 读书笔记之<<Learning the bash shell>> 之一
  • 读书笔记之<<Learning the bash shell>> 之二
  • 读书笔记之<<Learning the bash shell>> 之三
  • 读书笔记之<<Learning the bash shell>> 之四
  • 读书笔记之<<Learning the bash shell>> 之五
  • 读书笔记之<<Learning the bash shell>> 之六
  • 读书笔记之<<Learning the bash shell>> 之七
  • 读书笔记之<<Learning the bash shell>> 之八
  • 【随机文章】
  • XmlHttp异步获取网站数据的例子
  • Oracle 9i的数据类型
  • 深入研究“用ASP上载文件”(一)
  • SQL 收藏
  • [转载]网管员进阶:VPN基础知识
  • 三步搞定纵横页面的混合打印
  • Google版操作系统现身
  • Illustrator 10变形工具详解(5)
  • [专辑]图解SuSE Linux 硬盘安装(使用iso映像文件安装)
  • 信号编码设计
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.