cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Shared Objects & POWL

shwetars
Advisor
Advisor
0 Kudos

Hello,

I have created a POWL and in the get_objects I am fetching the objects from the ABAP shared memory. I have created a shared memory area 'zcl_shm_area_01'and a root class 'zcl_shm_area_root_01' for it, also i have implemented the method build of the interface if_shm_build_instance to enable auto-preload.

Whenever I create a new query or refresh an exisiting query after a change i get an exception cx_shm_inconsistent.

within the get_objects method i first try to read_from_memory by getting a handle to the root area and reading the attributes from it, only if the selection criteria of the query changes i do a update_from_memory to refresh my shared memory area with the latest data from the DB and show the same in the POWL.

Can anyone please help me resolve this issue?

Let me know if further inputs are required.

Regards,

Shweta

Accepted Solutions (0)

Answers (2)

Answers (2)

shwetars
Advisor
Advisor
0 Kudos

Thanks a lot frnds...

Madhu2004
Active Contributor
0 Kudos

Hai Shwetha,

one small clarification:

where u are changing the query,in the program or in the input selection?

Can u plz let me know the scenario?

Cheers,

Madhu

shwetars
Advisor
Advisor
0 Kudos

Hi Madhu,

I change the query in the input selection. This automatically calls the get_objects method of the POWL feeder class.

The scenario is i display of list of records from the spfli table based on a carrier id specified as part of the selection scriteria. I store these records in the shared memory and always read from there, the shared memory is refreshed with correct whenever the input selection i.e. carrid changes.

Regards,

Shweta

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You must remember to delete any instances of shared memory object using transaction SHMM any time there has been a change to the root.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Shweta,

The exception cx_shm_inconsistent is occuring due to that fact that the already existing shared memory instances root is being changed when the selection criteria gets changed.

inorder to avoid this exception, what you can do, is to delete the already existing shared memory instance and create a new instance and store the new data in it.

Hope this solves your problem.

Regards

Ajith V