ABAP--如何使用'F4IF_INT_TABLE_VALUE_REQUEST'填写屏幕的多个字段

来源:互联网 发布:网络用语dt什么意思 编辑:程序博客网 时间:2024/06/10 07:21

样例屏幕
 

1定义输入帮助处理
PROCESS ON VALUE-REQUEST.
 FIELD ACTIVE_SZKART MODULE YCURVE_VALUE_REQUEST.
 FIELD ACTIVE_WWAER MODULE YCURVE_VALUE_REQUEST.
 FIELD ACTIVE_DKOND MODULE YCURVE_VALUE_REQUEST.
2编写YCURVE_VALUE_REQUEST module代码
module ycurve_value_request input.
* Dieses Modul wird bei F4 auf szkart, wwaer oder dkond ausgefrt und
* liefert eine Liste der selektierten Zinskurven.
 data: return_tab like ddshretval occurs 1 with header line,
        field_tab like dfies occurs 1 with header line,
        dynpfields like dynpread occurs 3 with header line.
 call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            ddic_structure   = 'JBIZKARTLIST'
            retfield         = 'ACTIVE_SZKART'
            dynpprog        = 'SAPLJBYCDETAIL'
            dynpnr           = '1000'
            dynprofield      = 'X'     "Felder aufs Dynpro zurkstellen
            window_title     = text-003
            value_org        = 'S'
            callback_program = 'SAPLJBYCDETAIL'
            callback_form    = 'BO_CALLBACK_FORM'
       tables
            value_tab        = selected_zkartlist
            field_tab        = field_tab
            return_tab       = return_tab
       exceptions
            parameter_error = 1
            no_values_found = 2
            others           = 3.
 if sy-subrc eq 0.
*   read table selected_zkartlist with key szkart = active_szkart
*                                            wwaer = active_wwaer
*                                            dkond = active_dkond.
*   move sy-tabix to active_index.
* Aktualisiere die Table Control-Daten f das Tab Strip
*   perform bo_data_transfer_for_tab_strip.
 endif.
endmodule.                             " YCURVE_VALUE_REQUEST INPUT
3.编写回调函数BO_CALLBACK_FORM代码
注意红色代码块,那里定义了返回三个字段并填写到操作屏幕
form bo_callback_form
      tables   record_tab structure seahlpres
      changing shlp type shlp_descr_t
               callcontrol like ddshf4ctrl.
 data: interface like line of shlp-interface,
        fp like line of shlp-fieldprop.
 clear interface.
 clear fp.
 fp-shlpoutput = 'X'.
 modify shlp-fieldprop from fp transporting shlpoutput
          where shlpoutput = space.
 interface-shlpfield = 'SZKART'.
 interface-valfield = 'ACTIVE_SZKART'.
 append interface to shlp-interface.
 interface-shlpfield = 'WWAER'.
 interface-valfield = 'ACTIVE_WWAER'.
 append interface to shlp-interface.
 interface-shlpfield = 'DKOND'.
 interface-valfield = 'ACTIVE_DKOND'.
 append interface to shlp-interface.
 
endform.                               " BO_CALLBACK_FORM
代码摘自sapSAPLJBYCDETAIL





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


原创粉丝点击