cancel
Showing results for 
Search instead for 
Did you mean: 

Service Call or CALL FUNCTION

ged_hurst
Participant
0 Kudos

Hi everyone,

what's the difference between invoking a Service Call or Call Function directly from within a WebDynpro ABAP component to execute a BAPI/Function module?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No difference. The service call is just a wizard. It generates the CALL FUNCTION coding and has the added benefit that it can also generate a matching context node structure. However absolutely everything the service call wizard does can also be done manually without it. It is just a time saver/shortcut.

ged_hurst
Participant
0 Kudos

Thank you very much to everyone, I've given points to all of you.

However I think that invoking a function through "CALL FUNCTION" is much much faster than through the Wizard. In fact, the wizard generates (depending on the options chosen) nodes in the context that have to be populated (the syntax to use is awkward especially to those having a Java background) before executing the function/bapi whereas invoking a call function requires just a few lines of coding.

So I'll stick to "CALL FUNCTION" next time.

Thans!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Both works same, creating and using service call is easy, just create and call execute method of component controller from view. your FM will works.

Using call function you have to write some coding, check example..

You can use FM in WD and loops as well. Check below example code, it is working fine.

DATA : HUKEY TYPE BAPIHUKEY-HU_EXID,

wa_hukey TYPE BAPIHUKEY-HU_EXID.

loop at lt_pack_mat into ls_pack_mat.

wa_hukey = ls_pack_mat-HANDLING_UNIT.

MOVE wa_hukey TO hukey.

endloop.

CALL FUNCTION 'BAPI_HU_DELETE_FROM_DEL'

EXPORTING

DELIVERY = del

HUKEY = HUKEY

TABLES

RETURN = Return1.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

Cheers,

Kris.

Former Member
0 Kudos

Basically no much difference. Both perform a similar task in terms of execution. However, service call is a time saver compared to Call function as in Call function, I have to everything manually from node to code.

Any further notes from people appreciated.

Cheers,

Santosh Verma