Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9190

Calling Function Module in Update Task.

$
0
0

Hi,

 

I have this report:

 

 

REPORT  Z_testing_update_task.

 

 

DATA: a TYPE numc1,

            b TYPE numc1 VALUE 1,

            pa_result TYPE p.

 

SET UPDATE TASK LOCAL.

 

a = 1.

PERFORM subroutine ON COMMIT.

a = 2.

PERFORM suborutine ON COMMIT.

a = 3.

 

commit work.

 

FORM subroutine.

 

"Func Module with the "Updated Module flag" checked. Writes the result of the operation sended in "pa_op" parameter.

CALL FUNCTION 'Z_UPFLAG_FUN_CALCULATOR' IN UPDATE TASK

   EXPORTING

     pa_num1               = a

     pa_num2               = b

     pa_op                 = '+'

  EXCEPTIONS

    NOT_ALLOWED_OP       = 1

    DIV_ZERO         = 2

    OTHERS                = 3

  .

 

IF SY-SUBRC <> 0.

  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

 

ENDFORM.

 

 

 

As far as I know, "subroutine" executes just once, because ALL the pending calls are with the same login parameters, so teh only execution will be with "a=3".

 

Am I right ?

 

 

Anyhow,  is it necessary to add the "in update task" in the "call function" ?

 

I got the same output result with and without it, but I'm not sure if I got a "cache result" or just with the flag in the function module is enough.

 

 

How could I force to execute all the pending times using this report ?

 

 

Greetz, and THANX in advance


Viewing all articles
Browse latest Browse all 9190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>