好男人就是我,我就是你兵哥
分类: Web开发
2014-09-19 17:19:37
pfcg, 权限对象 S_DEVELOP
SPAN {
font-family: "仿宋";
font-size: 11pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
FUNCTION zkpi_tree009.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(IV_BNAME) TYPE CHAR12 OPTIONAL
*" REFERENCE(IV_CHANGE) TYPE CHAR1 OPTIONAL
*"----------------------------------------------------------------------
" usr04 ust04 usrbf2"
DATA: lv_modbe TYPE char12,
lv_tabname TYPE char30,
dyn_tb TYPE REF TO data,
dyn_wa TYPE REF TO data,
lt_fieldcat TYPE lvc_t_fcat,
ls_fieldcat TYPE lvc_s_fcat.
FIELD-SYMBOLS:
******************************************************************
TRY .
lv_tabname = 'USR04' .
CLEAR lv_modbe .
SELECT SINGLE modbe INTO lv_modbe
FROM (lv_tabname)
WHERE bname = iv_bname. "SAP All 权限
CHECK lv_modbe IS NOT INITIAL .
lv_tabname = 'USRBF2' .
REFRESH lt_fieldcat .
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE' "检查表名是否正确"
EXPORTING
i_structure_name = lv_tabname
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CHECK lt_fieldcat[] IS NOT INITIAL . "检查结构是否存在"
CREATE DATA dyn_tb TYPE TABLE OF (lv_tabname). "创建动态内表
IF sy-subrc EQ 0.
ASSIGN dyn_tb->* TO
ENDIF .
CREATE DATA dyn_wa TYPE (lv_tabname). "定义动态结构
IF sy-subrc = 0.
ASSIGN dyn_wa->* TO
ENDIF.
REFRESH
SELECT * INTO TABLE
FROM (lv_tabname)
WHERE bname = lv_modbe.
LOOP AT
ASSIGN COMPONENT 'BNAME' OF STRUCTURE
ENDLOOP.
IF iv_change = 'X' AND
INSERT (lv_tabname) FROM TABLE
COMMIT WORK .
ENDIF.
CATCH cx_root.
ENDTRY.
ENDFUNCTION.