‎2009 Feb 10 8:38 AM
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?
‎2009 Feb 10 11:13 AM
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?
‎2009 Feb 11 6:41 AM
‎2009 Feb 27 9:57 AM
‎2011 Jun 24 9:25 PM
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