cancel
Showing results for 
Search instead for 
Did you mean: 

Data Sharing Using Singleton Class pattern between FM/Report and WDC

former_member197475
Active Contributor
0 Kudos

Hi Experts,

I have followed the below link to share data(ABAP class Singleton property) between two WDCs. Of-course no doubt it is working well.

I implemented the same logic, (ie) created the instance and set the value to the class attributes from FM and in WD component I tried to get the attribute values.

But it is not working. Am not getting the attribute values in WDC which have been already set in FM.

My doubt is, whether this data sharing will work only between two WDCs and not from any FM/Report to a WDC, else am I missing something? Please clear out my doubt.

With Regards,

Ramakrishnan M.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi RK,

The singleton class ensures that only one object exists for every internal session.

Here in your case your calling fm in session 1 and wda in other session.  Hence the objects delivered from class are different.

Instead you can call fm from wda application or call wda in your report to make sure that both are in same session.

Hope this helps you.

Regards,

Rama

former_member197475
Active Contributor
0 Kudos

Hi Rama and Kiran,

Thanks for your reply.

I have created a WDA and assigned it to a T-Code. Am calling that T-Code from FM. So I think the sessions are different and that's why am not getting the instance attribute values in WDC, which I have been set in the FM.

Correct me if I were wrong.

WR,

RAM.

former_member184578
Active Contributor
0 Kudos

Hi,

Yes. Here the WDA application will open in different session.Hence you couldn't get the values( which creates new instance).

So, as mentioned earlier, use Shared Memory ( or if you want to access few values pass the data via URL parameters )

Regards,

Kiran

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

I implemented the same logic, (ie) created the instance and set the value to the class attributes from FM and in WD component I tried to get the attribute values.

Does your FM and WDA component share the same session? . The static instances share across all instances within this internal session but not across cross application sessions.

That is why, the is Shared Object concept which has the instance across the Application server. Check this doc for reference:

Hope this helps u,

Regards,

Kiran