cancel
Showing results for 
Search instead for 
Did you mean: 

Context binding of property ?

Former Member
0 Kudos

The purpose of my ABAP WebDynpro is to display a table on the first screen and select a row (this works fine). Then select an action button that will display this single row in a popup window. I have all of my views for the two screens built and embedded into the main window. Also, my outbound and inbound plugs are set as well.

When I select the action button I can break into my logic. When the execution of the fire outbound plug occurs the following message below is displayed. I know that there must be an issue with either the binding of the receiving structure related to passing the context, Node, or element. But I cannot be sure. My code for the action button is below.

Also, ls_ready has the values in it when the plug gets fired. Thanks.

Error Message =>

"Error in LABEL "ZGRP_DELIVERY_INFO_WERKS_SH_2" of view "ZWD_TRANSVIEW.ZVW_POPUP_PGI":

Context binding of property ? cannot be resolved: Node ZVW_POPUP_PGI.1.ZND_READY does not contain any elements"

method ONACTIONCREATE_SHIPMENT .

  DATA lo_nd_ready TYPE REF TO if_wd_context_node.       "node
  DATA lo_el_ready TYPE REF TO if_wd_context_element.    "context element
  DATA ls_ready type wd_this->element_znd_ready.         "element

* Get the selected node/element via lead selsction
  lo_nd_READY = wd_context->get_child_node( name ='ZND_READY' ).
  lo_el_ready = lo_nd_ready->get_element( ).

* get all declared attributes
lo_el_ready->get_static_attributes(
  IMPORTING
    static_attributes = ls_ready ).

*Display the record in the new view
wd_this->fire_OUT_CREATE_SHIPMENT_plg(
znd_ready = ls_ready ).

endmethod.

Edited by: Tom Matys on Jan 30, 2012 3:54 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Tom, how do you populate ZVW_POPUP_PGI.ZND_READY node? By context mapping or binding to some structure explicitly?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Tom,

I think the cardinality of the node ZND_READY is other than 1 : 1 . This might be the problem.

And also as you told you are using table in the first screen its better to take two different nodes one to

display table data with cardinality 0:N and other to display single row with cardinality 1 : 1.

So on selection of row get the selected row using GET_STATIC_ATTRIBUTES_TABLE and

GET_LEADLSELECTION_INDEX and bind this data to the 1 : 1 node and display it using label in popup.

Remeber that the label for property of LABEL UI must be bound to some UI element and the text property

must be bound to node with cardinality 1:1.

Former Member
0 Kudos

Thank you all for great suggestions.

I have seem to get a little closer. I redefined my binding since Maksim asked, and I used 1 to 1 per Sanasrinavas. So now I get my popup screen, but the values that I see in ls_ready are not in the popup, maybe this is related to one of Harshithu2019s comments?

I see the data in ls_ready, my plugs are created? Any suggestions? The layout was created using a container form.

Cardinality is 1 to 1

selection is 0 to 1

Also, I notice that when I check refto ZND_READY in my outbound plug,and syntax check, it says, that ls_ready is not compatible with ZND_READY. When I uncheck refto it syntax checks OK?

Thank-You

Edited by: Tom Matys on Jan 31, 2012 10:43 AM

Edited by: Tom Matys on Jan 31, 2012 10:46 AM

Edited by: Tom Matys on Jan 31, 2012 10:49 AM

Former Member
0 Kudos

Do I need code to receive the structure in the new screen or will the firing of the plug fill ZND_READY (context?) from ls_ready (populated structure)? Because when I put a breakpoint in the new screen in inhandle_event. I do not see the values of the fields in the structure I am trying to receive, that were passed using the plug? Thanks.

Edited by: Tom Matys on Jan 31, 2012 11:20 AM

Former Member
0 Kudos

Hi Tom,

As you told that in the inhandle_event you will get the ls_ready which you passed from the first screen

now you need to bind this to your node which is used to populate data in popup.

so just bind ls_ready to the node. you will get the values.

Former Member
0 Kudos

The structure is populated when firing the outbound plug, no problems there.

How do I know that the inbound plug has received them? Does ls_ready have to be defined globally in the component controller? For the inhandle event I am debugging in the WebDynpro debuufger and do not see any context passed?

Here is my code below for the inevent of the new screen I get this error message where noted below:

Invalid operand type for the MOVE-CORRESPONDING statement.

METHOD handlein_create_shipment .

  DATA: node_znd_ready TYPE REF TO if_wd_context_node.
  DATA: elem_znd_ready TYPE REF TO if_wd_context_element.
  DATA: STRU_ZND_READY TYPE IF_ZVW_POPUP_PGI=>ELEMENT_NODE_IN_READY.

*navigate from <context> to <znd_ready> via lead selection
  node_znd_ready = wd_context->get_child_node( 'NODE_IN_READY' ).

*get element via lead selection
  elem_znd_ready = node_znd_ready->get_element( ).   <===ABENDS HERE WITH THAT ERR MSG ABOVE

* get all declared attributes
  elem_znd_ready->get_static_attributes(
  IMPORTING
    static_attributes = node_znd_ready ).


ENDMETHOD.

Thanks and please excuse my inexperience with WebDynpro.

Former Member
0 Kudos

Hi Tom,

To transfer data between views,

1) Declare an outbound plug for source view along with a parameter whose data you need to pass.

you can pass the data into this parameter when you fire the plug.

2)Declare an inbound plug for target view along with parameter(NAME AND TYPE of parameter must be

same as the parameter name in outboundplug).

3)Then in onhandle event of inbound plug you will have your plug parameter as importing parameter and

also the data you have sent will be available . Now just bind this data to your node.

Also you can find some info in follwing link:

http://www.saptechnical.com/Tutorials/WebDynproABAP/views/navigation.htm

former_member199125
Active Contributor
0 Kudos

Hii

What is the collection cardinality of ZND_READY? make it 1:1

and make sure you have used ZGRP_DELIVERY_INFO_WERKS label as "label for property of another ui element. It must be related to some other ui element , say...input field.

Regards

Srinivas