cancel
Showing results for 
Search instead for 
Did you mean: 

Why Service Call and why not call Function module Directly in WD ABAP

Former Member
0 Kudos

Hi,

I have created a Webdynpro applications and the logic requires calling avrious Function modules.

Do I need to create Service Call for each Function module or call them directly.

It would be great if you can suggest me under what cases I need to opt for Service call

For example, if I use 'RP_CALC_DATE_IN_INTERVAL', do I need to use Service call or call function module directly.

Note: I have searched forums but could not get the correct answer which I want

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The Service Call is really meant to be a wizard/time saver. It has the advantage that it can generate matching context nodes/attributes for the interface of the Function Module you are calling. However everything that the service call does can also be created by hand.

Personally I'm not a fan of what the service call wizard generates. Its good as a time saver or for beginners, but I find I prefer to touch up the code it generates anyway. I much prefer to create a nice reusable model class with its own unit test and then consume this model class (with the service call wizard) from WD. This model class might contain one or more function module calls depending upon what logic I need to access.

Former Member
0 Kudos

Thanks for your reply.

I just need 2 clarifications

-> Is ' Remote Enabled' functionality of Function module has something to do with Service call

i.e. like if Function module is onlt remote enabled go for Service call etc.

-> Will there be any difference in performance if we go for Service call instead of calling FM directly

Thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>like if Function module is onlt remote enabled go for Service call etc.

No. The opposite is true in fact. The Service Call Wizard doesn't support remote enabled function modules, only local ones.

> Will there be any difference in performance if we go for Service call instead of calling FM directly

No. As I said, you could write the same code yourself. If you really know what you are doing, you can probably write better code than what the wizard generates.

Former Member
0 Kudos

Thanks a lot for clarification...

I can write code myself..... but just wondering is it mandatory to go for Service call etc....

Regards

Vasu

Answers (0)