过滤ALV不能正常工作

时间:2017-10-16 07:56:13

标签: sap abap

我有以下代码,不过滤columsn的单选按钮:btn4和btn5。对于单选按钮btn1和btn3工作正常。你有什么想法为什么?干杯,朱利安

SELECTION-SCREEN BEGIN OF BLOCK BLOCK2 WITH FRAME TITLE text-001.
SELECTION-SCREEN COMMENT /1(79) label_4.
PARAMETERS: btn5    RADIOBUTTON GROUP RAD1 USER-COMMAND chk DEFAULT 'X',
            btn4    RADIOBUTTON GROUP RAD1,
            btn2    RADIOBUTTON GROUP RAD1,
            btn1    RADIOBUTTON GROUP RAD1,
            btn3    RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN END OF BLOCK BLOCK2.
Refresh it_filter.
  if btn1 = 'X'.
    ls_filter-fieldname = 'COMDEP'.  "Filtru data comanda intre doua date calendaristice pentru Depasit radiobuton "
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'Depasit'.
    APPEND ls_filter TO It_filter.
  ELSEIF btn3 = 'X'.
    ls_filter-fieldname = 'COMDEP'.  "Filtru data comanda intre doua date calendaristice pentru Nedepasit radiobuton "
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'Nedepasit'.
    APPEND ls_filter TO It_filter.
  ELSEIF btn4 = 'X'.
    ls_filter-fieldname = 'GMEIN'.  "Comenzi vrac
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'KG'.
    APPEND ls_filter TO It_filter.
  ELSEIF btn5 = 'X'.
    ls_filter-fieldname = 'MEINH'.  "Comenzi bucati
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'BUC'.
    APPEND ls_filter TO It_filter.
  EndIf.

1 个答案:

答案 0 :(得分:-2)

同时我找到了答案,请在下面找到:

IF btn4 = 'X'.
    ls_filter-fieldname = 'MEINH'.  "Comenzi vrac
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'NE'.
    ls_filter-valuf_int = 'BUC'.
    APPEND ls_filter TO It_filter.

  ELSEIF btn5 = 'X'.
    ls_filter-fieldname = 'GMEIN'.  "Comenzi structura
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'NE'.
    ls_filter-valuf_int = 'KG'.
    APPEND ls_filter TO It_filter.
  ELSEIF btn6 = 'X'.
    ls_filter-fieldname = 'GMEIN'.  "Comenzi vrac
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'KG'.
    APPEND ls_filter TO It_filter.

    ls_filter-fieldname = 'MEINH'.  "Comenzi structura
    ls_filter-tabname = 'LT_JOIN'.
    ls_filter-sign0 = 'I'.
    ls_filter-optio = 'EQ'.
    ls_filter-valuf_int = 'BUC'.
    APPEND ls_filter TO It_filter.

  EndIf.