on 07-05-2014 5:03 AM
Hello,
I am try to find a way to get reference to instances of used components created by OIF FPM. My scenario is as follows.
Now since FPM framework creates an instance of componentA and component B creates another instance of componentA ( usedcomponentA)
My changes are not getting synced as required.
Does anyone know if there is a way to get the instance of the used component which FPM is using so that there is only only instance of the used component and thus no discrepency. I have done this with custom compoents but so far found no way of doing the same with FPM.
Note: i know my issue can be easily resolved using SDC or singleton class. However i was curious to know how to deal wth multiple instances of same used components when FPM is creating one of the instances.
Cheers,
Vivek
I hope the above image provides better clarity for my question. I am trying to get reference to the used component marked X and highlighted ( ZWDR_TEST_SEARCH_HELP_ZWDR_TEST_SEARCH_HELP_CONFIG_00_ ). If i can get this instance i can set my component usage USER_SEARCH to reference it and this way there will be just one instance in momory.
Cheers,
Vivek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vivek,
for such scenarios FPM offers method IF_FPM->ATTACH_COMPONENT_TO_USAGE. When
you call this method from component B and pass the component name and it's config id as well as the usage you want to get it attached to, FPM checks if component A is already instantiated and if yes attaches the existing instance to the passed usage and if not creates a new instance.
Best regards,
Christian
Hi Christian,
I have a question on a related issue. I created another FPM applicaiton and the used components in this case are using SDC to share data. The used component (SDC) created by the used components of FPM_OIF_COMPONENT are referenced and hence data is passing between them.
However when used component USER_SEARCH of Component ZWDR_TEST_SHLP_USED_COMP2 ( please check attached image ) is created it in turn creates a used component SDC which is not referenced to the primary SDC component (ZWDR_IF_SDC).
I am able to get over this issue by using IF_FPM->ATTACH_COMPONENT_TO_USAGE( ) as you suggested in your answer. However i was under the impression that SDC is always a singleton class so all instances of the component in a session will always be linked?
Cheers,
Vivek
Hello Vivek,
a shared data component is not a singleton (it's a component provided by the application - therefore a framework has no chance at all to enforce it being a singleton).
FPM simply takes care of instantiation of the SDC. Prerequisite that this works is that the application doesn't instantiate it on it's own. So simply declare a static usage to your SDC for each involved UIBB and FPM will take care of instantiation and that all usages get the same SDC instance assigned.
There is one big drawback when using SDC. It doesn't work with GUIBBs. The SDC concept was introduced with the very very first FPM release (only available SAP internally) and with the first public release it was already more or less obsolete. So using SDC is perfectly ok, but if you ever want to integrate a GUIBB you will have to redesign your application.
Best regards,
Christian
Works like a charm. Thanks Christian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
Hope you're instantiating the used component in your code. While instantiating,you'll get the reference of the used component.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katrice,
Yes i am instantiating the used component and that is giving me instance of used component. But the issue is at runtime there are two instances of the component : 1 created by the FPM framework and the other created by component. How can i get hold of the instance created by FPM.
Cheers,
Vivek
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.