cancel
Showing results for 
Search instead for 
Did you mean: 

how to use submit button

Former Member
0 Kudos

Hi Experts,

I have developed one application in that at last i have used two buttons submit and reset,

now when i click submit button these details should be stored in a table,

so could you please help me what kind of coding i have to write in action part.

Thanks,

Raju

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

For the Button UI elemented inserted create Event for it and for that write the code to get get the values from table UI and insert into ZTABLE.

DATA lo_nd_vbap TYPE REF TO if_wd_context_node.

DATA lo_el_vbap TYPE REF TO if_wd_context_element.

DATA ls_vbap TYPE wd_this->element_vbap.

DATA lt_vbap TYPE TABLE OF wd_this->element_vbap.

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

lo_nd_vbap = wd_context->get_child_node( name =

wd_this->wdctx_vbap ).

      • To read Table values

CALL METHOD lo_nd_vbap->get_static_attributes_table

EXPORTING

from = 1

to = 2147483647

IMPORTING

table = lt_vbap

.

***( insert into Ztable

INSERT ztable from TABLE lt_vbap.

Regards,

Vinoth R

Former Member
0 Kudos

Hi Raju,

Please read NET310 document its very simple to understand, and there are some WDA E learnings through which u can understand better

Thanks

Pavan

former_member199125
Active Contributor
0 Kudos

Raju,

In your submit button action you have write the code like below

for example , in your context.. you have node say NEMPID in that attribute say AEMPID

in ur submit action , first fetch the AEMPID value like

data lo_nd_nempid type ref to if_wd_context_node.

data lo_el_nempid type ref to if_wd_context_element.

data ls_nempid type wd_this->element_nempid.

data lv_aempid like ls_nempid-aempid.

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

lo_nd_nempid = wd_context->get_child_node( name = wd_this->wdctx_nempid ).

  • get element via lead selection

lo_el_nempid = lo_nd_nempid->get_element( ).

lo_el_nempid->get_attribute(

exporting

name = `AEMPID`

importing

value = lv_aempid ).

Now you have to save Aempid( emp id ) in one ztable.

f you want to insert or modify..

data wa_table type ztable.

wa_table-empid = lv_aempid.

modify ztable from wa_table.

Thats it, hope you understand the logic.

Regards

Srinivas

Regards

Srinivas

Former Member
0 Kudos

Very unclear question, but you would normally be looking at defining an Action for your button, then using that action to call a method that stores the data in the persistent (DB) layer - or better - calling a method of the object you're using to represent your data. Look at some of the WDA tutorials here on SDN before proceeding, or buy the excellent book about WDA from sap-press.com. It can even be bought as a read-online-issue, so you could get access to it immediately.

Regards,

Trond

saravanan_narayanan
Active Contributor
0 Kudos

Hello Rajue,

you have to retrieve the data from the your context nodes and fire the SQL statements to store the data in the table. If this is not what you expected, then elaborate your question pls.

BR, Saravanan