cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing an assistance class in FPM UIBBs

ChrisPaine
Active Contributor
0 Kudos

Hello,

following from a post Thomas Jung in the WD ABAP forum

If you create the inner component usages in code you can pass a single instance of the parent component assistance class through to the child components. This is what the ASSISTANCE_CLASS importing parameter on the CREATE_COMPONENT method can be used for:

Is there any way to share assistance classes in the FPM - where the instantiation of the components is done by the framework?

I could see using a static variable in the assistance class to point to a single instance of the class, but, then I think that the availablity of the static variable would be greater than the current application scope????

Hints, suggestions?

Cheers,

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chris,

Would it not IF_FPM_SHARED_DATA serve this purpose ?.

One Web Dynpro component implements IF_FPM_SHARED_DATA and uses the Assistance class or any other Singleton OO class.

Use this WDA component as used component in other WDA components. By this way You can have one instance of Assistance class.

I am not sure if this helps. Probably you can search in this direction.

Regards

Senthivel

ChrisPaine
Active Contributor
0 Kudos

Hi Senthivel,

not really - because in order to access the shared class you would probably have to share it amongst the other components of the application through the use of shared context - using the context of the component marked as IF_FPM_SHARED_DATA.

I've done this and it was a pain to get the reference to the class each time from the context.

Another option would be to make it a public attribute of the shared component - but still not as simple a way to access it as using wd_assist->method( ).

What I was looking for was a more dynamic way of changing the reference to the assistance class used by the component.

Cheers,

Chris

Former Member
0 Kudos

Hi Chris

Did you eventually solve this issue? If so, do you mind sharing how?

I have the same question and am considering just creating a standalone singleton class to act as my "assistance class" but that seems to defeat the purpose of a real assistance class... (BTW, I've not tried creating a standalone assistance class yet so I'm not sure it's even technically feasible or makes sense)

Cheers

Glen