欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

F4IF_INT_TABLE_VALUE_REQUEST如何返回多于一个列

程序员文章站 2022-06-01 15:13:59
...

SPAN {
font-family: “Courier New”;
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

READ TABLE gt_list_00040 INTO gs_list_00040 INDEX ps_es_row_no-row_id.

      IF gs_list_00040-cwtz <> 'B' OR  gs_list_00040-qrzt = 'X'.

        EXIT.

      ENDIF.



      CALL FUNCTION 'ZFM_TR_GET_F4_FIELD'

        EXPORTING

          i_tabname = 'ZTRSUS_F4_YYHTH'

          i_langu   = sy-langu

        TABLES

          t_dfies   = lt_dfies_tab.

定义结构 ZTRSUS_F4_HTH位搜索帮助要展示那些字段及类型描述等,
F4IF_INT_TABLE_VALUE_REQUEST如何返回多于一个列

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

        EXPORTING
  •         DDIC_STRUCTURE   = 'ZTRSUS_F4_HTH'
    
            retfield         = 'HTH'
    
            dynpprog         = sy-repid
    
            dynpnr           = sy-dynnr
    
            window_title     = text-t39 "'合同号'
    
            value_org        = 'S'
    
            callback_program = sy-repid
    
            callback_form    = 'CB_YYHKHTH'
    
          TABLES
    
            field_tab        = lt_dfies_tab
    
            value_tab        = gt_ztrsus_f4_yyhth[]
    
            return_tab       = lt_return_yyhth[].
    
    
    
        CHECK lt_return_yyhth[] IS NOT INITIAL
        READ TABLE lt_return_yyhth INTO ls_return_hth_1 INDEX 1.
    
        READ TABLE lt_return_yyhth INTO ls_return_hth_2 INDEX 2.
    
        READ TABLE lt_return_yyhth INTO ls_return_hth_3 INDEX 3.
    
        READ TABLE lt_return_yyhth INTO ls_return_hth_4 INDEX 4.
    
        READ TABLE lt_return_yyhth INTO ls_return_hth_5 INDEX 5.
    
        READ TABLE lt_return_yyhth INTO ls_return_hth_6 INDEX 6.
    

定义一个form 为上边函数的 callback_form参数用

SPAN {
font-family: “Courier New”;
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

FORM cb_yyhkhth TABLES record_tab STRUCTURE seahlpres

             CHANGING shlp TYPE shlp_descr_t

                      callcontrol LIKE ddshf4ctrl.

DATA: interface LIKE LINE OF shlp-interface.



DATA: lt_dfies_tab LIKE TABLE OF dfies .

DATA: ls_dfies_tab LIKE  dfies .



CALL FUNCTION 'ZFM_TR_GET_F4_FIELD'

  EXPORTING

    i_tabname = 'ZTRSUS_F4_YYHTH'

    i_langu   = sy-langu

  TABLES

    t_dfies   = lt_dfies_tab.



READ TABLE shlp-interface INTO interface INDEX 1.



LOOP AT lt_dfies_tab INTO ls_dfies_tab .

  interface-shlpfield = ls_dfies_tab-fieldname.

  interface-valfield = ls_dfies_tab-fieldname.

  APPEND interface TO shlp-interface.

  CLEAR:interface.

ENDLOOP.

ENDFORM. "bo_cal

SPAN {
font-family: “Courier New”;
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

FUNCTION ZFM_TR_GET_F4_FIELD.

*"----------------------------------------------------------------------

""局部接口:

*"  IMPORTING

*"     VALUE(I_TABNAME) TYPE  DDOBJNAME OPTIONAL

*"     VALUE(I_LANGU) TYPE  LANGU OPTIONAL

*"  TABLES

*"      T_DFIES STRUCTURE  DFIES OPTIONAL

*"----------------------------------------------------------------------

DATA: LS_DFIES_TAB LIKE  DFIES .

CHECK I_TABNAME IS NOT INITIAL.

CALL FUNCTION ‘DDIF_FIELDINFO_GET’

EXPORTING

TABNAME        = I_TABNAME

TABLES

DFIES_TAB      = T_DFIES

*     FIXED_VALUES   =

EXCEPTIONS

NOT_FOUND      = 1

INTERNAL_ERROR = 2

OTHERS         = 3.

LOOP AT T_DFIES INTO LS_DFIES_TAB.

LS_DFIES_TAB-REPTEXT =  LS_DFIES_TAB-FIELDTEXT.

LS_DFIES_TAB-OUTPUTLEN =  ‘40’.

MODIFY T_DFIES FROM LS_DFIES_TAB.

ENDLOOP.

ENDFUNCTION.

相关标签: SAP