cancel
Showing results for 
Search instead for 
Did you mean: 

Calling my_function on end of task not called

Former Member
0 Kudos

Hello,

i'm facing the following problem i call a function in the background which checks a semaphore to get released. After the function finished i want to call the method "Fire Event" which fires an event. But the "Fire Event" function never get called after the Call function statement has been finished. Did i forget something or is this not possible in webdynpros? I coded both the function call and the fire event method in the componentcontroller!

CALL FUNCTION 'Z_FB_CHECK_SEMAPHORE'

     STARTING NEW TASK 'INFO'

     DESTINATION 'NONE'

     CALLING FIRE_EVENT ON END OF TASK

     EXCEPTIONS

       communication_failure = MESSAGE msg

       system_failure        = MESSAGE msg.

Here is my fire event function

method FIRE_EVENT .

   BREAK-POINT 'Fire Event'.

   wd_this->fire_EXTERNAL_PUSH_evt( ).

endmethod.

Thanks for your help

Toby

Accepted Solutions (1)

Accepted Solutions (1)

former_member215344
Contributor
0 Kudos

Hi Sommer,

Please check the SAP help documentation:

In the callback routine, no statements can be executed that cause the program run to terminate or end an SAP LUW. Statements for list output are not executed.  

Prerequisite for executing a callback routine is that, after the remote function has ended, the calling program is still internally available. It is then executed the next time the work process is changed. If the program has ended, or if it is part of a call sequence in the stack, then the callback routine is not executed. The statement WAIT can be used to stop the program execution until certain or all callback routines have been executed.

http://help.sap.com/saphelp_nwpi71/helpdata/en/3d/a846df17c1014e928626637ab06838/content.htm

Thanks,

Ajay Bose

Former Member
0 Kudos

Thanks for your answer Ajay,

so please correct me, if i got the docu wrong:

I call the rfc and i didn't get the callback because my program isn't longer internal available?

Prerequisite for executing a callback routine is that, after the remote function has ended, the calling program is still internally available

What can i do to solve this problem? When i try it with wait until and a logic expression the callback routine get called immediately after i execute the rfc function! Or is there another way to wait for something like an event or an external push?

Thanks for help

Toby

former_member215344
Contributor
0 Kudos

Hi Sommer,

Yes, I strongly believe so. Because I don't think Webdynpro methods are syncronous methods which wait for a function call to end.

What you can try is may be call this RFC inside another function module (you may have to create a new function group) and hopefully this function group may still exist in memory till your RFC gets executed. Well you can give it a try.

Thanks,

Ajay Bose

Answers (1)

Answers (1)

Former Member
0 Kudos

Hallo Tobias,

I didn't programming in Web Dynpro, but I think I had a similar problem in classic ABAP. Semantic is similar. I propose you to start program only with exactly 3 tunels.

If "end of task" didn't appear, somewhere in your RFC inside there is a problem with function or procedure. Input parameter, variant or something else go wrong, Function or procedure have sy-subrc = 0, aRFC ended without any information that is giving outside.

Developer is confuse what is wrong, because exeption weren't catch.

You have to debug this aRFC with only 2 tunnels. Very important are start parameters and end parameters. You have to debug everything step by step and see, if somewhere, when you click f5 or f6 you automaticly are outside aRFC, and the programm go farther.

You have to check this in first place. IF everything go good, aRFC was good written, and the problem is in some tunnel between  start and end conditions.

Kind Regard,

Marek.