示例1.
DATA: LT_FIELDS TYPE STANDARD TABLE OF SVAL, LV_RC TYPE C. APPEND INITIAL LINE TO LT_FIELDS ASSIGNING FIELD-SYMBOL(<FS_VAL>). <FS_VAL>-FIELDNAME = ‘ZZOANAM‘. <FS_VAL>-TABNAME = ‘ZTSD_PCD_002‘. <FS_VAL>-FIELD_OBL = ‘X‘. <FS_VAL>-VALUE = SY-UNAME. CALL FUNCTION ‘POPUP_GET_VALUES‘ EXPORTING POPUP_TITLE = ‘流程发起人‘ IMPORTING RETURNCODE = LV_RC TABLES FIELDS = LT_FIELDS[].
展示效果:
示例2.
PERFORM FRM_GET_ZAPRD CHANGING <ITP03>-ZAPRD <ITP03>-ZAPRT.
*&---------------------------------------------------------------------*
*& Form FRM_GET_ZAPRD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_<ITAB>_ZAPRD text
* <--P_<ITAB>_ZAPRT text
*----------------------------------------------------------------------*
FORM FRM_GET_ZAPRD CHANGING P_ZAPRD TYPE ZAPRD
P_ZAPRT TYPE ZAPRT .
DATA : LT_VALUE LIKE TABLE OF SVAL WITH HEADER LINE ,
RETURNCODE .
LT_VALUE -TABNAME = ‘ZMT_P01‘ .
LT_VALUE -FIELDNAME = ‘ZAPRD‘ .
LT_VALUE - VALUE = SY -DATUM .
APPEND LT_VALUE .
LT_VALUE -TABNAME = ‘ZMT_P01‘ .
LT_VALUE -FIELDNAME = ‘ZAPRT‘ .
LT_VALUE - VALUE = SY -UZEIT .
APPEND LT_VALUE .
CALL FUNCTION ‘POPUP_GET_VALUES‘
EXPORTING
* NO_VALUE_CHECK = ‘ ‘
POPUP_TITLE = ‘审批日期选择‘
START_COLUMN = ‘5‘
START_ROW = ‘5‘
IMPORTING
RETURNCODE = RETURNCODE
TABLES
FIELDS = LT_VALUE
EXCEPTIONS
ERROR_IN_FIELDS = 1
OTHERS = 2 .
IF SY -SUBRC = 0 .
READ TABLE LT_VALUE WITH KEY FIELDNAME = ‘ZAPRD‘ .
IF SY -SUBRC = 0 .
P_ZAPRD = LT_VALUE - VALUE .
ENDIF .
READ TABLE LT_VALUE WITH KEY FIELDNAME = ‘ZAPRT‘ .
IF SY -SUBRC = 0 .
P_ZAPRT = LT_VALUE - VALUE .
ENDIF .
ENDIF .
ENDFORM.
PERFORM FRM_GET_ZAPRD CHANGING <ITP03>-ZAPRD <ITP03>-ZAPRT.
*&---------------------------------------------------------------------*
*& Form FRM_GET_ZAPRD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_<ITAB>_ZAPRD text
* <--P_<ITAB>_ZAPRT text
*----------------------------------------------------------------------*
FORM FRM_GET_ZAPRD CHANGING P_ZAPRD TYPE ZAPRD
P_ZAPRT TYPE ZAPRT .
DATA : LT_VALUE LIKE TABLE OF SVAL WITH HEADER LINE ,
RETURNCODE .
LT_VALUE -TABNAME = ‘ZMT_P01‘ .
LT_VALUE -FIELDNAME = ‘ZAPRD‘ .
LT_VALUE - VALUE = SY -DATUM .
APPEND LT_VALUE .
LT_VALUE -TABNAME = ‘ZMT_P01‘ .
LT_VALUE -FIELDNAME = ‘ZAPRT‘ .
LT_VALUE - VALUE = SY -UZEIT .
APPEND LT_VALUE .
CALL FUNCTION ‘POPUP_GET_VALUES‘
EXPORTING
* NO_VALUE_CHECK = ‘ ‘
POPUP_TITLE = ‘审批日期选择‘
START_COLUMN = ‘5‘
START_ROW = ‘5‘
IMPORTING
RETURNCODE = RETURNCODE
TABLES
FIELDS = LT_VALUE
EXCEPTIONS
ERROR_IN_FIELDS = 1
OTHERS = 2 .
IF SY -SUBRC = 0 .
READ TABLE LT_VALUE WITH KEY FIELDNAME = ‘ZAPRD‘ .
IF SY -SUBRC = 0 .
P_ZAPRD = LT_VALUE - VALUE .
ENDIF .
READ TABLE LT_VALUE WITH KEY FIELDNAME = ‘ZAPRT‘ .
IF SY -SUBRC = 0 .
P_ZAPRT = LT_VALUE - VALUE .
ENDIF .
ENDIF .
ENDFORM.
————————————————
版权声明:本文为CSDN博主「SAP剑客」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhongguomao/article/details/71268380