cancel
Showing results for 
Search instead for 
Did you mean: 

external context mapping with CID

Former Member
0 Kudos

I have a component interface definition CID_A and a Main-Component M.

At runtime one child component of CID_A should get an input in its view and put this value in the context of M. so I need external (reverse) context mapping.

the component of CID_A determines the attribut in the (global) context of M.

but how can I declare this attribut as externally mappable? the option "isInput-element" is not available in the interface controller of cid_a and in the components which implement cid_a it is deactivated and grayed out.

what can I do to realise external mapping from the implementing component of cid_a to the mothercomponent M?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hmm I got another problem now....

I make the following steps like the posting from regina breuer:

"

- A is the outer component and embeds B, then A has a component usage of the B.

- You declare the node in A quite normal, e.g. in your component controller.

- You declare the node in the component controller of B with "IS_INTERFACE = X" and "IS_INPUT = X".

- Then you go to component A, choose the compent usage of B in the navigation tree of component A, expand it and there you declare the mapping. Declare the component controller (A) as the used controller, then you see it on the right.

Drag the node from the right to the node on the left, and the mapping is declared correctly."

I allways get the error at runtime that my mapping to the node COMPONENTCONTROLLER.1.xy wasn´t completed. xy is the node which I declare as ext.Input and Interface-node in my cid-implementating component.

Is it really possible to make external mapping with a cid-implementating component?

Former Member
0 Kudos

Hi again.

I need more info about your design. When you have A and B which one is the interface component?

Do you define a usage to the interface component and set the used component dynamically?

Or do you set a "hardcoded" usage to a component that implements the interface component?

Cheers,

Sascha

Former Member
0 Kudos

>>I need more info about your design. When you have A and B which one is the interface component?

A and B were from the example from another post.

I got a main-component M and several cid´s (A-C).

>>Do you define a usage to the interface component and set the used component dynamically?

Or do you set a "hardcoded" usage to a component that implements the interface component?

yes M is at designtime using all the cid´s and creates the component_usages of the chosen cid-implementing components at runtime and I think I have an idea whats my fault with my external mapping.

one step was: "Then you go to component A, choose the compent usage of B in the navigation tree of component A, expand it and there you declare the mapping. Declare the component controller (A) as the used controller, then you see it on the right."

I created this step at designtime and made it in relation to the cid and not to the really created cid-implementating component and this should be the fault because at designtime it´s not clear which component is chosen.

so I have to make all the external mapping directly to the chosen components dynamically at runtime...who knows how to make an external mapping at runtime? i need a codeexampel.

or sascha am I at fault?

Former Member
0 Kudos

So you have one interface component IF_C which has the external input node and several components which implement IF_C which should be filled thru external mapping thru component M, rite?

Then it should work dynamically without problem.

Just go through this thread:

https://forums.sdn.sap.com/click.jspa?searchID=4795366&messageID=3464722

This should be not a problem

Former Member
0 Kudos

>So you have one interface component IF_C which has the external input node and >several components which implement IF_C which should be filled thru external mapping >thru component M, rite?

my scenario:

IF_A has two cid-implementating components a1 and a2 which are chosen at runtime.

a1 or a2 should fill the context of the main-component M via external context mapping. M should hold the global context and share the attribute (from the external mapping of IF_A) to other CID´s (let´s call them IF_B - IF_C). Another IF_L handels the layout from all components.

I think I did it that way from the following seven steps from your link but I will look tomorrow at work:

"1. Define the interface component with context node (Input Element Externl)

2. Create a component which defines a usage to the interface component

3. Go to the component usages folder and open it.

4. Right click on the usage you just created and choose Create controller

usage.

5. Double click the interfacecontroller_usage you just created.

6. Here you can add a controller usage using the button at the top.

7. Now you should be able to define the external mapping by dragging the node of

the component controller to the interfacecontroller_usage node."

it´s a litte bit difficult in my scenario because the at runtime chosen components from IF A-C are shown in a window in M (handelt from if_L) and the attribut which I want to use for external mapping is bound to a input field in the view from the components a1 and a2. the input to that field should modify the output in the views from the components from IF_B and IF_C. could this be the fault? that I bound the attribut for external mapping in designtime to an ui-element? I realised this so far only at a1 and when I chose a2 (without that bound ui-element) testing my component works without faults.

thanks and until tomorrow...

Former Member
0 Kudos

Oh ok.

Now i see you should not use reverse context mapping but direct context

mapping, because you want to map the context of the used component into the

using component not vice versa.

Go to the component controller of M and add a controller usage with the button at

the top of the context nodes. Here you can choose the componenet usage IF_A.

On the right site you will see the context of IF_A which can be used now.

But uncheck the flag input ext. in the node in IF_A. It should only be set to

interface node.

If you want to use the context of IF_A in any view of M just go to the view

controller context and perform the same steps.

Hope this helps,

Sascha

Former Member
0 Kudos

thanks again sascha for your answer...

I have read again

sap help: External Context Mapping (but I have to admit I read it in german )

and you are right:

"A node of the interface controller context marked in such a way (-> external mapping) can be linked with a context node of a used component and then receives the relevant values from the context node of the using component A only at runtime."

Sure its vice versa in my scenario...thank you very much and you´ll receive points

Former Member
0 Kudos

you are welcome, whatever language you used to read SAP Help

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thorsten.

Any node in an component interface can be enabled as input element (external). In my interface this option is not grayed out.

Which SP are you on?

Cheers,

Sascha

Former Member
0 Kudos

thanks sascha,

you are right...in the cid-implementating class its grayed out but in the cid itself you can change it via right-mouseclick on the node and then change...I found the option now too.