Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Incorrect nesting in module pool

Hi ,

I have been doing a report inorder to create a new entries this report has to be done in alv from the BCALV_edit_01 using that i have been doing the coding in  module poool i hav done the coding it is throwing the error ' incorrect nesting: Before the statement "MODULE", the control structure

introduced by if must be concluded by end if .

DATA: ok_cod LIKE sy-ucomm,

       save_ok like sy-ucomm,

       g_container TYPE scrfname VALUE 'CUST_ALV',

       g_grid  TYPE REF TO cl_gui_alv_grid,

       g_custom_container TYPE REF TO cl_gui_custom_container,

       gs_layout TYPE lvc_s_layo.

data:gt_outtab type STANDARD TABLE OF ty_temp.

call SCREEN 101.

MODULE PBO OUTPUT.

*

  IF g_custom_container IS INITIAL.

   CREATE OBJECT g_custom_container

            EXPORTING container_name = g_container.

     CREATE OBJECT g_grid

            EXPORTING i_parent = g_custom_container.

    

*§1.Set status of all cells to editable using the layout structure.

    

     gs_layout-edit = 'X'.

         CALL METHOD g_grid->set_table_for_first_display

          EXPORTING i_structure_name = 'TY_TEMP'

                    is_layout        = gs_layout

          CHANGING  it_outtab        = gt_outtab.

*§2.Use SET_READY_FOR_INPUT to allow editing initially.

*   (state "editable and ready for input").

     CALL METHOD g_grid->set_ready_for_input

           EXPORTING i_ready_for_input = 1.

ENDIF.

ENDMODULE.                 " PBO  OUTPUT

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

*&      Module  PAI  INPUT

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

*       text

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

MODULE pai INPUT.

   save_ok = ok_cod.

   clear ok_cod.

   CASE save_ok.

     WHEN 'EXIT'.

       PERFORM exit_program.

     WHEN 'SWITCH'.

       PERFORM switch_edit_mode.

     WHEN OTHERS.

*     do nothing

   ENDCASE.

ENDMODULE.                 " PAI  INPUT

FORM switch_edit_mode.

*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.

   IF g_grid->is_ready_for_input( ) EQ 0.

*§4.Use SET_READY_FOR_INPUT to switch between the substates.

     CALL METHOD g_grid->set_ready_for_input

                      EXPORTING i_ready_for_input = 1.

   ELSE.

     CALL METHOD g_grid->set_ready_for_input

                      EXPORTING i_ready_for_input = 0.

   ENDIF.

ENDFORM.

FORM exit_program.

   LEAVE PROGRAM.

ENDFORM.

This is my coding.

Regards ,

Maha.

Former Member
Not what you were looking for? View more on this topic or Ask a question