Skip to Content
0
Former Member
Mar 18, 2009 at 06:55 PM

Cant display table entries

36 Views

Hi experts,

Given below is a code:

REPORT z_first_program.

TABLES: spfli.

DATA: ok_code TYPE sy-ucomm,

save_ok LIKE ok_code.

----


  • CLASS application DEFINITION

----


*

----


CLASS application DEFINITION.

PUBLIC SECTION.

METHODS: read_data IMPORTING l_carrid TYPE spfli-carrid.

PRIVATE SECTION.

DATA: spfli_tab TYPE TABLE OF spfli,

wa_spfli_tab like line of spfli_tab.

ENDCLASS. "application DEFINITION

----


  • CLASS application IMPLEMENTATION

----


*

----


CLASS application IMPLEMENTATION.

METHOD read_data.

SELECT * FROM spfli INTO TABLE spfli_tab WHERE carrid = l_carrid.

loop at spfli_tab into wa_spfli_tab.

write:/ wa_spfli_tab-carrid.

endloop.

ENDMETHOD. "read_data

ENDCLASS. "application IMPLEMENTATION

DATA: object_ref TYPE REF TO application.

START-OF-SELECTION.

CREATE OBJECT object_ref.

CALL SCREEN 0100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_0100'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE user_command_0100 INPUT.

  • IF sy-ucomm = 'BACK' OR

  • sy-ucomm = 'EXIT' OR

  • sy-ucomm = 'CANCEL'.

  • LEAVE PROGRAM.

  • ELSEif sy-ucomm = 'EXECUTE'.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'EXECUTE'.

CALL METHOD object_ref->read_data

EXPORTING

l_carrid = spfli-carrid.

ENDCASE.

  • ENDIF.

ENDMODULE. " USER_COMMAND_0100 INPUT

When I execute this report and press the F8 button (EXECUTE), the method read_data is called, but as mentioned in this method, the data of the table spfli_tab is not displayed in the output, however it is coming in the table when i check in the debugging mode.

Could you please help me rectify the issue?

Thanks,

Ajay.