ABAP Search Help 返回多列值到荧幕
*-----------------------------------------------------
ALV:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_PER.
PERFORM NUMBER_SHLP_xxxx.
*------------------------------------------------------
form NUMBER_SHLP_ZHDNO_EB_01 using P_TABNAME P_FIELDNAME changing P_FIELDVALUE. data LT_RETURN type table of DDSHRETVAL. data P_FIELD type HELP_INFO-DYNPROFLD. P_FIELD = P_TABNAME && '-' && P_FIELDNAME. select DISTINCT * from LIPS into table @data(LT_NO) where VGBEL = @ZDB_HEAD-EBELN. call function 'F4IF_INT_TABLE_VALUE_REQUEST' exporting * DDIC_STRUCTURE = ' ' RETFIELD = 'ZHDNO' "返回LT_NO的栏位 * PVALKEY = ' ' DYNPPROG = SY-REPID "返回的输入框所在的main program DYNPNR = SY-DYNNR "返回的输入框所在屏幕 DYNPROFIELD = P_FIELD "荧幕绑定的字段 * STEPL = 0 * WINDOW_TITLE = * VALUE = ' ' VALUE_ORG = 'S' * MULTIPLE_CHOICE = ' ' * DISPLAY = ' ' CALLBACK_PROGRAM = SY-REPID CALLBACK_FORM = 'RETURN_MUL_COLS_F07_03'"返回多列值 * CALLBACK_METHOD = * MARK_TAB = * IMPORTING * USER_RESET = tables VALUE_TAB = LT_NO”Search help显示的内表 * FIELD_TAB = RETURN_TAB = LT_RETURN * DYNPFLD_MAPPING = 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. else. if LT_RETURN[] is not initial. P_FIELDVALUE = LT_RETURN[ 1 ]-FIELDVAL."P_FIELDVALUE荧幕中所对应的栏位 endif. endif. endform. FORM RETURN_MUL_COLS_F07_03 TABLES record_tab STRUCTURE seahlpres CHANGING shlp TYPE shlp_descr callcontrol LIKE ddshf4ctrl. DATA: interface LIKE LINE OF shlp-interface. READ TABLE shlp-interface INTO interface INDEX 1. interface-shlpfield+4(1) = '5'."返回荧幕栏位的字段索引 interface-valfield = 'ZDB_ITEM-CHARG'."返回荧幕的字段ID APPEND interface TO shlp-interface. ENDFORM.