关于search help Exit和样例

SE11创建search help (带search help exit function ) 碰到一个需求需要到新建一个help view做search,但是发现结果有很多重复项,所以决定做一个exit function做一下去重。 首先需要copy一个函数模板,(F4IF_SHLP_EXIT_EXAMPLE ) 首先function会在何时调用,又是怎么通过 参数 控制呢。 1)、before displaying the dialog box for selecting the required search path,(只是在collective search help才会使用); . 阅读详情

1、 search help Exit是用于对标准帮助进行扩充,以提供更好的灵活性。

2、search help Exit何时被调用

Before Displaying the Dialog Box for Selecting the Required Search Path.

It is only called for collective search helps. Using the search help exit, the set of elementary search helps available can for example be restricted depending on the context.

Before Starting the F4 Process for the Elementary Search Help

The call is triggered independent of whether the dialog window for entering the search conditions appears or whether the selection is executed immediately (for example, because in the Hot key of the elementary search help Immediate value display is set).

Before Displaying the Dialog Box for Entering Search Conditions.

You can either influence the dialog for entering search conditions or skip it altogether here. You can also influence how the selection screen looks. The call is triggered only if there is no direct selection (that is, if in the Hot key of the elementary search help Immediate value display is not set).

Before Selecting Data.

The data selection can be partly or completely copied from the search help exit. This can become necessary if the data selection cannot be implemented with a SELECT statement for a table or a view.

Before Displaying the Hit List.

You can influence the display of the hit list in this step with the search help exit. You can reduce the number of values displayed here. For example, you can display only values for which the person calling the input help has authorization. You can also copy the complete hit list from the search help exit.

Before Returning the Values Selected by the User to the Input Template.

It could be advisable to intervene at this time if control of the further transaction flow should depend on the value selected. A typical example is setting set/get parameters.

3、search help Exit的函数模板(F4IF_SHLP_EXIT_EXAMPLE )程序员就可以拷贝该函数进行改编,已达到适合自己企业的应用。
function f4if_shlp_exit_example.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCT
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(SHLP) TYPE  SHLP_DESCR
*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
*"----------------------------------------------------------------------

* EXIT immediately, if you do not want to handle this step
  if callcontrol-step <> 'SELONE' and
     callcontrol-step <> 'SELECT' and
     " AND SO ON
     callcontrol-step <> 'DISP'.
     exit.
  endif.

*"----------------------------------------------------------------------
* STEP SELONE  (Select one of the elementary searchhelps)
*"----------------------------------------------------------------------
* This step is only called for collective searchhelps. It may be used
* to reduce the amount of elementary searchhelps given in SHLP_TAB.
* The compound searchhelp is given in SHLP.
* If you do not change CALLCONTROL-STEP, the next step is the
* dialog, to select one of the elementary searchhelps.
* If you want to skip this dialog, you have to return the selected
* elementary searchhelp in SHLP and to change CALLCONTROL-STEP to
* either to 'PRESEL' or to 'SELECT'.
  if callcontrol-step = 'SELONE'.
*   PERFORM SELONE .........
    exit.
  endif.

*"----------------------------------------------------------------------
* STEP PRESEL  (Enter selection conditions)
*"----------------------------------------------------------------------
* This step allows you, to influence the selection conditions either
* before they are displayed or in order to skip the dialog completely.
* If you want to skip the dialog, you should change CALLCONTROL-STEP
* to 'SELECT'.
* Normaly only SHLP-SELOPT should be changed in this step.
  if callcontrol-step = 'PRESEL'.
*   PERFORM PRESEL ..........
    exit.
  endif.
*"----------------------------------------------------------------------
* STEP SELECT    (Select values)
*"----------------------------------------------------------------------
* This step may be used to overtake the data selection completely.
* To skip the standard seletion, you should return 'DISP' as following
* step in CALLCONTROL-STEP.
* Normally RECORD_TAB should be filled after this step.
* Standard function module F4UT_RESULTS_MAP may be very helpfull in this
* step.
  if callcontrol-step = 'SELECT'.
*   PERFORM STEP_SELECT TABLES RECORD_TAB SHLP_TAB
*                       CHANGING SHLP CALLCONTROL RC.
*   IF RC = 0.
*     CALLCONTROL-STEP = 'DISP'.
*   ELSE.
*     CALLCONTROL-STEP = 'EXIT'.
*   ENDIF.
    exit. "Don't process STEP DISP additionally in this call.
  endif.
*"----------------------------------------------------------------------
* STEP DISP     (Display values)
*"----------------------------------------------------------------------
* This step is called, before the selected data is displayed.
* You can e.g. modify or reduce the data in RECORD_TAB
* according to the users authority.
* If you want to get the standard display dialog afterwards, you
* should not change CALLCONTROL-STEP.
* If you want to overtake the dialog on you own, you must return
* the following values in CALLCONTROL-STEP:
* - "RETURN" if one line was selected. The selected line must be
*   the only record left in RECORD_TAB. The corresponding fields of
*   this line are entered into the screen.
* - "EXIT" if the values request should be aborted
* - "PRESEL" if you want to return to the selection dialog
* Standard function modules F4UT_PARAMETER_VALUE_GET and
* F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step.
  if callcontrol-step = 'DISP'.
*   PERFORM AUTHORITY_CHECK TABLES RECORD_TAB SHLP_TAB
*                           CHANGING SHLP CALLCONTROL.
    exit.
  endif.
endfunction.

4、样例代码(参考sap的实例SFLIGHT)
SFLIGHT(SE11)中设置了search help exit SAPBC_GLOBAL_F4_SFLIGHT 。代码如下:

function sapbc_global_f4_sflight.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCT
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(SHLP) TYPE  SHLP_DESCR
*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
*"----------------------------------------------------------------------
* The scope of this search help exit is decribed in the documentation.
* Note that SAPBC_GLOBAL_F4_SFLIGHT_MIN_FR provides a more complex
* example of a serch help exit.

data: begin of seatinfo occurs 0,                " parallel table to
            seatsmax type sflight-seatsmax,      " record_tab containing
            seatsocc type sflight-seatsocc,      " the information about
            seatsfre type s_seatsfre,            " the seats
      end of seatinfo.

if callcontrol-step = 'SELECT'.
* The search help parameters SEATSMAX and SEATSOCC are not displayed on
* the list of possible entries. Hence, provided they are not connected
* to dynpro fields, the F4 processor might consider it not to be
* necessary to select the contents of these fields.
* But this exit needs these contents in order to compute the number of
* free seats. Thus, the space for this contents is allocated by the
* following two calls. This automatically forces the F4 processor to
* fill this space with the contents of these fields.
   call function 'F4UT_PARAMETER_ALLOCATE'
        exporting
             parameter         = 'SEATSMAX'
        tables
             shlp_tab          = shlp_tab
             record_tab        = record_tab
        changing
             shlp              = shlp
             callcontrol       = callcontrol.
   call function 'F4UT_PARAMETER_ALLOCATE'
        exporting
             parameter         = 'SEATSOCC'
        tables
             shlp_tab          = shlp_tab
             record_tab        = record_tab
        changing
             shlp              = shlp
             callcontrol       = callcontrol.
endif.

check callcontrol-step = 'DISP'.

* This Exit only has to do something before the list of possible values
* is displayed. At that moment it has to compute the number of free
* seats for each row and attach it to the result of the selection
* process

* First fill the seatsmax-Info from the selected data. Note that there
* are two ways of using F4UT_PARAMETER_VALUE_GET described in the
* documetation of that function module. Here the second one is used.
call function 'F4UT_PARAMETER_VALUE_GET'
     exporting
          parameter         = 'SEATSMAX'
                                    " Reference to search help parameter
          fieldname         = 'SEATSMAX'
                                    " Reference to field of Seatinfo
     tables
          shlp_tab          = shlp_tab
          record_tab        = record_tab
          results_tab       = seatinfo
     changing
          shlp              = shlp
          callcontrol       = callcontrol.

* Now do the same with the seatsocc-Info:
call function 'F4UT_PARAMETER_VALUE_GET'
     exporting
          parameter         = 'SEATSOCC'
                                    " Reference to search help parameter
          fieldname         = 'SEATSOCC'
                                    " Reference to field of Seatinfo
     tables
          shlp_tab          = shlp_tab
          record_tab        = record_tab
          results_tab       = seatinfo
     changing
          shlp              = shlp
          callcontrol       = callcontrol.

* Now compute the number of free seats:
loop at seatinfo.
     if seatinfo-seatsocc < seatinfo-seatsmax.
        seatinfo-seatsfre = seatinfo-seatsmax - seatinfo-seatsocc.
     else.
          clear seatinfo-seatsfre.
     endif.
     modify seatinfo transporting seatsfre.
endloop.

* Finally transport the computed numbers into the search help data.
call function 'F4UT_PARAMETER_RESULTS_PUT'
     exporting
          parameter         = 'SEATSFRE'
                                    " Reference to search help parameter
          fieldname         = 'SEATSFRE'
                                    " Reference to field of Seatinfo
     tables
          shlp_tab          = shlp_tab
          record_tab        = record_tab
          source_tab        = seatinfo
     changing
          shlp              = shlp
          callcontrol       = callcontrol.
endfunction.
具体处理流程如图:



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1492229


ABAP--一个实现Search Help Exits的完整样例 阅读详情

相关推荐

什么是 ABAP Search Help Exit

增强灵活性:标准的 Search Help 提供了固定的数据集,而 Search Help Exit 则赋予了开发人员根据业务需求调整数据集的能力。例如,根据用户的部门动态调整可以选择的客户,从而实现更加个性化的数据选择。提高数据准确性:通过 Search Help Exit,可以根据上下文对用户输入进行引导,确保用户只能选择与当前业务场景匹配的数据。例如,在采购模块中,可以通过 Search Help Exit 限制用户只能选择特定物料类型的供应商,从而减少错误。改善用户体验。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 562

ABAP SE11 搜索帮助增强(出口) search help exit(一)2021

ABAP SE11 SEACH HELP EXIT 1.SEACH HELP EXIT 是什么? SEACH HELP EXIT是一个函数模块,用来使搜索帮助描述的输入帮助处理与可能的标准版本的处理比较起来更为灵活。 2. 使用场景 SE11创建搜索帮助需要过滤数据,例如只显示某一公司代码的数据、只显示某一状态的数据。 3.SEACH HELP EXIT怎么用? <1>复制标准函数F4IF_SHLP_EXIT_EXAMPLE 不同的搜索帮助类型,代码实现的步骤不相同,可参见F

xunmeng07的博客 2767

ABAP:自定义搜索帮助:可参考标准函数F4IF_SHLP_EXIT_EXAMPLE

2.选择参考表,因为这里分销渠道和文本来源于TVTWT,这里选择方法就填入TVTWT,对话类型选择D立即显示值,就是点击即可出现结果。参数和预定义函数一致,这里我们调用‘SELECT’这个时间点来进行数据的查询输出,自定义的帮助出口函数中的具体代码如下。搜索帮助出口:需要我们自定义一个函数,可复制标准函数:F4IF_SHLP_EXIT_EXAMPLE去创建。因为我这里是全部输出系统当前语言的分销渠道,所以这里的搜索没有去做限制,也可以更具具体情况去限制。"将查询结果回执到屏幕上来。"根据输入参数查询数据。

weixin_43734184的博客 1763

关于search help Exit和样例收藏(from Jack Wu)

关于search help Exit和样例收藏(from Jack Wu) 1、search help Exit是用于对标准帮助进行扩充,以提供更好的灵活性。 2、search help Exit...

cishai0841的博客 229

SAP 财务BAPI_ACC_DOCUMENT_POST批导的税务tax

最近遇到了关于SAP财务凭证批导要bapi:BAPI_ACC_DOCUMENT_POST增加税的功能要求,查阅了一众文献发现都不尽如人意,所以想着自己写一个趟过的雷吧。 一般前台sap的凭证是有自动计算税码的勾选框的,但是bapi却并没有这个字段。 实际操作过程中1.可以定义一个税额的结构,参考bapiactx09 2.在会计分录上传如果需要增加税码的时候,譬如总账gl,需要对应tax_code 3.通过CALCULATE_TAX_FROM_GROSSAMOUNT 计算出税额和acct_k...

qq_35640448的博客 3191

【学习体会】Lighttools8.4.0:软件基本使用+光度学基本概念+系统初始设置

关于Lighttools8.4.0软件的安装教程,详见我的另一篇博文:【软件安装】win10下Lighttools8.4.0(64)光学系统建模软件的安装教程 在本文中,我们将学习到,光度学的基本概念、系统初始设置、物体模型坐标的使用方法、简单光学系统实例、系统浏览器的作用和内容、设置虚拟相机并渲染视图中的图像、仿真结果3D显示等。 如果有其他感兴趣的内容但是我又没有写的,欢迎在评论区留言! 光度学的基本概念 软件的基本介绍 参考博文:https://www.docin.c...

LeonJin的博客 2万+

Search Help EXIT

表ZARA001T里有数据。但是我们通过SEARCH HELP 只显示一部分数据。 只显示NAME以B开头的数据。 我们可以用EXIT来处理。 表的数据: 首先我们复制这个表结构,生成一个新的表ZARA003T。 这个表示空表,没有数据的。 创建搜索帮助Z_F4_002 如下填写,一定要填写空表 ZARA003T 然后我们去创建EXIT函数。

小峰的ABAP博客 1820

STM32CubeMX安装避坑指南:为什么你的Java环境总是报错?

本文针对STM32CubeMX安装过程中最常见的Java环境报错问题,提供了一套完整的诊断与解决方案。文章深入剖析了JRE版本冲突、环境变量配置错误、路径权限等核心原因,并给出了从系统级检查到手动修正环境变量的详细步骤,帮助开发者彻底解决安装难题,顺利开启STM32开发之旅。

prometheus9mon的博客 228

关于SAP F4 Search Help Exit Module

1.机能作用SearchHelp Exit是用于对标准帮助进行扩充,以便与更加灵活的使用.2.使用场合标准的Search Help其本身就可以进行一些简单的动态表示设定,比如:对选择条件的初期值进行设定(固定值,SAP Memory params(BUK)等.但是,比如选择条件并非是DB字段的话,就需要用SearchHelp Exit Module进...

weixin_30591551的博客 205

matlab液体湿润模拟,【水文模型】01 三水源新安江模型

目录一、概述1.1 流域概况1.2 产流方式论证1.3 设计基本任务1.4 设计原始资料二、新安江模型2.1 流域划分2.2 产汇流计算2.2.1 蒸散发计算2.2.2 产流计算2.2.3 水源划分2.2.4 汇流计算2.3 模型参数2.3.1 参数物理意义2.3.2 参数率定结果2.4 模拟结果2.4.1 精度统计表2.4.2 计算与实测流量过程线比较三、精度统计与误差分析3.1 精度统计3.2...

weixin_34173656的博客 5330

Calibre电子书阅读器个性化样式定制指南

本文详细介绍了如何通过Calibre电子书阅读器的用户样式表功能进行深度个性化样式定制。从修改全局字体、行距、背景配色(包括深色/浅色模式)到美化代码块、引用等特殊元素,本指南提供了完整的CSS代码示例与实战技巧,帮助用户打造专属的舒适阅读环境,显著提升电子书阅读体验。

vv45678的博客 927

两种Search Help的合并使用 : Database View + Search Help Exit

案例:要在As03的Aseet number的Search help中加一些自定义的字段进行查找,自定义的字段在A表NLU中,可以通过将表ANLA和ANLU合并做成一个VIEW来实现,但有2个查找字段Actual NBV(NBVA)和Estimation NBV(NBVE)不存在任何一个表中,是通过表ANLC计算出来的,这里就得要通过Search Help Exit来实现

Felix 常温20度- abap/fico 7713

硅基半导体量子点:单电子自旋量子比特技术手册

现在我们已经了解了从硅片到容错计算的全部环节,让我们用一张总览图把碎片拼成完整拼图。fill:#333;important;important;fill:none;color:#333;color:#333;important;fill:none;fill:#333;height:1em;important;important;important;color:#000!important;important;important;important;important;color:#000!

VectorShift的博客 376

Search help 相关的信息

1. http://blog.sina.com.cn/s/blog_4c66402b0100ukbt.html 

1115

文本分析-使用jieba库进行中文分词和去除停用词(附案例实战)

本文将手把手教会你使用jieba库进行中文分词和去除停用词,这是学会文本分析的必经之路!

m0_64336780的博客 4万+

RK3568笔记九十四:基于QT的YOLOV5目标检测

基于RK3568平台的实时目标检测应用,使用YOLOv5模型和RKNN推理引擎实现摄像头实时目标检测,并通过Qt界面显示检测结果。主要功能实时摄像头目标检测:从摄像头获取视频流,使用YOLOv5模型进行目标检测RKNN推理加速:利用RK3568内置的NPU进行模型推理加速图形界面显示:使用Qt框架构建用户界面,实时显示检测结果RGA图像处理:使用Rockchip Graphic Accelerator进行图像缩放处理。

527

ABAP SEARCH HELP ii

当database view作为search help的selection method时,数据之间的选择是inner join,某些情况下不能满足需求,此时可以通过建立help view来实现outer join。Help view的定义同maintenance view差不多。Help view以H_开始,这样H_Y和H_Z就在客户的命名空间中。可以通过default value为search

lvzhqi的专栏 1297

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

ABAP search help 删除重复的数据

Se11中创建的 search help界面 -> Selection method为 要读取的对象数据库表, 读取表中的组织代码和组织文本信息 -> search help exit 中处理要输出的查询数据, ZEH_LXSECOND 为创建的函数模块 2 . 函数 ZEH_LXSECOND 中,只需填写 changing 和 表 的信息, 填写如下,然后source code中写入处理的代码 ...

ABAP在路上 977

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

上一篇: 关于SAP的事务提交和回滚(LUW)
下一篇: 如何是SELECTION屏幕输入框变成密码输入框
techweb
博客等级 码龄19年 226粉丝 3842原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值