on 08-02-2012 5:23 PM
Hi Experts,
I am trying to call a custom webdynpro component from a standard WD component.
The call is in a loop. so sometimes it opens the same custom webdynpro component twice.
I am facing an exception while opening the same component twice.
"web dynpro instance of the view zb_new already exists in component" is the message and exception is cx_wdr_rt_exception.
Is it possible to open the same webdynpro component twice in the same instance. If yes please provide the solution.
How will the context hold different values in this case. External pop up is not required by client.
I already searched the forums but none of the threads has complete solution.
Thank you in advance.
Regards
Sandeep.
Hi Sandeep,
A runtime error will occur if an active component already exists for the component usage. In your loop before creating the component, call IF_WD_COMPONENT_USAGE->HAS_ACTIVE_COMPONENT to first check if the component already exists. Then only create the component if the method returns false.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandeep,
See if this SAP Help document on Dynamically Creating Component Usages helps you. It describes how to display an interface view of a used component more than once. The gist of the document is to create a new component usage within your loop using method CREATE_COMP_USAGE_OF_SAME_TYPE and to work with the unique component usage within the loop.
Cheers,
Amy
Sandeep,
as you mentioned, you are creating component usage inside the loop,,, which not required.
create component usage before starting the loop. else do follow..
data: lv_count type i value 0.
loop .....< >
if lv_count eq 0.
<<< Create Component Usage >>>
add 1 to lv_count.
endif.
endloop.
hope it will help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.