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

CLASS DEFINATION

Former Member
0 Likes
927

HELLO EVERYBODY CAN YOU EXPLAIN THE DIFFERENCE BETWEEN

CUSTOMER EXIT AND USER EXIT AND ALSO BETWEEN THE TWO OPERATORS <- AND <=.

THANKS IN ADVANCE.

REGARDS

MANISH.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
901

Hi manish,

1. First there were

user-exits,

then came the concept of customer-exits.

(both are for writing of customer code only)

2. user-exits :

the are implemented using

a INCLUDE

in which different FORMS are provided.

SAP programs call this FORMS (using performs)

and the customer has to write

code in this (if required)

3. Whereeas in customer-exits,

it is implemented using FUNCTION MODULES

4. The important difference is :

user-exit : ALWAYS CALLED

CUSTOMER-EXIT : Called only if ACTIVATED.

regards,

amit m.

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
901

User exit and customer exit are really the same.

In regards to class/methods, the -> means that you are calling a method of an instance or object of a class. The => means that you are calling a method of static class. The static class has no instance or object. It is static.

Regards,

Rich Heilman

Read only

0 Likes
901

Here is a sample program to illistrate.



report  zrich_0001.

*----------------------------------------------------------------------*
*       CLASS lcl_app DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_app definition.

  public section.
    methods: fire_plug.

endclass.                    "lcl_app DEFINITION



*----------------------------------------------------------------------*
*       CLASS lcl_app IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_app implementation.
  method fire_plug.
    write:/ 'Plug has been fired from object of class'.
  endmethod.                    "fire_plug
endclass.                    "lcl_app IMPLEMENTATION

*----------------------------------------------------------------------*
*       CLASS lcl_app_static DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_app_static definition.

  public section.
    class-methods: fire_plug.

endclass.                    "lcl_app DEFINITION



*----------------------------------------------------------------------*
*       CLASS lcl_app IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_app_static implementation.
  method fire_plug.
    write:/ 'Plug has been fired from static class'.
  endmethod.                    "fire_plug
endclass.                    "lcl_app IMPLEMENTATION

data: a_app type ref to lcl_app.

start-of-selection.

* Create object and call method
  create object a_app.
  a_app->fire_plug( ).

* call method of static class
  lcl_app_static=>fire_plug( ).

Regards,

Rich Heilman

Read only

Former Member
0 Likes
902

Hi manish,

1. First there were

user-exits,

then came the concept of customer-exits.

(both are for writing of customer code only)

2. user-exits :

the are implemented using

a INCLUDE

in which different FORMS are provided.

SAP programs call this FORMS (using performs)

and the customer has to write

code in this (if required)

3. Whereeas in customer-exits,

it is implemented using FUNCTION MODULES

4. The important difference is :

user-exit : ALWAYS CALLED

CUSTOMER-EXIT : Called only if ACTIVATED.

regards,

amit m.

Read only

Former Member
0 Likes
901

hi munish...

customer and user exits are same..

...exits defines for customer ( user ) ...so that he can use it according to needs and reuirements.

Read only

Former Member
0 Likes
901

Hi Manish

User exit:

The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

in oo

=> is used for calling the function which retruns a function

ex.

ls_exclude = cl_gui_alv_grid=>mc_fc_maximum .

-> is used for static

CALL METHOD gr_alvgrid->get_frontend_fieldcatalog IMPORTING et_fieldcatalog = lt_fcat[] .

regards

kishore

Read only

0 Likes
901

This is not exactly correct.....

<i>



n oo

=> is used for calling the function which retruns a function

ex.
ls_exclude = cl_gui_alv_grid=>mc_fc_maximum .


-> is used for static 

CALL METHOD gr_alvgrid->get_frontend_fieldcatalog IMPORTING et_fieldcatalog = lt_fcat[] 

</i>

First the => references static elements of a class, in my example, i was using a method, but you can also have static atttributes, such as cl_gui_alv_grid=>mc_fc_maximum. This is how you would reference the STATIC attribute of a class. It really has nothing to do with "returning a function"

The -> is not used when referring to static attributes or methods, it is used when referring to instances of the class attributes or methods.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
901

Hi rich

yes your are absolutely correct.

mistakely i have pasted the examples wrongly

regards

kishore