POPUP_GET_VALUES
通過 Function Module 彈出窗口,在用戶確認(rèn)或修改數(shù)據(jù)后,返回變更后的數(shù)據(jù)內(nèi)容及用戶提交或否定。
所屬 Function Group : SPO4
所屬 Package : SZP
DATA:rcode TYPE c LENGTH 1.
DATA:mytable TYPE STANDARD TABLE OF sval WITH HEADER LINE.
mytable-tabname = ‘USR02′.
mytable-fieldname = ‘BNAME’.
APPEND mytable.
CLEAR mytable.
mytable-tabname = ‘USR02′.
*mytable-FIELDNAME = ‘BCODE’."Internal type X is not supported
mytable-fieldname = ‘CLASS’.
mytable-value = ‘test’.
APPEND mytable.
CLEAR mytable.
mytable-tabname = ‘MARA’.
mytable-fieldname = ‘MATNR’.
mytable-value = ’01234567′.
mytable-FIELD_ATTR = ’03′.
mytable-FIELDTEXT = ‘MAT’.
APPEND mytable.
CLEAR mytable.
CALL FUNCTION ‘POPUP_GET_VALUES’
? EXPORTING
*?? NO_VALUE_CHECK??????? = ‘ ‘
??? popup_title?????????? = ‘title’
?? start_column????????? = ’5′
?? start_row???????????? = ’5′
?IMPORTING
?? returncode??????????? = rcode
? TABLES
??? fields??????????????? = mytable
?EXCEPTIONS
?? error_in_fields?????? = 1
?? OTHERS??????????????? = 2
????????? .
IF sy-subrc <> 0.
? MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
????????? WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CASE rcode.
? WHEN ”.
??? WRITE:’YES’.
? WHEN ‘A’.
??? WRITE:’NO’.
ENDCASE.
*someting about TABLES fields:
*TABNAME (table name)
*The table must be active in the Data Dictionary.
*FIELDNAME (name of the field to be displayed)
*The field must belong to the table TABNAME.
*If a field is to appear twice, the second field must be passed on
*with ‘*’ before the table name (for example, *T001).
*VALUE (field value)
*VALUE can be assigned a value when the function module is called up.
*This value is displayed.? If the user does not cancel the action,
*VALUE contains the value entered by the user.
*The values must be converted to character format with Move not with
*Assign.
*FIELD_ATTR (field attribute)
*The field attribute determines the layout attribute of the field and
*must have one of the following values:
" " (Space) normal display, ready for input
"01" highlighted, ready for input
"02" normal display, protected against input
"03" highlighted, protected against input
"04" field is not displayed
"05" normal display, not ready for input, 2-dimensional
*FIELD_OBL (obligatory)
*This indicator determines whether or not the field is obligatory
*and must have one of the following values:
" " (Space) The field is optional
"X" The field is obligatory
*FIELDTEXT (keyword)
*In FIELDTEXT the keyword of the field can be specified if the
*dictionary keyword is not to be used.
*
*COMP_CODE
*The field is not required for this function module.
*
*COMP_TAB
*The field is not required for this function module.
*
*COMP_FIELD
*The field is not required for this function module.
*
*NOVALUEHLP
*This indicator determines whether the value help button should be
*displayed or not, and must have one of the following values:
" " = The value help button is permanently displayed
"X" = The value help button is not displayed
"S" = The possible help key is displayed and calls the F4 help from
"??????? the Dictionary.
"??????? This parameter is only useful in combination with
*user-defined F4 help
"??????? (POPUP_GET_VALUES_USER_HELP and POPUP_GET_VALUES_USER_BUTTON),
"??????? when you decide at field level whether the user-defined F4
"??????? help or the appropriate
"??????? Dictionary F4 help is to be called.
結(jié)果:
————
注意:
1、可以填充 fieldname 的類型有限。
2、注意 TABLE fields 參數(shù)的說明,已附在上面。
總結(jié)
以上是生活随笔為你收集整理的POPUP_GET_VALUES的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: POPUP_TO_DECIDE_WITH
- 下一篇: 实战LSMW