SAP HR ABAP 选择屏幕常用操作



 

************************************************************************************* 对象字段结构化搜索帮助

at selection-screen on value-request for p_objid.
  perform f_help_objid_single using 'S' '' '' '' 'P_OBJID' 'F_AUTHORITY_CHECK'.

 

form f_help_objid_single using i_otype
                                i_rsign
                                i_relat
                                i_sclas
                                i_fieldname
                                i_form.
  data: lw_objec type objec.

  field-symbols: <fs_field> type any.
  call function 'RH_OBJID_REQUEST'
    exporting
      plvar           = '01'
      otype           = i_otype
      seark_begda     = sy-datum
      seark_endda     = sy-datum
      dynpro_repid    = sy-repid
      dynpro_dynnr    = sy-dynnr
      callback_prog   = sy-repid
      callback_form   = i_form
      without_rsign   = i_rsign
      without_relat   = i_relat
      without_sclas   = i_sclas
    importing
      sel_object      = lw_objec
    exceptions
      cancelled       = 1
      wrong_condition = 2
      nothing_found   = 3
      internal_error  = 4
      illegal_mode    = 5
      others          = 6.

  assign (i_fieldname) to <fs_field>.
  <fs_field> = lw_objec-objid.
endform.


form f_authority_check tables t_objects structure hrobject.
  loop at t_objects.
    call function 'RH_STRU_AUTHORITY_CHECK'
      exporting
        plvar                    = '01'
        otype                    = 'S'
        objid                    = t_objects-objid
      exceptions
        no_stru_authority        = 1
        no_stru_authority_hyper  = 2
        no_stru_authority_at_all = 3
        no_base_authority        = 4
        others                   = 5.
    if sy-subrc ne 0.
      delete t_objects.
    endif.
  endloop.
endform.

 

************************************************************************************* 字段自定义列表搜索帮助

data: lt_ret type standard table of ddshretval,
          lw_ret like line of lt_ret.

at selection-screen on value-request for p_pernr.
  perform f_pernr_f4.

form f_pernr_f4.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield             = 'PERNR'
      dynpprog        = sy-repid
      dynpnr             = sy-dynnr
      dynprofield     = 'P_PERNR'
      value_org       = 'S'
      callback_program = sy-repid
    tables
      value_tab        = gt_bcpr               "自定义内表,包含字段 PERNR
      return_tab       = lt_ret
    exceptions
      parameter_error  = 1
      no_values_found  = 2
      others           = 3.

  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

  if lt_ret is not initial.
    read table lt_ret into lw_ret index 1.
    p_pernr = lw_ret-fieldval.
  endif.

endform.

 

************************************************************ 字段下拉框搜索帮助

parameters p_khdx like p9500-zzhrkhlx obligatory as listbox visible length 20 default '0002'.     "考核对象   

data: gt_val type vrm_values,
      gw_val like line of gt_val.
define m_append_vrm_values.
  gw_val-key  = &1.
  gw_val-text = &2.
  append gw_val to gt_val.
  clear: gw_val.
end-of-definition.

at selection-screen output.
  perform f_mod_screen.

form f_mod_screen.
  refresh gt_val.
  m_append_vrm_values '0002' '0002文本'.
  m_append_vrm_values '0005' '0005文本'.
  call function 'VRM_SET_VALUES'
    exporting
      id     = 'P_KHDX'
      values = gt_val.
endform.

 

**********************************************************隐藏逻辑数据库时间区间

at selection-screen output.
  perform f_mod_screen.

form f_mod_screen.
  loop at screen.
    if screen-group1 = 'R2' or
       screen-group1 = 'R3' or
       screen-group1 = 'R4' or
       screen-group1 = 'R5' or
       screen-name = '%_P_PERIOD_%_APP_%-TEXT'.
      screen-active = '0'.
    endif.
    modify screen.
  endloop.

  loop at screen.
    if screen-name cs 'PNPBEGDA' or
       screen-name cs 'PNPENDDA' or
       screen-name cs 'PNPTIMR1' or
       screen-name cs 'PNPTIMR6' or
       screen-name cs '%FBIS111_1000' or
       screen-name cs 'PNPTBEG'  or
       screen-name cs 'PNPBLCKT' or
       screen-name cs 'PNPTIMR2' or
       screen-name cs 'PNPTIMR3' or
       screen-name cs 'PNPTIMR4' or
       screen-name cs 'PNPTIMR5' or
       screen-name cs '%FBIS112_1000' or
       screen-name cs '%FDPS117_1000' or
       screen-name cs 'PNPBEGPS'  or
       screen-name cs '%FBIS120_1000' or
       screen-name cs 'PNPENDPS'.
      screen-active = '0'.
      modify screen.
    endif.
  endloop.
endform.

 

******************************************************设置逻辑数据库选择屏幕标准字段默认值

initialization.
  perform f_init_screen.

form f_init_screen.
  pnpstat2-low    = '3'.
  pnpstat2-sign   = 'I'.
  pnpstat2-option = 'EQ'.
  append pnpstat2.

  pnptimed = 'M'.
endform

.

 

******************************************************自定义选择区域常用语法

selection-screen begin of block b1 with frame title text-001.
selection-screen begin of line.
selection-screen comment 1(10) text-t01 for field p_year.  "p1_begda 文字描述
parameters: p_year(4) type c .
selection-screen position 21.
selection-screen comment 25(7) text-t02 for field p_month. "p1_endda 文字描述
parameters:  p_month(2)  type c .
selection-screen end of line.
*parameters: p_conar type t7cn25-conar.
select-options: p_conar for t7cn25-conar no intervals.
selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-001.
parameters: r_mx radiobutton group r1 default 'X',
            r_hz radiobutton group r1.
selection-screen end of block b2.

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值