ABAP F4帮助联动的实现方法

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
WINDOW_TITLE = '工厂检索'
TABLES
VALUE_TAB = T_T001W
RETURN_TAB = RET_ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
DATA: BEGIN OF T_T024I OCCURS 0 ,
IWERK TYPE T024I-IWERK,
INGRP TYPE T024I-INGRP,
INNAM TYPE T024I-INNAM,
END OF T_T024I.
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " FORM_IWERK_HIGH
*&---------------------------------------------------------------------*
* 通过内表建立F4帮助
*----------------------------------------------------------------------*
FORM FORM_IWERK_HIGH .
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_IWERK-HIGH'.
*& ห้องสมุดไป่ตู้ 工厂的搜索帮助
*&----------------------------------------------------------------------*
*& F4只可以选择不可以输入,与S_INGPR-low联动
*& S_IWERk的选择内容直接影响S_INGPR中F4的内容
SELECT WERKS NAME1 FROM T001W INTO CORRESPONDING FIELDS OF TABLE T_T001W.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS' "选择后显示的字段
MODIFY SCREEN.
ENDIF.
ENDLOOP.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT1.
SELECT-OPTIONS S_IWERK FOR AUFK-WERKS OBLIGATORY. "工厂
SELECT-OPTIONS S_AUFNR FOR AUFK-AUFNR . "订单编号
*& Form FORM_INGPR
*&---------------------------------------------------------------------*
* 计划员组的搜索帮助
*----------------------------------------------------------------------*
DATA:BEGIN OF T_CONDITION_SQL OCCURS 0,
CONDITION(80),
END OF T_CONDITION_SQL.
DATA RET_ITAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
DYNPPROG = SY-REPID "程序名
DYNPNR = SY-DYNNR "屏幕号
DYNPROFIELD = 'S_IWERK' "屏幕上需要检索help的控件名称
VALUE_ORG = 'S'
CLEAR T_CONDITION_SQL. CLEAR T_CONDITION_SQL[].
* 注意SQL的用法,与S_IWERK联动
*----------------------------------------------------------------------*
FORM FORM_INGPR .
CLEAR T_T024I.CLEAR T_T024I[].
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_IWERK-LOW.
PERFORM FORM_IWERK_LOW.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
OTHERS = 3.
S_IWERK-HIGH = RET_ITAB-FIELDVAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_IWERK-HIGH'.
SCREEN-INPUT = '0'.
SCREEN-INPUT = '1'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
CLEAR T_T001W. CLEAR T_T001W[].
CLEAR RET_ITAB.CLEAR RET_ITAB[].
*&---------------------------------------------------------------------*
*& Form FORM_IWERK
*&---------------------------------------------------------------------*
DYNPPROG = SY-REPID "程序名
DYNPNR = SY-DYNNR "屏幕号
DYNPROFIELD = 'S_IWERK' "屏幕上需要检索help的控件名称
VALUE_ORG = 'S'
WINDOW_TITLE = '工厂检索'
TABLES
VALUE_TAB = T_T001W
RETURN_TAB = RET_ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_IWERK-HIGH.
PERFORM FORM_IWERK_HIGH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_INGPR-LOW.
PERFORM FORM_INGPR.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'S_IWERK-HIGH'.
SCREEN-INPUT = '0'.
**F4帮助的联动
TABLES: AUFK, AFIH, T001W.
DATA: BEGIN OF T_T001W OCCURS 0 ,
WERKS TYPE T001W-WERKS,
NAME1 TYPE T001W-NAME1,
END OF T_T001W.
*&---------------------------------------------------------------------*
* 工厂的搜索帮助
*----------------------------------------------------------------------*
SELECT-OPTIONS S_AUART FOR AUFK-AUART. "订单类型
SELECT-OPTIONS S_INGPR FOR AFIH-INGPR OBLIGATORY. "计划人员组
SELECT-OPTIONS S_ERDAT FOR AUFK-ERDAT. "创建日期
*&----------------------------------------------------------------------*
FORM FORM_IWERK_LOW .
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_IWERK-LOW'.
SELECT WERKS NAME1 FROM T001W INTO CORRESPONDING FIELDS OF TABLE T_T001W.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'WERKS' "选择后显示的字段
OTHERS = 3.
S_IWERK-LOW = RET_ITAB-FIELDVAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_IWERK-LOW'.
SCREEN-INPUT = '0'.
SCREEN-OUTPUT = '1'.
SELECTION-SCREEN END OF BLOCK BLOCK1.
INITIALIZATION.
TEXT1 = '选择屏幕'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'S_IWERK-LOW'.
ENDIF.
ENDFORM. " FORM_IWERK
*&---------------------------------------------------------------------*
*& Form FORM_IWERK_HIGH
SCREEN-INPUT = '1'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
CLEAR T_T001W. CLEAR T_T001W[].
CLEAR RET_ITAB.CLEAR RET_ITAB[].
相关文档
最新文档