cancel
Showing results for 
Search instead for 
Did you mean: 

Codes for making slection based on select options.

Former Member
0 Kudos

Hi All,

Am very very new tp web dynnpro, I made one small program by seeing the tutorial. I have a parameter option on the screen and then a button. And below that is a table displayed.

When you click on the button the table should get filled with all the datas from VBAK table based on the vbeln value from the parameter.

the code that I wrote is

method ONACTIONGET_VBAP .

data:

vbak_node type REF TO IF_WD_CONTEXT_NODE,

Itab_vbak type standard table of vbak.

  • navigate from <CONTEXT> to <SFLIGHT> via lead selection

VBAK_NODE = wd_Context->get_Child_Node( Name = `VBAK_NODE` ).

select * from vbak into table Itab_vbak.

vbak_node->Bind_Table( Itab_vbak ).

endmethod.

So it get the full data on kliking the action button, what coding do I need to restrict this to the values in vbeln parameters. Please suggest.

Thanks in advance.

Anupama.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you should have a look at this weblog,

it contains code-examples:

[Weblog by rich Heilman|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2868] [original link is broken] [original link is broken] [original link is broken];

if you're not working with select options, but with a single input field,

you should read the vblnr from the context:

data: lo_nd_input type ref to if_wd_context_node,

lo_el_input type ref to if_wd_context_element,

lv_vblnr type vblnr.

lo_nd_input ?= wd_context->get_child_node( name = 'name of the input node' ).

lo_el_nd ?= lo_nd_input->get_selected_element( ).

lo_el_input->get_attribute( exporting name = 'name of the variable'

importing value = lv_vblnr ).

select * from vbak into table lt_vbak where vblnr eq lv_vblnr.

grtz,

Koen

Former Member
0 Kudos

Hi Koen,

Its working GR8, my isue is solved, This is what I used. Let me know if I have used some wrong codes here ..... below I have cut and pasted the codes. Though this is not very urgent ......

method ONACTIONGET_VBAP .

  • data declaration

data:

Node_vbak type REF TO IF_WD_CONTEXT_NODE,

node_vbeln type REF TO IF_WD_CONTEXT_NODE,

el_vbeln type ref to if_wd_context_element ,

Itab_vbak type standard table of Vbak.

data: lv_vbeln type vbeln.

**lo_nd_input ?= wd_context->get_child_node( name = 'VBAK_NODE' ).

*lo_el_nd ?= lo_nd_input->get_selected_element( ).

Node_vbeln = wd_Context->get_Child_Node( Name = `VBELN_NODE` ).

*el_vbeln = node_vbeln->get_selected_elements( ).

node_vbeln->get_attribute( exporting name = 'VBELN'

importing value = lv_vbeln ).

select * from vbak into table itab_vbak where vbeln eq lv_vbeln.

  • navigate from <CONTEXT> to <SFLIGHT> via lead selection

Node_vbak = wd_Context->get_Child_Node( Name = `VBAK_NODE` ).

  • bind internal table to context node <SFLIGHT>

Node_VBAK->Bind_Table( Itab_VBAK ).

endmethod.

Answers (0)