Application Development 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: 

Function module or Globlal class?

Former Member
0 Kudos

Hi All,

I need to write code in the include ZXF04U01, as forms(perform) are obsolete now, i cant create classes in this include. So i have to go either with function modules or else with Global class.

Is there any priority between FM and global classes. Which is better and why?

Thanks in advance.

regards,

NarsiReddy.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

If you have more than one organization and the logic in the customer exit include ZXF04U01 would be shared by more than one, I suggest you convert the customer exit into the custom BADI.

  • Create a custom BADI with a possible filter, with multiple implementation
  • Call the BADI using CALL BADI in the include ZXF04U01
  • Implement the BADI and write your own logic within it for that org unit.
  • If more than one org unit, create another BADI implementation

It has lot of artifacts and would need more time to develop, but by doing so you have these advantages:

  • You use the Object Oriented technique as the BADI implementation would require an implementing class
  • Flexible design - a new implementation can be created with a new filter
  • Code segregation - each org has its own implementation
  • You enforce other developers who would change the include, not to use obsolete statements.

If you think, its overkill and you don't have multiple org structure, create the Function Module. Make sure to copy the same signature in your custom FM as well.

Regards,
Naimesh Patel

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

If you have more than one organization and the logic in the customer exit include ZXF04U01 would be shared by more than one, I suggest you convert the customer exit into the custom BADI.

  • Create a custom BADI with a possible filter, with multiple implementation
  • Call the BADI using CALL BADI in the include ZXF04U01
  • Implement the BADI and write your own logic within it for that org unit.
  • If more than one org unit, create another BADI implementation

It has lot of artifacts and would need more time to develop, but by doing so you have these advantages:

  • You use the Object Oriented technique as the BADI implementation would require an implementing class
  • Flexible design - a new implementation can be created with a new filter
  • Code segregation - each org has its own implementation
  • You enforce other developers who would change the include, not to use obsolete statements.

If you think, its overkill and you don't have multiple org structure, create the Function Module. Make sure to copy the same signature in your custom FM as well.

Regards,
Naimesh Patel

raymond_giuseppi
Active Contributor
0 Kudos

Or replace Customer Exit EXIT_SAPMF02D_001 of Enhancement SAPMF02D with some method of BAdI CUSTOMER_ADD_DATA(_CS) some simulation of a dummy customer screen?

Regards,

Raymond