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: 

CALL fucntion update task

Former Member
0 Kudos

why does it not allow me to set the import para for func module when atribute is set as update mode...

6 REPLIES 6

Former Member
0 Kudos

Update functions are triggred by commit work and are executed in update task ( other than dialog task ) . It cannot and should not return a parameter to the calling program as the calling program has no no control on update task . Even if it allows it would have no meaning .

Cheers

Former Member
0 Kudos

thanks i need to test how its would work....i need to call it in progream 3 times..and then commit and see if the simulataneous excution is done..can someone guide through the steps.

0 Kudos

Hi

You can call it three times. It will be executed simultaneously ad the data which was there at the time of call will be visible in update task.

For example

CALL FUNCTION F1 IN UPDATE TASK

EXPORTING

P1 = W1.

CALL FUNCTION F1 IN UPDATE TASK

EXPORTING

P1 = W2.

CALL FUNCTION F1 IN UPDATE TASK

EXPORTING

P1 = W3.

COMMIT WORK .

It would execute 3 times in update task in the sequence above . You can even test in debugging - , put a break point on commit work. In debugging mode enable Update debugging in settings tab ( -> SAVE ) . Press F8 , another window of update task will open . Here BREAKPOINT -> AT FUNCTION -> <F1> . You will see that your code stops in the FM 3 times with different parameter values W1/W2/W3 .

Cheers

Former Member
0 Kudos

can u tell me about the steps creting f1 function as we need to set attributes to update module dont need to define any exportinbg para....then how do i use it u can take example of F1 calcuting sum of two numbers....

Former Member
0 Kudos

if my function module populates a field and then after commit i need to write it...what shud the code look like...anything particular to be atken care of

0 Kudos

As I said earlier update modules are run in update task and your dialog task has no control over it . Update modules should be used for updating database tables and not for any other purpose. Update modules are created only to bundle all database updates in one. You dialog program / application program does all the necessary validations and passes all the database updates to update module which is triggered at commit work . After this your dialog program has no control on update module , so neither it should return any value to calling program , nor write any list .

You can use normal FM to write a list . Why are you using update module. Any specific requirement ..

Cheers