2010 Jul 15 5:50 AM
Hi Experts,
I have a scenario from wherein I am fetching a huge set of data using RFC. I want to store this data(in internal table format) into SAP Shared memory, so that I can access this data as and when required.
Can you please suggest me as to how to store data into SAP Shared memory and how to retrieve them.
Thanks & Regards,
Ritwik.
Hi Experts,
I have a scenario from wherein I am fetching a huge set of data using RFC. I want to store this data(in internal table format) into SAP Shared memory, so that I can access this data as and when required.
Can you please suggest me as to how to store data into SAP Shared memory and how to retrieve them.
Thanks & Regards,
Ritwik.
2010 Jul 15 5:53 AM
Ritwik,
please search scn and google
http://help.sap.com/abapdocu_70/en/ABAPEXPORT_DATA_CLUSTER_MEDIUM.htm
Thanks
Bala Duvvuri
2010 Jul 15 7:21 AM
Hi
If you are using SHMA (Shared memory area concept ),
U will have to create a class for that purpose suing T code : SHMA .(WIll generate a shared memory for your internal table ),
a root class wil lbe genrated , Define a Table structure in the ATTRIBUTE of that class .
And u are ready to use this Internal table wer u want to .
Regards
Swapnil
2010 Jul 15 10:19 AM
Hi Swapnil,
Thanks for the quick reply.
I tried the transaction, but the usage is still not clear as to how to use this class and its attributes. Can you please give me some examples or some scenario where shared memory is used so that I can get some pointers on that and start the developement.
Thanks & Regards,
Ritwik.
2010 Jul 15 10:41 AM
HI
Goto SHMA --> give a class name u want to use >>>create >>>give a root class name u want to create >>>>>just foll th procedures .
It will directly take u to ROOT Class Created . In the attribute section please check on SHARED MEMORY CLAS in GENEARKL DATA tab . Just generate the Class .
EXAMPLE ::::::
Zkomv :Defined table type
IT_price : Internal Table u want to use .
ZCL_PRICE_ROOT :: Root class created .
ZCL_PRICE_AREA : Shared memeory area create .
DATA : IT_PRICE TYPE ZKOMV,
WA_PRICE like line of IT_PRICE .
DATA : ROOT TYPE REF TO ZCL_PRICE_ROOT .
DATA : HANDLE TYPE REF TO ZCL_PRICE_AREA.
TRY.
HANDLE = ZCL_PRICE_AREA=>ATTACH_FOR_READ( ).
.
CATCH CX_SHM_INCONSISTENT .
CATCH CX_SHM_NO_ACTIVE_VERSION .
CATCH CX_SHM_READ_LOCK_ACTIVE .
CATCH CX_SHM_EXCLUSIVE_LOCK_ACTIVE .
CATCH CX_SHM_PARAMETER_ERROR .
CATCH CX_SHM_CHANGE_LOCK_ACTIVE .
ENDTRY.
ROOT = HANDLE->ROOT.
MOVE ROOT->PDATA TO IT_PRICE.
BREAK-POINT.
LOOP AT IT_PRICE INTO WA_PRICE .
WRITE : WA_PRICE-KWERT .
ENDLOOP .
USING THE PROGRAMME any wer :
DATA : IT_PRICE TYPE ZKOMV.
DATA : WA_PRICE LIKE LINE OF IT_PRICE .
DATA : HANDLE TYPE REF TO ZCL_PRICE_AREA.
DATA : ROOT TYPE REF TO ZCL_PRICE_ROOT.
DATA : RC TYPE SHM_RC.
*SELECT * FROM komv INTO TABLE ITAB UP TO 10 ROWS.
BREAK-POINT.
TRY.
CALL METHOD ZCL_PRICE_AREA=>FREE_AREA
EXPORTING
TERMINATE_CHANGER = ABAP_TRUE
RECEIVING
RC = RC.
CATCH CX_SHM_PARAMETER_ERROR .
ENDTRY.
TRY.
HANDLE = ZCL_PRICE_AREA=>ATTACH_FOR_WRITE( ).
CATCH CX_SHM_EXCLUSIVE_LOCK_ACTIVE .
CATCH CX_SHM_VERSION_LIMIT_EXCEEDED .
CATCH CX_SHM_CHANGE_LOCK_ACTIVE .
CATCH CX_SHM_PARAMETER_ERROR .
CATCH CX_SHM_PENDING_LOCK_REMOVED .
ENDTRY.
CREATE OBJECT ROOT AREA HANDLE HANDLE.
MOVE IT_PRICE[] TO ROOT->PDATA[].
TRY.
HANDLE->SET_ROOT( ROOT ).
CATCH CX_SHM_INITIAL_REFERENCE .
CATCH CX_SHM_WRONG_HANDLE .
ENDTRY.
TRY.
CALL METHOD HANDLE->DETACH_COMMIT.
CATCH CX_SHM_WRONG_HANDLE .
CATCH CX_SHM_ALREADY_DETACHED .
CATCH CX_SHM_SECONDARY_COMMIT .
CATCH CX_SHM_EVENT_EXECUTION_FAILED .
CATCH CX_SHM_COMPLETION_ERROR .
ENDTRY.
Hope it helps .
Regards
Swapnil
2010 Jul 15 10:53 AM
Hi
please follow the link http://help.sap.com/saphelp_sm32/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm
2010 Jul 15 7:43 AM
I have a scenario from wherein I am fetching a huge set of data using RFC. I want to store this data(in internal table format) into SAP Shared memory,
This is not a good scenario to use shared memory as data are stored on Application Server side. Therefore huge volume of data will cause low memory issues. It is recommended for small set of data not big ones. So I suggest to go for custom table creation and storing these data directly in DB.
If you persist of using them please refer [Shared Objects|http://help.sap.com/saphelp_sm32/helpdata/en/14/dafc3e9d3b6927e10000000a114084/frameset.htm], but consider the performance of the AS.
Regards
Marcin
2010 Jul 15 10:34 AM
SUBMIT YOUR RFC CALL exporting list to memory and then retrieve by id.
2010 Jul 15 1:01 PM
Ritwik use a sppo/text file rather.Why you want to go so complicated man.
2010 Aug 03 7:40 AM
Hi Aditya,
Can you please let me know the usage and how it will work in my scenarion.
Thanks & Regards,
Ritwik.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |