ALV Fatal Error - GUI Cannot be reached

Click here for the description and solution of the problem.

Following is the final code after modifications to the standard program (All the modifications are marked with Begin and End.):

Code:

PROGRAM ZBCALV_GRID_DEMO.

DATA: OK_CODE LIKE SY-UCOMM,

      GT_SFLIGHT TYPE TABLE OF SFLIGHT,

      G_CONTAINER TYPE SCRFNAME VALUE 'BCALV_GRID_DEMO_0100_CONT1',

      GRID1  TYPE REF TO CL_GUI_ALV_GRID,

      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER. 

* Begin-Insert of Suresh Parvathaneni

DATA: OR_DOC  TYPE REF TO CL_GUI_DOCKING_CONTAINER .

* End-Insert of Suresh Parvathaneni 

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

*       MAIN                                                          *

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

SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.

 CALL SCREEN 100. 

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

*       MODULE PBO OUTPUT                                             *

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

MODULE PBO OUTPUT.

  SET PF-STATUS 'MAIN100'.

  IF G_CUSTOM_CONTAINER IS INITIAL.

* Begin-Insert of Suresh Parvathaneni

    IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.

* End-Insert of Suresh Parvathaneni

      CREATE OBJECT G_CUSTOM_CONTAINER

             EXPORTING CONTAINER_NAME = G_CONTAINER.

      CREATE OBJECT GRID1

             EXPORTING I_PARENT = G_CUSTOM_CONTAINER.

* Begin-Insert of Suresh Parvathaneni

    ELSE.

      CREATE OBJECT GRID1

               EXPORTING I_PARENT = OR_DOC .

    ENDIF.

* End-Insert of Suresh Parvathaneni

    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY

      EXPORTING

        I_STRUCTURE_NAME = 'SFLIGHT'

      CHANGING

        IT_OUTTAB        = GT_SFLIGHT.

  ENDIF.

ENDMODULE.                    "PBO OUTPUT

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

*       MODULE PAI INPUT                                              *

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

MODULE PAI INPUT.

*   to react on oi_custom_events:

  CALL METHOD CL_GUI_CFW=>DISPATCH.

  CASE OK_CODE.

    WHEN 'EXIT'.

      PERFORM EXIT_PROGRAM.

    WHEN OTHERS.

*     do nothing

  ENDCASE.

  CLEAR OK_CODE.

ENDMODULE.                    "PAI INPUT

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

*       FORM EXIT_PROGRAM                                             *

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

FORM EXIT_PROGRAM.

*  CALL METHOD G_CUSTOM_CONTAINER->FREE.

*  CALL METHOD CL_GUI_CFW=>FLUSH.

  LEAVE PROGRAM.

ENDFORM.                    "EXIT_PROGRAM

Click here for the description and solution of the problem.

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image