Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

set_table_for_first_display not working

anand_n5
Explorer
0 Kudos
1,501

Hello experts

Am trying to create ALV grid to display a list. Here i have created a screen 100 with a container to display the list and a button 'BACK' which lead to the screen to initial screen 0.here the problem is list is missing in output i think set_table_for_first_display s not working in my code. Below i have listed my code please let me know where am doing mistake .

*&---------------------------------------------------------------------*

*& Module Pool       ZABAP_OBJECTS

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

PROGRAM  ZABAP_OBJECTS.

DATA: O_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

      O_GRID TYPE REF TO CL_GUI_ALV_GRID,

      IT_T001 LIKE TABLE OF T001.

*&---------------------------------------------------------------------*

*&      Module  STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE STATUS_0100 OUTPUT.

  SET PF-STATUS 'ZSTATUS'.

*  SET TITLEBAR 'xxx'.

  CREATE OBJECT O_CONTAINER

  EXPORTING

*    PARENT                      =

    CONTAINER_NAME              = 'CONTAINER'.

    .

IF SY-SUBRC = 0.

CREATE OBJECT O_GRID

   EXPORTING

*     I_SHELLSTYLE      = 0

*     I_LIFETIME        =

     I_PARENT          = O_CONTAINER.

  IF SY-SUBRC = 0.

    CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY

      EXPORTING

        I_STRUCTURE_NAME              = 'T001'

      CHANGING

        IT_OUTTAB                     = IT_T001

     

            .

    ENDIF.

    ENDIF.

ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*

*&      Module  READ_DATA  OUTPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE READ_DATA OUTPUT.

  SELECT * INTO TABLE IT_T001 FROM T001 UP TO 10 ROWS.

ENDMODULE.                 " READ_DATA  OUTPUT

*&---------------------------------------------------------------------*

*&      Module  USER_COMMAND_0100  INPUT

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

MODULE USER_COMMAND_0100 INPUT.

  CASE SY-UCOMM.

    WHEN 'BACK'.

      LEAVE TO SCREEN 0.

      ENDCASE.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

flow logic in the screen 100.

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

MODULE READ_DATA.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

1 ACCEPTED SOLUTION

RaymondGiuseppi
Active Contributor
0 Kudos
675

Read the data before displaying it

( MODULE READ_DATA before MODULE STATUS_0100)

Regards,

Raymond

4 REPLIES 4

RaymondGiuseppi
Active Contributor
0 Kudos
676

Read the data before displaying it

( MODULE READ_DATA before MODULE STATUS_0100)

Regards,

Raymond

0 Kudos
675

Thank you very much

Former Member
0 Kudos
675

in your PBO block first get records then call status

<Reward request removed by moderator>

Message was edited by: Vinod Kumar

0 Kudos
675

Thank you