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

Shared Memory & SUBMIT program issue

suwandi_cahyadi
Contributor
0 Likes
1,762

Hi,

There is one program where I use SUBMIT statement:

SUBMIT zprogram VIA SELECTION-SCREEN AND RETURN.

Inside zprogram, there is a write to shared memory area (attach_for_write), and from the calling program it will read from the shared memory area (attach_for_read) written by zprogram.

The program works good in Dev, QA environment because there is only 1 app server. But in Production environment we have multiple app server.

Now, I encounter the exception CX_SHM_NO_ACTIVE_VERSION in Production and from what I read this is because the active shared memory is not found and possibly because of multiple application server. Is it when we call SUBMIT (not to background job) the called program could run in a different app server than the calling program?

If yes, is it possible to ensure the called program to run in the same app server? I found this thread, and suggested to call RFC to the same app server destination. If this works, I plan to get the current app server the user is logged in to from table USR41, and create an RFC FM where inside the FM it will SUBMIT the zprogram.

The problem is because I have no environment to test this behavior since my Dev, QA environment only have 1 app server. I need to ensure this is working without thorough testing.

Thank you.

4 REPLIES 4
Read only

laxmi_jibhe
Explorer
1,433

Hi ,

Use below statement for shared Memory

Export [Value] to Database INDX(ST) ID 'ZMEM'.

Import [VALUE] from Database INDX(ST) ID 'ZMEM'.

It will work for different app Server.

Read only

0 Likes
1,433

shared memory!? No, memory means that it's server-dependent.

The statements you propose do work with the database.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,433

A word about the dispatching to several application servers: a context may be redispatched to another server when a roll in happens. The context is rolled out only during a COMMIT WORK, the display of a screen, and a few other cases... A SUBMIT does not execute a roll out, but the display of the selection screen does one. I don't think there's a way to force to remain on the same application server (and what would you do if there's a planned or unexpected server stop?), but who knows.

Read only

laxmi_jibhe
Explorer
0 Likes
1,433

If possible , Can you share your code how you had moved and retrieved data from shared memory