打印某个ABAP事务码使用到的所有Authorization object
发布日期:2021-06-30 14:06:42
浏览次数:2
分类:技术文章
本文共 11213 字,大约阅读时间需要 37 分钟。
REPORT ZCODE.tables: tstc, tobjt, usobt, tactz, tobj, sscrfields.* AUTH_FIELD_GET_INFO DDIF_FIELDINFO_GET AUTH_FIELDINFO_GETdata: begin of itab occurs 0. include structure usobt.data: end of itab.data: begin of i_tc occurs 0, tcode_l like tstc-tcode, tcode_h like tstc-tcode, end of i_tc.data: begin of i_file occurs 0, tcode_low like tstc-tcode, tcode_high like tstc-tcode, end of i_file.data: fld_txt like dfies-fieldtext.data: aa type i, bb type i, cc type i, dd type i, ee type i, ff type i.data: begin of values occurs 0. include structure tpr01.data: end of values.*data new_line.data upload.data obj_change.data fld_change.*data fld(20).data val(20).data ln_o like sy-lilli.data ln_f like sy-lilli.data field like itab-field.data object like itab-object.*ranges: i_tcode for tstc-tcode. " OPTION EQ SIGN I.select-options: tcode for tstc-tcode memory id tcd.selection-screen function key 1.selection-screen function key 2.*SELECTION-SCREEN FUNCTION KEY 4.initialization. move 'Create File' to sscrfields-functxt_01. move 'Upload Transaction Codes' to sscrfields-functxt_02.at selection-screen. case sy-ucomm. when 'FC01'. loop at tcode. i_file-tcode_high = tcode-high. i_file-tcode_low = tcode-low. append i_file. endloop. if sy-subrc <> 0. message i000(8i) with 'Empty File will be created!'. endif. call function 'DOWNLOAD' exporting filename = 'C:\Windows\Desktop\TCODE.txt ' filetype = 'DAT' tables data_tab = i_file . if sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. endif. when 'FC02'. refresh i_tc. clear i_tc. refresh tcode. clear tcode. upload = 'X'. call function 'UPLOAD'exporting filename = 'C:\Windows\Desktop\Tcode.txt' filetype = 'DAT' tables data_tab = i_tc . if sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. else. refresh i_tcode. clear i_tcode. loop at i_tc. if i_tc-tcode_h is initial. if i_tc-tcode_l ca '*'.endif. if sy-fdpos <> 20. i_tcode-sign = 'I'. i_tcode-option = 'CP'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. else. i_tcode-sign = 'I'. i_tcode-option = 'EQ'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. endif. else. i_tcode-sign = 'I'. i_tcode-option = 'BT'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. endif. append i_tcode. endloop. tcode[] = i_tcode[]. endif. endcase. read table tcode. if sy-subrc <> 0. message e000(8i) with 'Please enter a Transaction Code'. endif.start-of-selection. aa = 18. bb = aa + 15. cc = bb + 50. dd = cc + 10. ee = dd + 30. ff = ee + 20. select * from usobt into table itab where name in tcode. loop at itab. select single * from tobjt where object = itab-object and langu = sy-langu. clear new_line. clear obj_change. clear fld_change. format color off. on change of itab-name. new_line = 'Y'. format color 4. write:/2 itab-name(30). hide: itab-name. endon. if new_line <> 'Y'. new-line. endif. on change of itab-object. obj_change = 'X'. write: at aa itab-object. hide: itab-object. endon. if new_line = 'Y' and obj_change <> 'X'. write: at aa itab-object. hide: itab-object. endif. on change of tobjt-ttext. write: at bb tobjt-ttext. endon. if new_line = 'Y' and obj_change <> 'X'. write: at bb tobjt-ttext. hide: tobjt-ttext. endif. on change of itab-field. fld_change = 'X'. write: at cc itab-field color 6 inverse on hotspot. hide: itab-field . call function 'AUTH_FIELD_GET_INFO' exporting fieldname = itab-field importing text = fld_txt . write: at dd fld_txt. endon. if new_line = 'Y' and fld_change <> 'X'. write: at cc itab-field color 6 inverse on hotspot. write: at dd fld_txt. endif. write: at ee itab-low. write: at ff itab-high. endloop.end-of-selection. clear itab.at line-selection. clear object. clear field. ln_o = sy-lilli. ln_f = sy-lilli. field = itab-field. get cursor field fld value val. if itab-object is initial. do. ln_o = ln_o - 1. read line ln_o. if sy-subrc <> 0. exit. endif. if not itab-object is initial. exit. endif. enddo. object = itab-object. else. object = itab-object. endif. if field is initial. do. ln_f = ln_f - 1. read line ln_f. if sy-subrc <> 0. exit. endif. if not itab-field is initial. exit. endif. enddo. field = itab-field. endif. call function 'SUPRN_MAINTAIN_VALUES' exporting object = object field = field tables f_values = values.*&---------------------------------------------------------------------**& Report ZCODE*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT ZCODE.tables: tstc, tobjt, usobt, tactz, tobj, sscrfields.* AUTH_FIELD_GET_INFO DDIF_FIELDINFO_GET AUTH_FIELDINFO_GETdata: begin of itab occurs 0. include structure usobt.data: end of itab.data: begin of i_tc occurs 0, tcode_l like tstc-tcode, tcode_h like tstc-tcode, end of i_tc.data: begin of i_file occurs 0, tcode_low like tstc-tcode, tcode_high like tstc-tcode, end of i_file.data: fld_txt like dfies-fieldtext.data: aa type i, bb type i, cc type i, dd type i, ee type i, ff type i.data: begin of values occurs 0. include structure tpr01.data: end of values.*data new_line.data upload.data obj_change.data fld_change.*data fld(20).data val(20).data ln_o like sy-lilli.data ln_f like sy-lilli.data field like itab-field.data object like itab-object.*ranges: i_tcode for tstc-tcode. " OPTION EQ SIGN I.select-options: tcode for tstc-tcode memory id tcd.selection-screen function key 1.selection-screen function key 2.*SELECTION-SCREEN FUNCTION KEY 4.initialization. move 'Create File' to sscrfields-functxt_01. move 'Upload Transaction Codes' to sscrfields-functxt_02.at selection-screen. case sy-ucomm. when 'FC01'. loop at tcode. i_file-tcode_high = tcode-high. i_file-tcode_low = tcode-low. append i_file. endloop. if sy-subrc <> 0. message i000(8i) with 'Empty File will be created!'. endif. call function 'DOWNLOAD' exporting filename = 'C:\Windows\Desktop\TCODE.txt ' filetype = 'DAT' tables data_tab = i_file . if sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. endif. when 'FC02'. refresh i_tc. clear i_tc. refresh tcode. clear tcode. upload = 'X'. call function 'UPLOAD'exporting filename = 'C:\Windows\Desktop\Tcode.txt' filetype = 'DAT' tables data_tab = i_tc . if sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. else. refresh i_tcode. clear i_tcode. loop at i_tc. if i_tc-tcode_h is initial. if i_tc-tcode_l ca '*'.endif. if sy-fdpos <> 20. i_tcode-sign = 'I'. i_tcode-option = 'CP'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. else. i_tcode-sign = 'I'. i_tcode-option = 'EQ'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. endif. else. i_tcode-sign = 'I'. i_tcode-option = 'BT'. i_tcode-low = i_tc-tcode_l. i_tcode-high = i_tc-tcode_h. endif. append i_tcode. endloop. tcode[] = i_tcode[]. endif. endcase. read table tcode. if sy-subrc <> 0. message e000(8i) with 'Please enter a Transaction Code'. endif.start-of-selection. aa = 18. bb = aa + 15. cc = bb + 50. dd = cc + 10. ee = dd + 30. ff = ee + 20. select * from usobt into table itab where name in tcode. loop at itab. select single * from tobjt where object = itab-object and langu = sy-langu. clear new_line. clear obj_change. clear fld_change. format color off. on change of itab-name. new_line = 'Y'. format color 4. write:/2 itab-name(30). hide: itab-name. endon. if new_line <> 'Y'. new-line. endif. on change of itab-object. obj_change = 'X'. write: at aa itab-object. hide: itab-object. endon. if new_line = 'Y' and obj_change <> 'X'. write: at aa itab-object. hide: itab-object. endif. on change of tobjt-ttext. write: at bb tobjt-ttext. endon. if new_line = 'Y' and obj_change <> 'X'. write: at bb tobjt-ttext. hide: tobjt-ttext. endif. on change of itab-field. fld_change = 'X'. write: at cc itab-field color 6 inverse on hotspot. hide: itab-field . call function 'AUTH_FIELD_GET_INFO' exporting fieldname = itab-field importing text = fld_txt . write: at dd fld_txt. endon. if new_line = 'Y' and fld_change <> 'X'. write: at cc itab-field color 6 inverse on hotspot. write: at dd fld_txt. endif. write: at ee itab-low. write: at ff itab-high. endloop.end-of-selection. clear itab.at line-selection. clear object. clear field. ln_o = sy-lilli. ln_f = sy-lilli. field = itab-field. get cursor field fld value val. if itab-object is initial. do. ln_o = ln_o - 1. read line ln_o. if sy-subrc <> 0. exit. endif. if not itab-object is initial. exit. endif. enddo. object = itab-object. else. object = itab-object. endif. if field is initial. do. ln_f = ln_f - 1. read line ln_f. if sy-subrc <> 0. exit. endif. if not itab-field is initial. exit. endif. enddo. field = itab-field. endif. call function 'SUPRN_MAINTAIN_VALUES' exporting object = object field = field tables f_values = values.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
转载地址:https://jerry.blog.csdn.net/article/details/104034366 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年05月02日 05时35分17秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Python 之 histogram直方图
2019-04-30
Python实现决策树 Desision Tree & 可视化
2019-04-30
决策树 Decision tree
2019-04-30
nominal和ordinal & 数据处理中四种基本数据类型
2019-04-30
Trie树(字典树)
2019-04-30
COMP7404 Machine Learing——ROC
2019-04-30
MATLAB与CUDA
2019-04-30
Linux png转jpg (convert命令)
2019-04-30
Ubuntu更新后终端中字体的颜色全是白色
2019-04-30
vscode git
2019-04-30
基于MATLAB的二进制数字调制与解调信号的仿真——2PSK
2019-04-30
基于MATLAB的模拟调制信号与解调的仿真——DSB
2019-04-30
HDU - 1166 敌兵布阵 (树状数组模板题/线段树模板题)
2019-04-30
CodeForces - 456C Boredom (dp)
2019-04-30
CodeForces - 675A Infinite Sequence(简单数论 细节)
2019-04-30
CodeForces - 1042B Vitamins (思维)
2019-04-30
ACM 2013 长沙区域赛 Collision (几何)
2019-04-30
ACM 2014 鞍山区域赛 E - Hatsune Miku (dp)
2019-04-30