cancel
Showing results for 
Search instead for 
Did you mean: 

Reused components along with Assistance Class

Former Member
0 Kudos

Hi,

I have a scenario at my client where I have a WD application that reuses a few WD components of varying complexity. The main WD application as well as the reused components makes use of the same assistance class. Which works great for reusing complex methods between the main WD Application and its components it reuses. This however leads to an issue when you wish to store DATA in your assistance class.

The scenario is as follows;

  1. The Main WD Application is called and initiates the assistance class
  2. The Main WD Application call a couple of Metods in the assistance class and then also "SET" to store some data in the assistance class object.
  3. One of the reused components (a window with a couple of views in it) is called
  4. In the reused component then has GET methods that are called to read some of the data stored in the assistance class object.
  5. ERROR the data that was read is initial

The problem is that the 2 assistance class object don't know of one another and is two separate instances of the assistance class.

The question I thus have is, is there a way to share the WD_ASSIST object between all the components? The data that is stored in the assistance class is complex and it will not make sense to try and store it as context elements which is then share between the components' contexts.

Thanks and regards

Chris

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Chris,

Yes, it's possible to share an instance of the assistance class across components. Check out the section Shared Use of an Assistance Class Instance in SAP Help document, Working with the Assistance Class. Also check out demo component DEMO_COMMON_ASSISTANCE1 in your system.

Cheers,

Amy

Answers (2)

Answers (2)

Abhinav_Sharma
Contributor
0 Kudos

Hi Chris,

THere is another way out also, that you can try. Refer blog - Data sharing between multiple WD component using same assistance class

Hope this helps.

Cheers!

Abhinav

former_member195270
Active Participant
0 Kudos

The best way to do it is store data in context elements.Context elements can store very complex data.