Get the F4 help of a fiel based on the avlue of another help For Mulitple selection Field(联动的搜索帮助)

原创 2015年11月19日 17:23:16

...

TABLES: tvko.
SELECT-OPTIONS: s_bukrs FOR tvko-bukrs,
                s_vkorg FOR tvko-vkorg.
*custom F4 help for Sales Org.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vkorg-low.
  PERFORM form_f4help_vkorg.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vkorg-high.
  PERFORM form_f4help_vkorg.

*&---------------------------------------------------------------------
*
*&      Form  form_f4help_vkorg
*&---------------------------------------------------------------------
*
*       text
*----------------------------------------------------------------------
*
FORM form_f4help_vkorg .

  DATA: BEGIN OF ty_vkorg,
          vkorg TYPE tvko-vkorg,
        END OF ty_vkorg.
  DATA: lt_dynpfields TYPE TABLE OF dynpread,
        ls_dynpfields TYPE dynpread,
        l_bukrs_low   TYPE tvko-bukrs,
        l_bukrs_high  TYPE tvko-bukrs,
        li_tab        LIKE TABLE OF ty_vkorg,
        li_ret       LIKE TABLE OF ddshretval.

  CLEAR: ls_dynpfields, lt_dynpfields.
  REFRESH: lt_dynpfields.

*1)Add the fields to be fetched from the screen to dynpread table.
  ls_dynpfields-fieldname = 'S_BUKRS-LOW'.
  APPEND ls_dynpfields TO lt_dynpfields.
  CLEAR: ls_dynpfields.
  ls_dynpfields-fieldname = 'S_BUKRS-HIGH'.
  APPEND ls_dynpfields TO lt_dynpfields.

*2)Fetch the values from the screen
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
    TABLES
      dynpfields           = lt_dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.

  READ TABLE lt_dynpfields INTO ls_dynpfields
                WITH KEY fieldname = 'S_BUKRS-LOW'.
  IF sy-subrc = 0.
    l_bukrs_low = ls_dynpfields-fieldvalue.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = l_bukrs_low
      IMPORTING
        output = l_bukrs_low.
  ENDIF.

  READ TABLE lt_dynpfields INTO ls_dynpfields
              WITH KEY fieldname = 'S_BUKRS-HIGH'.
  IF sy-subrc = 0.
    l_bukrs_high = ls_dynpfields-fieldvalue.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = l_bukrs_high
      IMPORTING
        output = l_bukrs_high.
  ENDIF.

*3)Select the data from the database table
  SELECT    vkorg  FROM  tvko INTO TABLE li_tab
        WHERE  bukrs  >= l_bukrs_low
          AND   bukrs <= l_bukrs_high.

*4) Display the data in the F4 help
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'VKORG'
      dynpprog        = sy-repid
      dynpnr          = '1000'
      dynprofield     = 'S_VKORG'
      window_title    = text-t01
      value_org       = 'S'
    TABLES
      value_tab       = li_tab
      return_tab      = li_ret
    EXCEPTIONS
      parameter_error = 1
      no_values_found
      =2
      OTHERS          = 3.


ENDFORM.                    " form_f4help_vkorg


 

F4 help functionality for a dynpro screen field using the PROCESS ON VALUE-REQUEST statement

Pressing the F4 button on a dynpro screen field brings up a list of possible values you can enter in...

Refreshing One Column based on the value of Another Column in ADFdi Table

Refreshing One Column based on the value of Another Column in ADFdi Table  原文地址:RefreshingOne Colum...

[SAP ABAP开发技术总结]搜索帮助Search Help (F4)

声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否...

Out of memory. Type HELP MEMORY for your options (

今天用Matlab跑程序,由于数据量太大,又出现 Out of memory. Type HELP MEMORY for your options.的问题。看到这篇文章非常实用,转过来方便查阅~ ...

MATLAB问题之Out of memory. Type HELP MEMORY for your options

今天运行MATOLAB程序时,遇到一个问题,提示“Out of memory. Type HELP MEMORY for your options.” 值得注意的是,出现这个错误提示,因为矩阵太大导致...

【help of Python】split

help(split) Help on function split in module numpy.lib.shape_base: split(ary, indices...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Get the F4 help of a fiel based on the avlue of another help For Mulitple selection Field(联动的搜索帮助)
举报原因:
原因补充:

(最多只允许输入30个字)