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

Error in shared memory access after recompiling unchanged source

rainer_hbenthal
Active Contributor
0 Likes
1,075

Hi,

i made this report for storing values in the shared memory:


REPORT  zca_sw_shm_write4 line-SIZE 255.

DATA:
  myshmhandle            TYPE REF TO zca_shm_repstat_area,
  wa_stat                TYPE zrepstat,
  repid                  TYPE progname,
  str                    TYPE string,
  cxr                    TYPE REF TO cx_root.

FIELD-SYMBOLS:
  <p>                    TYPE zrepstat.

repid = 'REPORT'.

TRY.
    myshmhandle = zca_shm_repstat_area=>attach_for_update( ).

    READ TABLE myshmhandle->root->it_stat WITH KEY mandt = sy-mandt report = repid
      ASSIGNING <p>.

    IF sy-subrc = 0.
      <p>-freq    = <p>-freq + 1.
      <p>-ldate   = sy-datum.
      <p>-ltime   = sy-uzeit.
      <p>-userid  = sy-uname.
    ELSE.
      wa_stat-mandt   = sy-mandt.
      wa_stat-report  = repid.
      wa_stat-freq    = 1.
      wa_stat-ldate   = sy-datum.
      wa_stat-ltime   = sy-uzeit.
      wa_stat-userid  = sy-uname.

      APPEND wa_stat TO myshmhandle->root->it_stat.
    ENDIF.

    myshmhandle->detach_commit( ).

  CATCH cx_shm_error INTO cxr.
    str = cxr->get_text( ).
    LOG-POINT ID zrepstat SUBKEY 'SHM' FIELDS str.
    write:/ str.

ENDTRY.

WRITE:/ 'Done'.

Running the first time, the instance will not be up, but its restarting automatically as desired. I missed the entry for that, but thats ok.

Running the report over and over again works fine, and the table is updated well.

But when i recompile the report without any changes(!) the instance is invalidet with the following error message:


The definition of a type of (data) object in the instance '$DEFAULT_INSTANCE$' 
in client '' for area 'ZCA_SHM_REPSTAT_AREA' does not match the type definition 
used in the attached program

Why do i get this error message by reactiving the report without any changes and how can i avoid this?

4 REPLIES 4
Read only

rainer_hbenthal
Active Contributor
0 Likes
659

Even this


    myshmhandle = zca_shm_repstat_area=>attach_for_update( ).
    APPEND wa_stat TO myshmhandle->root->it_stat.
    myshmhandle->detach_commit( ).

will work fine until a new activation wilol take place. I really dont understand why a new activation makes the area invalid. Anybod an idea?

Read only

rainer_hbenthal
Active Contributor
0 Likes
659

Does no one has an idea about this strange behaviour?

Read only

rainer_hbenthal
Active Contributor
0 Likes
659

no solution

Read only

0 Likes
659

Hello,

I believe that I have found the reason that this is happening.

If you go to transaction SHMA, select monitor, then find your SHMA, select it, and then go to the Areas menu and select delete from all servers. Then, re-run your program and you should no longer see this issue.

Regards,

Larry