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: 
Read only

alv class???

Former Member
0 Likes
799

Dear frnds,

Thanks for the earlier answer.

there is 1more problem now,

when i am defining

<b>CLASS lcl_event_receiver DEFINITION DEFERRED.</b>

iam getting error

"CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED" does not have "CLASS

LCL_EVENT_RECEIVER DEFINITION".

can you please tell me what does it mean and how to resolve it.

Dear frnds,

Thanks for the earlier answer.

there is 1more problem now,

when i am defining

<b>CLASS lcl_event_receiver DEFINITION DEFERRED.</b>

iam getting error

"CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED" does not have "CLASS

LCL_EVENT_RECEIVER DEFINITION".

can you please tell me what does it mean and how to resolve it.

3 REPLIES 3
Read only

Former Member
0 Likes
620

Hi Abhay,

When you specify this statement

CLASS lcl_event_receiver DEFINITION DEFERRED.

it means you are making a delay in writing the definition of the class.

It means you will write the definition in the later part of your program.

What the error in the program says is that you have not written your definition anywhere in the program. It could not find the defintion. That is why it is raising such an error.

Just give the definition for the class by giving the defintion of suitable methods and attributes.The error will be solved.

Usually you use this statement to provide the declaration of the objects of the class before the class is defined.

You can go through this link for more details.

http://www.sapgenie.com/abap/controls/alvgrid.htm

<b>Close the thread once the problem is solved</b>

Regards,

SP.

Read only

Former Member
0 Likes
620

hi,

Why can'nt you use

CLASS lcl_event_receiver DEFINITION.
ENDCLASS.

. Is that you need to DEFERRED it later.

rgds,

TM.

Read only

former_member480923
Active Contributor
0 Likes
620

Hi,

The correct procedure is to define

CLASS lcl_event_receiver DEFINITION DEFERRED.

in the top include and aftre that define the local class and its implementation in the class include like this

CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

DATA: gridtyp TYPE char03.

  • Top of Page

METHODS handle_top_of_page

FOR EVENT top_of_page OF cl_gui_alv_grid

IMPORTING e_dyndoc_id.

  • Print Top of Page

METHODS: handle_print_top_of_page

FOR EVENT print_top_of_page OF cl_gui_alv_grid,

  • Print End of List

handle_print_end_of_list

FOR EVENT print_end_of_list OF cl_gui_alv_grid.

ENDCLASS.

CLASS lcl_event_receiver IMPLEMENTATION.

* Handle Top of Page
  METHOD handle_top_of_page.
    CASE gridtyp.
      WHEN c_reslt.
        PERFORM sub_top_of_grid USING e_dyndoc_id
                                     w_contnr_top.
      WHEN OTHERS.
        PERFORM output_parameters USING e_dyndoc_id
                                     'OUTPUT_PARAMS'.
    ENDCASE.
  ENDMETHOD.

* Handle Top of Page at Print
  METHOD handle_print_top_of_page.
    PERFORM output_headings.
  ENDMETHOD.

* Handle End of List at Print

  METHOD handle_print_end_of_list.
    PERFORM output_parameters USING w_html space.
  ENDMETHOD.


ENDCLASS.

the error will come if the program dosent find a defination of the class which was deffered earlier.

Hope this helps

Anirban