Application Development and Automation 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: 
Read only

Does feature exist for activating program immediately on all servers

Sandra_Rossi
Active Contributor
2,887

Hello, if I activate my program and run it immediately in background, it often executes on another application server, and so the old version of the program is used because the application server doesn't know that there is a new version of the program, because the PXA/program buffer is not synchronized yet, the sync being done approximately once every 2 minutes.

Do you know whether it exists a way to sync immediately the buffer on all application servers each time I activate my program? (or an option to execute in background only on current application server without having to enter it manually when I submit in background).

Thanks a lot!

Sandra

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
2,650

Brute Force and of course not advisable.

Prepare an RFM that GENERATEs your program. Get all servers with Fumo TH_SERVER_LIST. Call the RFM on all servers. Duh.

12 REPLIES 12
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
2,650

Phew, I wait patiently before starting on other servers 😉

Let's see if someone knows a trick.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,650

It's what I do too: I have bought a cooking timer to wait for 3 minutes 😉

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
2,651

Brute Force and of course not advisable.

Prepare an RFM that GENERATEs your program. Get all servers with Fumo TH_SERVER_LIST. Call the RFM on all servers. Duh.

Read only

0 Likes
2,650

Thanks. I'll probably do that. Maybe as an enhancement of the standard "activate" button (if the user is "me"), if possible.

Read only

2,650
DATA list TYPE TABLE OF msxxlist WITH EMPTY KEY.
CALL FUNCTION 'TH_SERVER_LIST'
  TABLES
    list   = list
  EXCEPTIONS
    OTHERS = 4.
IF sy-subrc <> 0 OR lines( list ) < 2.
  ...
ENDIF.

DELETE list WHERE host = sy-host.
LOOP AT list ASSIGNING FIELD-SYMBOL(<server>).
  CALL FUNCTION '...' STARTING NEW TASK '...'
    DESTINATION <server>-name.
ENDLOOP.
Read only

0 Likes
2,650

I did a test, and it works (i.e. GENERATE REPORT executed on all other servers). I also did a test to force the buffer synchronization (cl_buffer_sync=>synchronize) on all other servers, it works too. PS: my release is 7.40.

But the issue is to trigger it easily right after the activation of the program, and most of code behind the Activate button is protected against the Enhancement framework. Maybe using a SAP GUI shortcut from my laptop, to start the program. Not ideal.

Read only

2,650

Here's the complete but ugly ("generic" RFC) source code if someone needs it.

REPORT.

parameters program type syrepid.

START-OF-SELECTION.
  DATA lt_server TYPE TABLE OF msxxlist.
  DATA ls_server TYPE msxxlist.
  DATA l_server_name TYPE btctgtsrvr-srvname. "20c
  DATA l_message(273) TYPE c.

  CALL FUNCTION 'TH_SERVER_LIST'
    TABLES
      list = lt_server.

  "DELETE lt_server WHERE host = sy-host. " ignore current server

  LOOP AT lt_server INTO ls_server.
    l_server_name = ls_server-name. "truncate 40c to 20c ("hostname_sid_99")
    CLEAR l_message.
    DATA STRING TYPE STRING.
    STRING = PROGRAM.
    CALL FUNCTION 'SO_CALLBACK_RFC'
      DESTINATION l_server_name
      EXPORTING
        program               = sy-repid
        form                  = 'TEST' "to call subroutines TEST and TEST_XCHECK
        params                = STRING
      EXCEPTIONS
        system_failure        = 1  MESSAGE l_message
        communication_failure = 2  MESSAGE l_message
        OTHERS                = 3.
    IF sy-subrc NE 0.
      WRITE : / l_server_name, sy-subrc, l_message.
    ENDIF.
  ENDLOOP.

*---------------------------------------------
FORM test_xcheck CHANGING xcheck TYPE flag.
  xcheck = 'X'.
ENDFORM.

*---------------------------------------------
FORM test USING params TYPE string.
  GENERATE REPORT params.
  "CALL METHOD cl_buffer_sync=>synchronize.
ENDFORM.
Read only

kiran_k8
Active Contributor
0 Likes
2,650

Sandra,

"if I activate my program and run it immediately in background, it often executes on another application server, and so the old version of the program is used because the application server doesn't know that there is a new version of the program"

May I know what is the objective of this acitivity.Just curious to know the scenario that necessitates acitvating a prog and running immediately in background.

K.Kiran.

Read only

matt
Active Contributor
0 Likes
2,650

/$PXA https://wiki.scn.sap.com/wiki/display/Basis/How+to+Reset+different+SAP+buffers

Maybe...?

I'd noticed this behaviour as well - though when importing changes into our 2 appserver test system. Never thought about the cause.

Read only

Sandra_Rossi
Active Contributor
2,650

Thanks Matt. /$pxa only empties the PXA buffer on the current application server (which is the same for all /$ commands). So I would need to switch to every server and run it, it's a little too much fastidious for me. I'd really like a profile parameter for that, or an option in the user's workbench settings (something like "run in background only in current server"), ...

Read only

matt
Active Contributor
0 Likes
2,650

Easy. Create program that runs in background. Find it doesn't work. Fix, activate, run again (in background) to test.

Read only

Sandra_Rossi
Active Contributor
2,650

K.Kiran, I have to run the program in background because it's a long-running program (in dialog, it would time out) and I don't want to "lock a user session for nothing". My current assignment is to improve the performance of programs, so I do it very often. It's normal to run a program immediately after having activated it ; it's abnormal to count down 3 minutes before doing a task. I also ask because I never saw this question in the forum, but probably people like me would be interested to know if there's a solution.