cancel
Showing results for 
Search instead for 
Did you mean: 

cascading dynamic reverse context mapping

Former Member
0 Kudos

Hello folks,

I have a Situation as follows:

WebDynpro component A: My main component

Component A uses the SAP select-option component (B) WDR_SELECT_OPTIONS.

Furthermore I have implemented a search help / calue help component (C), which is used in component B.

Now I have to pass data from component A to component C: because the values of the search help should be restricted by a value that has already been entered in component A (search help enables the user to select a vendor, but only vendors of the country that has already been selected should be displayed).

How to achive this? I know that it is possible to create mapping nodes dynamically during runtime (method ADD_NEW_MAPPED_CHILD_NODE of interface IF_WD_CONTEXT_NODE_INFO). The problem is, that i am not able to pass a reference of the component controller (component C) to the SET_MAPPING_COMPLETE method. In case to do not execute the SET_MAPPING_COMPLETE method, the WD runtime assumes, that the node i mapped is located in the local context, but because of the different components it is located in the remote component (external context). Accessing the mapping node within component A (which is mapped to component B and in turn to component C) leads to a short dump saying

Subnode COMPONENTCONTROLLER.INTERFACECONTROLLER does not exist

See Thread for details of the usage of the search help component and the select-option component.

THX

--MIKE

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Mike,

Is it possible that you create an attribute in component A and

the same attribute in component C? . Populate the attribute of component A with the value you want to pass. When you fire outbound plug ( from A to C), fire it with parameter and pass that attribute. Accept that value as import parameter in the handler method of inbound plug of component c. I hope it will help.

Former Member
0 Kudos

@Thomas:

I used to use EXPORT / IMPORT statement a lot in former times, but in ABAP-OO I try to avoid it´s use if possible, because it somehow conflicts with the aspect of data encapsulation.

@Sharad:

Unfortunately, there is no outbound plug fired when executing a search help, as far as I know at least!

Former Member
0 Kudos

Hi Mike,

you said, youu2019d prefer the ABAP-OO way over the EXPORT u2026 TO MEMORY. The singleton pattern might well be the path to follow: [http://en.wikipedia.org/wiki/Singleton_pattern]

As long as the user stays in one Web Dynpro Application a singleton can easily be accessed from every class and via this way it is also possible to transfer references without the need of serializing them when working with the EXPORT statement.

Cheers

Silke

Former Member
0 Kudos

Hi Mike,

possibly using a singleton that is filled be comp A and read by comp C can do the trick?

Silke

Former Member
0 Kudos

Hi Silke,

thanks for your suggestion, but I don´t think that this will fix my problem ;-(

Former Member
0 Kudos

I found a kind of unpretty solution: Instead of setting the context attribute in component A I execute a


EXPORT ... TO MEMORY ID ...

and an

IMPORT ...  FROM MEMORY ID

in component C

-> it works. Nevertheless I am open to all REAL solutions for this issue!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Why would the EXPORT, not be a "real" solution? These statements are good solutions for cross object communication within the same session stack. They were commonly used for similar problems in classic dynpro days.