cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation back and forward between two component controllers and store val

Former Member
0 Kudos

Hi All,

I have 2 WebDynpros (A & B) that the second (B)is in a component usage of the first one (A). When I trigger the second webdynpro (B) I'm passing a value in the PLUGs (outbound to Inbound Plug) from the first webdynpro (A) and I'm populating data in (B) then I want to go back to (A) and do some other stuff but then I decided to go back to (B) again (second time), Here I don't want to do the same process again because I did it once (the first time I went to (B). So I don't want to hit the database again if I have that info from the first time I went in.

I'm trying to stored data in an Attribute the first time I go to (B) and I store it but the second time I come to (B) is empty so I need to do the same process again.

Is there a way to store the data and don't get wipe-out? Or my only solution will be always navigating with the values thru the plugs which is tedious.

thanks for the answers!

Jason PV

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi

for both components A & B you can use the same assistance class and store the value as a static attribute of assistance class.

Regards

Manas Dua

Former Member
0 Kudos

Manas - thank you for you reply, I never used an assistance class nor have an idea of what is an assistance class, can you help me more, more guidance please.

thanks!

Jason PV

Former Member
0 Kudos

Refer the SAP Online help :

http://help.sap.com/saphelp_nw70/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm

Standard Component :

DEMO_COMMON_ASSISTANCE1

Former Member
0 Kudos

It looks like Assistance class allow you to store text with initial values but I want to store an itab that will get populated dynamically and different with every user that trigger the application.

User 1 triggers A and click a custom button that triggers B (internal table gets populated with info from user 1 "at that particular moment - info can change every day or minute") and itab will populate ALV grid of B, then I select a row of B (Is another user - user 2 - under my chain of command) and I click custom button to view his ALV grid (same alv that (A) at the beginning show for me but for that user2 with info of that user so I will call it A-2) then I want to go back to (B) from A-2. B is always the same for me because I'm the sy-uname that is triggering the whole application.

I want to display same data that internal table had the first time I went from A to B, only difference is that I'm coming now from A-2 to B.

All the process, I'm able to do it but ITAB gets clear every time I leave (B) and because I already have all the data in ITAB once, (when I went from A to B the 1st time) I don't want to hit data base again just to receive the same data.

If user want fresh data, there's a button in B that says "REFRESH" and that will hit database but for performance issues I want to store that ITAB in some place and then when I come back if the itab is not initial skip database SQL.

Thank you for your help!

Jason PV

Former Member
0 Kudos

Hi Jason,

Try this approach,

Create a class ( not the assistance class ), create a public instance attritbute which will store the table data per user.

Now in component A when you first fill the data per user, craete an object of the class and store the data for that object.

Now when calling component B pass the object reference and fetch data there.

This way, you data would be stored per user specific as when you launch component A for first time an object of that class will be created which will store your data.

Hope this helps

Regards

Manas Dua

Former Member
0 Kudos

Manas - The object is empty the second time I come in (like is never been trigger before).

Any other Idea?

thanks!

Jason PV

Former Member
0 Kudos

Hi Jason,

Are you storing the reference of object in some component controller attribute.

Also check on this that if you are coming back to main view you are not creating the object again. When coming back you have to use the same object created when you launched the main component.

Create an object in WDDOINIT of comp controller of A, store the reference of created object in comp controller attributes.

When coming back again use the same attribute.

To achieve ur desired functionality there is another way of using [Faceless Components|http://help.sap.com/saphelp_nw04s/helpdata/EN/77/3545415ea6f523e10000000a155106/frameset.htm] which just hold the data, but the basic idea of faceless components is again a class holding the data.

@ thomas: can you suggest a way.

Regards

Manas Dua