如何获取参数值并将其插入查询 SAP ABAP



我有一个问题,我制作带有参数的报告,然后我必须从一个参数中获取值并将其插入选择查询,但我的值始终为空,我使默认值为报告启动所有函数。

当我尝试这个一切都很好

PARAMETERS p_name TYPE char30.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
p_name = 'ARNOLD'.
SELECT * FROM zyy_pat_final_db INTO TABLE tb_pt WHERE NAME = p_name.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
*     DDIC_STRUCTURE  = ' '
retfield        = 'name'
*     PVALKEY         = ' '
dynpprog        = sy-repid
dynpnr          = sy-dynnr
dynprofield     = 'p_name'
*     STEPL           = 0
*     WINDOW_TITLE    =
*     VALUE           = ' '
value_org       = 'S'
*     MULTIPLE_CHOICE = ' '
*     DISPLAY         = ' '
*     CALLBACK_PROGRAM       = ' '
*     CALLBACK_FORM   = ' '
*     CALLBACK_METHOD =
*     MARK_TAB        =
* IMPORTING
*     USER_RESET      =
TABLES
value_tab       = tb_pt
*     FIELD_TAB       =
*     RETURN_TAB      =
*     DYNPFLD_MAPPING =
* EXCEPTIONS
*      parameter_error = 1
*      no_values_found = 2
*      OTHERS          = 3.
*  IF sy-subrc <> 0.
* Implement suitable error handling here.
*  ENDIF.

我不知道,为什么没有我的输入,我用代码写了什么,我

没有得到任何结果
PARAMETERS p_name TYPE char30.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
********p_name = 'ARNOLD'.
SELECT * FROM zyy_pat_final_db INTO TABLE tb_pt WHERE NAME = p_name.

实际上,首先的要求并不那么明确:如果选择参数需要选择查询的值,那么使用的功能模块将无济于事......尝试使用给定的代码

BEGIN OF ty_mat,
sign(1)   TYPE c,
option(2) TYPE c,
XXXXX(low)    TYPE ANY,
YYYYY(high)   TYPE ANY,
END OF ty_mat.
DATA:  it_mat             TYPE TABLE OF      ty_mat,
wa_mat             TYPE               ty_mat.
LOOP AT it_TABLE INTO wa_TABLE.          "added
wa_sam1-sign = 'I'.
wa_sam1-option  = 'EQ' .
wa_sam1-low = "aNY VALUE".
APPEND wa_MAT TO it_mat.
ENDLOOP.

and now pass it_mat to your select query with IN parameter...

相关内容

  • 没有找到相关文章

最新更新