cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Popup

Former Member
0 Kudos

Hi,

I am trying a Program and in that i got three node kna1, vbak, vbap, and in that when i enter the Customer Number and its showing corresponding data in the Popup box in that i got a Button called Copy if i enter the Button its should copy the value of VBAK in the Table and i have written the Code in Action Copy ..... and also i need some reference code for Copy.....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Basha,

I am not getting what you are trying to do..?

Kindly bit more clear about your requirement...

Cheers,

Kris.

Former Member
0 Kudos

HI,

Thanks for your Quick Reply ,,, i am trying to do is when i run the program i will enter Customer Number it will open one Popup window in that i will select one data in the Popup window i got Copy button Once i press copy button it should copy the Coressponding values in the Table....

For this i used Two Views and Two Windows..... and also i wrote the code to display Popup window in View1..... but i am not Getting Copy..... i hope you Understand......

Former Member
0 Kudos

To share data between view's use context of component controller or attribute

Former Member
0 Kudos

Hi Basha,

Still bit confused.." but i am not Getting Copy " . What you want to copy and from where to where?

You want to copy selected rows from table? or someother.

Cheers,

Kris.

former_member199125
Active Contributor
0 Kudos

basha,

let me rephrase your scenario.

You have 3 nodes...

In your popup window, selected values should be copied to vbak node. right?

If yes, it's simple.

In your copy button action, read the selected row values, and pass it to node vbak.

let me know if you need any help on to copy the row value to node.

Regards

Srinivas

Former Member
0 Kudos

HI Sana,

Thanks for your Reply ... you are Right..... i need a Code to Copy the Row Value to the Node.... Please get me best Solution...

Former Member
0 Kudos

Hi Basha,

Code to copy selected records from one node to other.. You have to use get_selected_elements.

Here i am copying selected records from IT_LIPS node into PACK_MAT node.. Hope it works for u.



    DATA : wa_temp TYPE REF TO if_wd_context_element,
           lt_temp TYPE wdr_context_element_set.

* navigate from <CONTEXT> to <IT_LIPS> via lead selection
      lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DELCHANGE.CHANGING_3.IT_LIPS` ). // First Node

      CALL METHOD lo_nd_it_lips->get_selected_elements
        EXPORTING
          INCLUDING_LEAD_SELECTION = ABAP_true
        RECEIVING
          set                      = lt_temp.

      LOOP AT lt_temp INTO wa_temp.
        CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_it_lips.

              ls_pack-posnr = ls_it_lips-PICK_QTY.
              ls_pack_mat-packing_qty     = ls_it_lips-PICK_QTY.

              append ls_pack_mat to lt_pack_mat.

* navigate from <CONTEXT> to <PACK_MAT> via lead selection
      lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).  //Sec node

*     wd_comp_controller->item is initial.
        lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
                                    SET_INITIAL_ELEMENTS = abap_true ).

Cheers,

Kris.

former_member199125
Active Contributor
0 Kudos

Hi Basha,

follow kris solution or check also below one( transferring selected rows from node1 to node 2 ).

data count type i.

data pos type i value 1.

count = lo_nd_itab1->get_element_count( ).

do count times.

if lo_nd_node1->is_selected( index = pos) = abap_true.

lo_el_node = lo_nd_node1->get_element ( index = pos ).

lo_el_itab1->get_static_Attributes( importing static_attribute = ls_node1 ).

lo_el_node2 = lo_nd_itab->create_element( ).

lo_el_node2->set_Static_attributes( exporting static_attributes = ls_node1 ).

lo_nd_node2->bind_element( new_item = lo_el_node2

set_initial_elements = abap_false ).

pos = pos+1.

enddo

if nod1 and node 2 structures are different, then replace bold code with below code.

LO_EL_Node2 = lo_nd_node2->create_element( ).

ls_node2-pernr =xxxxxx.

ls_node2-grade = ls_node1-grade

ls_node2-ORGANIZATION = ls_node1-organization'.

ls_node2-LOCATION = 'xxxxxx'.

lo_el_node2->set_static_attributes( exporting static_attributes = LS_Node2).

lo_nd_node2->bind_element( new_item = lo_el_node2

set_initial_elements = ABAP_FALSE ).

regards

srinivas

Former Member
0 Kudos

Hi Kissna,

Its Working Fine now and your Code is Very Helpful. Thanks a Lot.

And i got One more Doubt i need to Validate the Input and i have to show the Error Message and i know its Simple and i am Just trying in if_wd_message_maanger. but if i Enter Wrong Sale Order Number it should throw the Error.

Regards,

Sadiq.

Former Member
0 Kudos

Hi Sara,

Thanks for your Response i have try Kissnas Code ,, its Working Fine. But i have Given you a Point.

Regard,

Sadiq.

Answers (0)