7.32 |
F4帮助,内表方式,利用个人数据过滤值,做到样子上不显示所有数据。 |
|
|
|
*&——————————————————————–* |
|
*& Form frm_help |
|
*&——————————————————————–* |
|
* F4帮助 |
|
*———————————————————————* |
|
FORM frm_help. |
|
|
|
TYPES: |
|
BEGIN OF typ_vuser, |
|
bname TYPE zbapiaddr3-bname, “网关账号 |
|
lastname TYPE zbapiaddr3-lastname, “姓 |
|
fullname TYPE zbapiaddr3-fullname, “全名 |
|
department TYPE zbapiaddr3-department, “部门 |
|
function TYPE zbapiaddr3-function, “岗位 |
|
END OF typ_vuser. |
|
|
|
DATA: |
|
lth_vuser TYPE typ_vuser, |
|
ltd_vuser TYPE TABLE OF typ_vuser. |
|
DATA: |
|
lth_ddshpval50 TYPE ddshpval50. |
|
|
|
SELECT zbapiaddr3~bname |
|
zbapiaddr3~lastname |
|
zbapiaddr3~fullname |
|
zbapiaddr3~department |
|
zbapiaddr3~function |
|
INTO CORRESPONDING FIELDS OF TABLE ltd_vuser |
|
FROM zbapiaddr3 |
|
WHERE bname <> ”. |
|
|
|
* 个人列表数据中插入一条数据 |
|
SELECT COUNT(*) |
|
FROM ddshpval50 |
|
WHERE username = sy-uname |
|
AND pvalkey = ‘ZGATEWAY_SU01D’ |
|
AND shlptype = ‘IN’ |
|
AND pos = ‘1’ |
|
AND rectype = ”. |
|
|
|
IF sy-dbcnt = 0.”read或者只插入当前用户名 |
|
READ TABLE ltd_vuser INTO lth_vuser |
|
WITH KEY bname = sy-uname. |
|
lth_ddshpval50-username = sy-uname. |
|
lth_ddshpval50-pvalkey = ‘ZGATEWAY_SU01D’. |
|
lth_ddshpval50-shlptype = ‘IN’. |
|
lth_ddshpval50-pos = ‘1’. |
|
lth_ddshpval50-rectype = ”. |
|
lth_ddshpval50-record+0(12) = lth_vuser-bname. |
|
lth_ddshpval50-record+12(40) = lth_vuser-lastname. |
|
lth_ddshpval50-record+52(80) = lth_vuser-fullname. |
|
lth_ddshpval50-record+132(40) = lth_vuser-department. |
|
lth_ddshpval50-record+172(40) = lth_vuser-function. |
|
|
|
MODIFY ddshpval50 FROM lth_ddshpval50. |
|
ENDIF. |
|
|
|
* 调用展示函数 |
|
CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’ |
|
EXPORTING |
|
retfield = ‘BNAME’ “表格要显示的字段 |
|
dynpprog = sy-repid “返回程序 |
|
dynpnr = sy-dynnr “屏幕 |
|
dynprofield = ‘P_NAME’ “往页面回填值的地方 |
|
value_org = ‘S’ “显示类型 |
|
pvalkey = ‘ZGATEWAY_SU01D'”设置此参数,会显示个人值 |
|
TABLES |
|
value_tab = ltd_vuser. “传进去的表格 帮助的内表 |
|
|
|
IF sy-subrc <> 0. |
|
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno |
|
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. |
|
ENDIF. |
|
|
|
ENDFORM. “frm_help |