0

如果可能的话,我需要帮助,因为我被困在一个没有语法错误的地方。我正在使用 abap 将数据从我的数据库表中检索到屏幕 0300 中的表控件。每当我在屏幕 0300 中按直接处理时,我的表控件上都没有任何信息。这就是屏​​幕 0300 的流程逻辑:

PROCESS BEFORE OUTPUT.

 MODULE STATUS_0300.

 LOOP at it_customers  into WA_customerS WITH CONTROL tc300.
   MODULE fill_ctable_control .

 ENDLOOP.



PROCESS AFTER INPUT.

  LOOP at it_CUSTOMERs .
module read_ctable_control .

 ENDLOOP.


MODULE USER_COMMAND_0300.

这就是 PBO / PAI 代码:

module FILL_CTABLE_CONTROL output.

IF it_CUSTOMERS is initIAl.
SELECT * FROM  zy2014_42_CUSTOM

    INTO CORRESPONDING FIELDS OF TABLE it_CUSTOMERS.
ENDIF.

endmodule.                 " FILL_CTABLE_CONTROL  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  READ_CTABLE_CONTROL  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module READ_CTABLE_CONTROL intput.
 IF sy-stepl = 1.

      tc300-lines = tc300-top_line + sy-loopc - 1.

    ENDIF.



*   move fields from work area to scrren fields

    MOVE-CORRESPONDING wa_CUSTOMERs TO zy2014_42_TCCUSTOMERS.
endmodule.

module USER_COMMAND_0300 input.
case ok_code .
when 'BACK'.
LEAVE TO SCREEN 100.
ENDCASE.
  SELECT *  FROM  zy2014_42_CUSTOM

    INTO CORRESPONDING FIELDS OF TABLE it_CUSTOMERS.

CLEAR OK_CODE.
endmodule. 

考虑到我正在使用 dynpro 程序

提前谢谢大家

4

1 回答 1

1

The purpose of the MODULE fill_ctable_control seems to be to read the whole database table into your it_customers. It would make sense to execute it once per PBO. However, you've put the call into the LOOP at it_customers which means it is executed once for each entry in that internal table. When the internal table hasn't got any entries yet, it isn't executed at all, so the table stays as empty as it is.

I would recommend you to move the module-call out of the loop.

于 2014-05-29T01:23:31.983 回答