使用 ALV 输出中的复选框下载所选记录



我正在使用此代码下载选定的记录。 但我做不到。 我做错了什么?

FORM ZUCOMM USING LV_OKCODE TYPE SY-UCOMM
             SEL_FIELD TYPE SLIS_SELFIELD.

CASE LV_OKCODE .
    WHEN 'DOWN' .
*   REFRESH IT_MARA1.
IF FLAG = 'X'.

         lOOP AT it_mara INTO wa_mara."  WHERE CHECK  = 'X'.
*
        wa_mara1-matnr =  wa_mara-matnr.
        wa_mara1-MTART = wa_mara-MTART.
        wa_mara1-MATKL = wa_mara-MATKL.
        APPEND wa_mara1 TO it_mara1.
                 ENDLOOP.
我不知道

你到底想做什么,但如果你想在内部表中找到 alv 的一些记录,请使用这样的代码:

*&---------------------------------------------------------------------*
*&      Form  atusercommand
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->UCOMM      text
*      -->SELFIELD   text
*----------------------------------------------------------------------*
FORM ATUSERCOMMAND USING UCOMM LIKE SY-UCOMM
                SELFIELD TYPE SLIS_SELFIELD.
  CASE UCOMM.
    WHEN '&IC1'." On click
        PERFORM ME_CALL_DETAIL USING SELFIELD.
    WHEN 'HIST'." Button
        PERFORM ME_CALL_DETAIL USING SELFIELD.
  ENDCASE.
ENDFORM.                    "atusercommand
FORM ME_CALL_DETAIL USING SELFIELD.
  READ TABLE GT_ALV WITH key CHECK  = 'X' INTO wt_pom.
  "some logic
ENDFORM.

如果我想访问选定的行,我通常使用这个:

READ TABLE GT_ALV4 INTO LS_ALV4 INDEX U_PSELFIELD-TABINDEX.

相关内容

  • 没有找到相关文章

最新更新