Enhancement--How to Find a Screen Exit for T-code

REPORT YSMOD2 .

TABLES: MODSAP, MODACT, TSTC.

PARAMETERS: INPUT1 LIKE TSTC-TCODE DEFAULT ' ',
            INPUT2 LIKE MODSAP-TYP DEFAULT ' '.

DATA: SEARCH1(6),
      SEARCH2(3),
      SEARCH3 LIKE MODSAP-MEMBER.

DATA : FIRST_ROW VALUE 'Y'.

CONCATENATE: '%' INPUT1 '%' INTO SEARCH1,
'%' INPUT2 INTO SEARCH2.

SELECT * FROM TSTC WHERE TCODE LIKE SEARCH1.

FIRST_ROW = 'Y'.

CHECK TSTC-PGMNA NE SPACE.

CONCATENATE '%' TSTC-PGMNA '%' INTO SEARCH3.

SELECT * FROM MODSAP WHERE TYP LIKE SEARCH2
AND MEMBER LIKE SEARCH3.

SELECT SINGLE * FROM MODACT WHERE MEMBER = MODSAP-NAME.

IF FIRST_ROW EQ 'Y'.
   WRITE: /0 TSTC-TCODE, 6 TSTC-PGMNA, 16 MODSAP-NAME, 32 MODSAP-TYP,
          45 MODSAP-MEMBER, 70 MODACT-NAME.
   FIRST_ROW = 'N'.
ELSE.
   WRITE: /16 MODSAP-NAME, 32 MODSAP-TYP, 45 MODSAP-MEMBER, 70 MODACT-NAME.  
ENDIF.

CLEAR : MODSAP, MODACT.

ENDSELECT.

IF SY-SUBRC NE 0.
   WRITE : /0 TSTC-TCODE, 6 TSTC-PGMNA, 30 'No exits found'. 
ENDIF.

CLEAR TSTC.

ENDSELECT.

END-OF-SELECTION.

CLEAR: SEARCH1, SEARCH2, SEARCH3.

* End
 Source URL:http://erpgenie.com/abaptips/content/view/356/40/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值